aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource/pyAggr3g470r.py17
-rw-r--r--source/templates/feed.html6
2 files changed, 23 insertions, 0 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py
index abfdaa2a..71aa3243 100755
--- a/source/pyAggr3g470r.py
+++ b/source/pyAggr3g470r.py
@@ -514,6 +514,23 @@ class pyAggr3g470r(object):
remove_feed.exposed = True
@auth.require()
+ def change_site_url(self, feed_id, old_site_url, new_site_url):
+ """
+ Enables to change the URL of a site present in the database.
+ """
+ try:
+ self.mongo.update_feed(feed_id, {"site_link":new_site_url})
+ tmpl = lookup.get_template("confirmation.html")
+ message = "<p>The URL of the site has been changed.</p>"
+ except:
+ tmpl = lookup.get_template("error.html")
+ message = "<p>Error when changing the URL of the site.</p>"
+ finally:
+ return tmpl.render(message=message)
+
+ change_site_url.exposed = True
+
+ @auth.require()
def change_feed_url(self, feed_id, old_feed_url, new_feed_url):
"""
Enables to change the URL of a feed already present in the database.
diff --git a/source/templates/feed.html b/source/templates/feed.html
index 66d344db..f4a35e77 100644
--- a/source/templates/feed.html
+++ b/source/templates/feed.html
@@ -109,6 +109,12 @@ import utils
<input type="hidden" name="feed_id" value="${feed['feed_id']}" />
</form>
+ <form method=post action="/change_site_url/">
+ <input type="url" name="new_site_url" value="" placeholder="Enter a new URL for this site (then press Enter)." maxlength=2048 autocomplete="on" size="50" />
+ <input type="hidden" name="feed_id" value="${feed['feed_id']}" />
+ <input type="hidden" name="old_site_url" value="${feed['site_link']}" />
+ </form>
+
<form method=post action="/change_feed_url/">
<input type="url" name="new_feed_url" value="" placeholder="Enter a new URL in order to retrieve articles (then press Enter)." maxlength=2048 autocomplete="on" size="50" />
<input type="hidden" name="feed_id" value="${feed['feed_id']}" />
bgstack15