Permalink
Browse files

Add 'howto' and 'about' page.

  • Loading branch information...
ydoovv committed Oct 18, 2010
1 parent d0b795e commit e691c4bb2eef03365d35661234818accf9ef9093
Showing with 62 additions and 1 deletion.
  1. +21 −0 main.py
  2. +20 −0 templates/about.html
  3. +1 −1 templates/base.html
  4. +20 −0 templates/howto.html
View
21 main.py
@@ -61,11 +61,32 @@ def get(self):
template_values["flashes"] = flashes
self.render(template_values)
+class HowtoPage(webapp.RequestHandler):
+ def get(self):
+ template_values = {"flashes": "An app that save links from your Twitter's Favorites to Instapaper."}
+ template_values["tweets"] = [{"content": "1. Login Instapaper.com"},
+ {"content": "2. Enter your Twitter id & press 'Get favs!'"},
+ {"content": "3. click 'Read Later' to save the link to Instapaper"},]
+ path = os.path.join(os.path.dirname(__file__), 'templates/howto.html')
+ self.response.out.write(template.render(path, template_values))
+
+class AboutPage(webapp.RequestHandler):
+ def get(self):
+ template_values = {"flashes": "About about."}
+ template_values["tweets"] = [{'content': 'Author: vvoody <a href="http://vvoody.org/">vvoody.org</a>'},
+ {'content': 'Contact: wxj.g.sh_A_T_gmail.com'},
+ {'content': 'Source: <a href="http://github.com/vvoody/digest-favs">digest-favs@github</a>'},
+ {'content': 'Contact: A Chinese blog <a href="http://vvoody.org/blog/?p=618">post</a> to know more.'},]
+ path = os.path.join(os.path.dirname(__file__), 'templates/about.html')
+ self.response.out.write(template.render(path, template_values))
+
def main():
application = webapp.WSGIApplication(
[
(r'/', MainHandler),
(r'/freejump', FreejumpPage),
+ (r'/howto', HowtoPage),
+ (r'/about', AboutPage),
],
debug=True)
run_wsgi_app(application)
View
@@ -0,0 +1,20 @@
+{% extends "base.html" %}
+{% block body %}
+
+ <div class=twitbox>
+ <h3>Your twitter id?</h3>
+ <form action="/" method="get">
+ <p><input id="id" type="text" name="id">
+<!-- <input id="instapaper" type="text" name="instapaper"> -->
+ <input type="submit" value="Get favs!">
+ </form>
+ </div>
+
+<!-- tweets body -->
+ <ul class=messages id="messages_body">
+ {% for tweet in tweets %}
+ <li><span>{{ tweet.content }}</span>
+ {% endfor %}
+ </ul>
+
+{% endblock %}
View
@@ -10,7 +10,7 @@
<h1>Digest Your Twitter's Favorites</h1>
<div class=navigation>
<a href="/">Home</a> |
- <a href="/about">Howto</a> |
+ <a href="/howto">Howto</a> |
<a href="/about">About</a>
</div>
{% if flashes %}
View
@@ -0,0 +1,20 @@
+{% extends "base.html" %}
+{% block body %}
+
+ <div class=twitbox>
+ <h3>Your twitter id?</h3>
+ <form action="/" method="get">
+ <p><input id="id" type="text" name="id">
+<!-- <input id="instapaper" type="text" name="instapaper"> -->
+ <input type="submit" value="Get favs!">
+ </form>
+ </div>
+
+<!-- tweets body -->
+ <ul class=messages id="messages_body">
+ {% for tweet in tweets %}
+ <li><span>{{ tweet.content }}</span>
+ {% endfor %}
+ </ul>
+
+{% endblock %}

0 comments on commit e691c4b

Please sign in to comment.