From 84de9af5e55e5cf52345a1d78bde436c5ba87b61 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 22 Nov 2012 15:09:03 +0100 Subject: Template for the /management page. --- source/pyAggr3g470r.py | 48 ++++---------------------------------- source/templates/management.html | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 44 deletions(-) create mode 100644 source/templates/management.html diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index a8659e1a..9c4e6766 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -276,50 +276,10 @@ class pyAggr3g470r(object): nb_articles = self.mongo.nb_articles() nb_unread_articles = self.mongo.nb_unread_articles() - html = htmlheader() - html += htmlnav - html += """
\n""" - html += "

Add Feeds

\n" - # Form: add a feed - html += """
\n
\n""" - - if feeds: - # Form: delete a feed - html += "

Delete Feeds

\n" - html += """
\n""" - - html += """

Active e-mail notifications: %s

\n""" % \ - (nb_mail_notifications,) - html += """

You like %s article(s).

\n""" % \ - (nb_favorites, ) - - html += "
\n" - - # Informations about the data base of articles - html += """

%s article(s) are stored in the database with - %s unread article(s).
\n""" % \ - (nb_articles, nb_unread_articles) - #html += """Database: %s.\n
Size: %s bytes.
\n""" % \ - #(os.path.abspath(utils.sqlite_base), os.path.getsize(utils.sqlite_base)) - html += 'Advanced statistics.

\n' - - html += """
\n
\n""" - html += """
\n
\n""" - - # Export functions - html += "

Export articles

\n\n" - html += """
\n\t\n
\n""" - html += "
" - html += htmlfooter - return html + tmpl = lookup.get_template("management.html") + return tmpl.render(feeds=feeds, nb_mail_notifications=nb_mail_notifications, \ + nb_favorites=nb_favorites, nb_articles=nb_articles, \ + nb_unread_articles=nb_unread_articles) management.exposed = True diff --git a/source/templates/management.html b/source/templates/management.html new file mode 100644 index 00000000..fbb27c37 --- /dev/null +++ b/source/templates/management.html @@ -0,0 +1,50 @@ +## management.html +<%inherit file="base.html"/> +

pyAggr3g470r - News aggregator

+pyAggr3g470r (source code) +
+

Add Feeds

+
+ + +
+ + %if feeds: +

Delete Feeds

+
+ + +
+ +

Active e-mail notifications: ${nb_mail_notifications}

+ +

You like ${nb_favorites} article(s).

+ %endif + +
+ +

${nb_articles} article(s) are stored in the database with ${nb_unread_articles} unread article(s).
+ Advanced statistics.

+ +
+ +
+
+ +
+ +

Export articles

+
+ + +
\ No newline at end of file -- cgit