Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Got initial layout of the site working.
- Loading branch information
0 parents
commit ea0001c
Showing
5 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
application: buzzsearchengine | ||
version: production | ||
runtime: python | ||
api_version: 1 | ||
|
||
handlers: | ||
- url: /css | ||
static_dir: css | ||
- url: /.* | ||
script: main.py | ||
|
||
builtins: | ||
- appstats: on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
h1 { | ||
font-family: 'IM Fell English SC', arial, serif; | ||
/* | ||
Clever CSS effect from: http://twitter.com/#!/mathowie/statuses/5387020843094016 */ | ||
-webkit-text-stroke: 1px #F9C22F; | ||
font-size: 74px; | ||
line-height: 48px; | ||
padding-top: 20px; | ||
|
||
/* Minimize space after logo */ | ||
margin-bottom: 10px; | ||
} | ||
|
||
.input { | ||
width: 100px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="css/style.css" /> | ||
<link href='http://fonts.googleapis.com/css?family=IM+Fell+English+SC&subset=latin' rel='stylesheet' type='text/css'> | ||
<title>BuzzSearch</title></head> | ||
|
||
<body> | ||
<div align="center"> | ||
<h1>BuzzSearch</h1> | ||
|
||
<form method="get" action="/search"> | ||
<input name="q" placeholder="Search Buzz" type="search" size="100" required autofocus> | ||
<input class="input" type="submit" value="Search"> | ||
</form> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (C) 2010 Google Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from google.appengine.ext import webapp | ||
from google.appengine.ext.webapp import template | ||
from google.appengine.ext.webapp import util | ||
|
||
import logging | ||
import os | ||
|
||
class MainPageHandler(webapp.RequestHandler): | ||
def get(self): | ||
path = os.path.join(os.path.dirname(__file__), 'index.html') | ||
self.response.out.write(template.render(path, {}, debug=True)) | ||
|
||
|
||
class SearchHandler(webapp.RequestHandler): | ||
def get(self): | ||
query = self.request.get("q") | ||
results = [] | ||
template_values = {'q':query, 'results':results} | ||
|
||
path = os.path.join(os.path.dirname(__file__), 'results.html') | ||
self.response.out.write(template.render(path, template_values, debug=True)) | ||
|
||
application = webapp.WSGIApplication([('/', MainPageHandler), ('/search', SearchHandler)], debug = True | ||
) | ||
|
||
|
||
def main(): | ||
util.run_wsgi_app(application) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="css/style.css" /> | ||
<link href='http://fonts.googleapis.com/css?family=IM+Fell+English+SC&subset=latin' rel='stylesheet' type='text/css'> | ||
<title>BuzzSearch</title></head> | ||
|
||
<body> | ||
<div align="center"> | ||
<h1>BuzzSearch</h1> | ||
|
||
<form method="get" action="/search"> | ||
<input name="q" placeholder="Search Buzz" type="search" size="100" value="{{ q }}" required> | ||
<input class="input" type="submit" value="Search"> | ||
</form> | ||
</div> | ||
|
||
<div> | ||
{% for result in results %} | ||
|
||
{% endfor %} | ||
</div> | ||
</body> | ||
</html> |