diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-11-25 17:34:38 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-11-25 17:34:38 +0100 |
commit | 4a3f74aa4e78dec3a9591edd6d427646d81c5b94 (patch) | |
tree | b8dea8b7ace6dccf45f5d964aacbe228f5ce3a74 /source | |
parent | Removed "enable_loop=True". (diff) | |
download | newspipe-4a3f74aa4e78dec3a9591edd6d427646d81c5b94.tar.gz newspipe-4a3f74aa4e78dec3a9591edd6d427646d81c5b94.tar.bz2 newspipe-4a3f74aa4e78dec3a9591edd6d427646d81c5b94.zip |
Template for the /notifications page.
Diffstat (limited to 'source')
-rwxr-xr-x | source/pyAggr3g470r.py | 16 | ||||
-rw-r--r-- | source/templates/notifications.html | 17 |
2 files changed, 19 insertions, 14 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index 4cb304fe..fb7da783 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -842,21 +842,9 @@ class pyAggr3g470r(object): """ List all active e-mail notifications. """ - html = htmlheader() - html += htmlnav - html += """<div class="left inner">""" feeds = self.mongo.get_all_feeds(condition=("mail",True)) - if feeds != []: - html += "<h1>You are receiving e-mails for the following feeds:</h1>\n" - for feed in feeds: - html += """\t<a href="/articles/%s">%s</a> - <a href="/mail_notification/0:%s">Stop</a><br />\n""" % \ - (feed["feed_id"], feed["feed_title"], feed["feed_id"]) - else: - html += "<p>No active notifications.<p>\n" - html += """<p>Notifications are sent to: <a href="mail:%s">%s</a></p>""" % \ - (conf.mail_to, conf.mail_to) - html += "\n<hr />\n" + htmlfooter - return html + tmpl = lookup.get_template("notifications.html") + return tmpl.render(feeds=feeds, mail_to=conf.mail_to) notifications.exposed = True diff --git a/source/templates/notifications.html b/source/templates/notifications.html new file mode 100644 index 00000000..fa675d6b --- /dev/null +++ b/source/templates/notifications.html @@ -0,0 +1,17 @@ +## article.html +<%inherit file="base.html"/> +<h1><div class="right innerlogo"><a href="/"><img src="/img/tuxrss.png" title="What's new today?"/></a> +</div><a name="top"><a href="/">pyAggr3g470r - News aggregator</a></a></h1> +<a href="http://bitbucket.org/cedricbonhomme/pyaggr3g470r/" rel="noreferrer" target="_blank">pyAggr3g470r (source code)</a> +<div class="left inner"> + %if feeds != []: + <h1>You are receiving e-mails for the following feeds:</h1> + <ul> + %for feed in feeds: + <li><a href="/feed/${feed['feed_id']}">${feed['feed_title']}</a> - <a href="/mail_notification/0:${feed['feed_id']}">Stop</a></li> + %endfor + </ul> + %else: + <p>No active notifications.<p> + %endif + <p>Notifications are sent to: <a href="mail:${mail_to}">${mail_to}</a></p> |