From 4a3f74aa4e78dec3a9591edd6d427646d81c5b94 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 25 Nov 2012 17:34:38 +0100 Subject: Template for the /notifications page. --- source/pyAggr3g470r.py | 16 ++-------------- source/templates/notifications.html | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 source/templates/notifications.html 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 += """
""" feeds = self.mongo.get_all_feeds(condition=("mail",True)) - if feeds != []: - html += "

You are receiving e-mails for the following feeds:

\n" - for feed in feeds: - html += """\t%s - Stop
\n""" % \ - (feed["feed_id"], feed["feed_title"], feed["feed_id"]) - else: - html += "

No active notifications.

\n" - html += """

Notifications are sent to: %s

""" % \ - (conf.mail_to, conf.mail_to) - html += "\n
\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"/> +

pyAggr3g470r - News aggregator

+pyAggr3g470r (source code) +
+ %if feeds != []: +

You are receiving e-mails for the following feeds:

+ + %else: +

No active notifications.

+ %endif +

Notifications are sent to: ${mail_to}

-- cgit