From b7fd7b15968e3a29e75d479a88c8cd9e66c4e194 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 19 Mar 2013 14:00:46 +0100 Subject: Added new views: subscriptions in order to list subscribed feeds. --- source/mongodb.py | 2 +- source/pyAggr3g470r.py | 11 +++++++++++ source/static/templates/subscriptions.html | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 source/static/templates/subscriptions.html (limited to 'source') diff --git a/source/mongodb.py b/source/mongodb.py index 38081780..9e64fe4f 100644 --- a/source/mongodb.py +++ b/source/mongodb.py @@ -45,7 +45,7 @@ class Articles(object): Creates a new collection for a new feed. """ collection = self.db[new_collection["feed_id"]] - collection.create_index([("article_date", pymongo.DESCENDING)], {"unique":False, "sparse":False}) + #collection.create_index([("article_date", pymongo.DESCENDING)], {"unique":False, "sparse":False}) collection.ensure_index('article_content', pymongo.ASCENDING) collection.insert(new_collection) diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index cc5c7d82..b68c8969 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -404,6 +404,17 @@ class pyAggr3g470r(object): like.exposed = True + @auth.require() + def subscriptions(self): + """ + List all active e-mail notifications. + """ + feeds = self.mongo.get_all_feeds() + tmpl = lookup.get_template("subscriptions.html") + return tmpl.render(feeds=feeds) + + subscriptions.exposed = True + @auth.require() def favorites(self): """ diff --git a/source/static/templates/subscriptions.html b/source/static/templates/subscriptions.html new file mode 100644 index 00000000..48781e1e --- /dev/null +++ b/source/static/templates/subscriptions.html @@ -0,0 +1,18 @@ +## subscriptions.html +<%inherit file="base.html"/> +
+

Subscriptions

+ %if feeds: + + %endif + +
+

Add a feed

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