From 853a408c1df0bace3a11043f13daec3b0ddbfc9e Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 5 Dec 2012 21:04:45 +0100 Subject: New template for confirmation message. --- source/pyAggr3g470r.py | 43 +++++++++----------------------------- source/templates/confirmation.html | 4 ++++ 2 files changed, 14 insertions(+), 33 deletions(-) create mode 100644 source/templates/confirmation.html (limited to 'source') diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index f1a05edf..eeef1ef6 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -749,20 +749,12 @@ class pyAggr3g470r(object): """ Remove a feed from the file feed.lst and from the MongoDB database. """ - html = htmlheader() - html += htmlnav - html += """
""" - feed = self.mongo.get_feed(feed_id) self.mongo.delete_feed(feed_id) utils.remove_feed(feed["feed_link"]) - - html += """

All articles from the feed %s are now removed from the base.


""" % \ - (feed["feed_title"],) - html += """Back to the management page.
\n""" - html += "
\n" - html += htmlfooter - return html + message = """All articles from the feed %s are now removed from the base.""" % (feed["feed_title"],) + tmpl = lookup.get_template("confirmation.html") + return tmpl.render(message=message) remove_feed.exposed = True @@ -771,15 +763,10 @@ class pyAggr3g470r(object): """ Enables to change the URL of a feed already present in the database. """ - html = htmlheader() - html += htmlnav - html += """
""" self.mongo.update_feed(feed_id, {"feed_link":new_feed_url}) utils.change_feed_url(old_feed_url, new_feed_url) - html += "

The URL of the feed has been changed.

" - html += "
\n" - html += htmlfooter - return html + tmpl = lookup.get_template("confirmation.html") + return tmpl.render(message="The URL of the feed has been changed.") change_feed_url.exposed = True @@ -788,14 +775,9 @@ class pyAggr3g470r(object): """ Enables to change the name of a feed. """ - html = htmlheader() - html += htmlnav - html += """
""" self.mongo.update_feed(feed_id, {"feed_title":new_feed_name}) - html += "

The name of the feed has been changed.

" - html += "
\n" - html += htmlfooter - return html + tmpl = lookup.get_template("confirmation.html") + return tmpl.render(message="The name of the feed has been changed.") change_feed_name.exposed = True @@ -804,14 +786,9 @@ class pyAggr3g470r(object): """ Enables to change the name of a feed. """ - html = htmlheader() - html += htmlnav - html += """
""" self.mongo.update_feed(feed_id, {"feed_image":new_feed_logo}) - html += "

The logo of the feed has been changed.

" - html += "
\n" - html += htmlfooter - return html + tmpl = lookup.get_template("confirmation.html") + return tmpl.render(message="The logo of the feed has been changed.") change_feed_logo.exposed = True @@ -897,4 +874,4 @@ if __name__ == '__main__': root = pyAggr3g470r() root.favicon_ico = cherrypy.tools.staticfile.handler(filename=os.path.join(conf.path + "/img/favicon.png")) cherrypy.config.update({'error_page.404': error_404}) - cherrypy.quickstart(root, "/" ,config=conf.path + "/cfg/cherrypy.cfg") + cherrypy.quickstart(root, "/" ,config=conf.path + "/cfg/cherrypy.cfg") \ No newline at end of file diff --git a/source/templates/confirmation.html b/source/templates/confirmation.html new file mode 100644 index 00000000..7f631d3c --- /dev/null +++ b/source/templates/confirmation.html @@ -0,0 +1,4 @@ +## confirmation.html +<%inherit file="base.html"/> +
+

${message}

-- cgit