diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-12-05 21:04:45 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2012-12-05 21:04:45 +0100 |
commit | 853a408c1df0bace3a11043f13daec3b0ddbfc9e (patch) | |
tree | aab9b54f63afa8f828483b0edcc20efabe19cd02 /source | |
parent | Template for the /search page. (diff) | |
download | newspipe-853a408c1df0bace3a11043f13daec3b0ddbfc9e.tar.gz newspipe-853a408c1df0bace3a11043f13daec3b0ddbfc9e.tar.bz2 newspipe-853a408c1df0bace3a11043f13daec3b0ddbfc9e.zip |
New template for confirmation message.
Diffstat (limited to 'source')
-rwxr-xr-x | source/pyAggr3g470r.py | 43 | ||||
-rw-r--r-- | source/templates/confirmation.html | 4 |
2 files changed, 14 insertions, 33 deletions
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 += """<div class="left inner">""" - feed = self.mongo.get_feed(feed_id) self.mongo.delete_feed(feed_id) utils.remove_feed(feed["feed_link"]) - - html += """<p>All articles from the feed <i>%s</i> are now removed from the base.</p><br />""" % \ - (feed["feed_title"],) - html += """<a href="/management/">Back to the management page.</a><br />\n""" - html += "<hr />\n" - html += htmlfooter - return html + message = """All articles from the feed <i>%s</i> 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 += """<div class="left inner">""" self.mongo.update_feed(feed_id, {"feed_link":new_feed_url}) utils.change_feed_url(old_feed_url, new_feed_url) - html += "<p>The URL of the feed has been changed.</p>" - html += "<hr />\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 += """<div class="left inner">""" self.mongo.update_feed(feed_id, {"feed_title":new_feed_name}) - html += "<p>The name of the feed has been changed.</p>" - html += "<hr />\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 += """<div class="left inner">""" self.mongo.update_feed(feed_id, {"feed_image":new_feed_logo}) - html += "<p>The logo of the feed has been changed.</p>" - html += "<hr />\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"/> +<div class="left inner"> +<p>${message}</p> |