diff options
Diffstat (limited to 'source')
-rwxr-xr-x | source/pyAggr3g470r.py | 6 | ||||
-rw-r--r-- | source/templates/feed.html | 19 |
2 files changed, 13 insertions, 12 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index 22649ec9..3ab5e0ae 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -300,10 +300,8 @@ class pyAggr3g470r(object): delta_today = datetime.datetime.fromordinal(datetime.date.today().toordinal()) - last_article average = round(float(nb_articles_feed) / abs(delta.days), 2) favorites = self.mongo.get_favorites(feed_id) - - dic = {} - top_words = utils.top_words(articles = self.mongo.get_articles(feed_id), n=50, size=int(word_size)) - tag_cloud = utils.tag_cloud(top_words) + top_words = utils.top_words(articles = self.mongo.get_articles(feed_id), n=50, size=int(word_size)) + tag_cloud = utils.tag_cloud(top_words) tmpl = lookup.get_template("feed.html") return tmpl.render(feed=feed, articles=articles, favorites=favorites, \ diff --git a/source/templates/feed.html b/source/templates/feed.html index 5fc5d170..c5ca831c 100644 --- a/source/templates/feed.html +++ b/source/templates/feed.html @@ -90,6 +90,8 @@ Representing ${(round(float(nb_articles_feed) / nb_articles_total, 4)) * 100} pe %endfor ${html} %endif +%else: + <p>No articles yet.</p> %endif @@ -112,11 +114,12 @@ Representing ${(round(float(nb_articles_feed) / nb_articles_total, 4)) * 100} pe </form> - -</br /> -<h1>Tag cloud</h1> -<form method=get action="/feed/${feed['feed_id']}"> - Minimum size of a word: - <input type="number" name="word_size" value="${word_size}" min="2" max="15" step="1" size="2"> -</form> -<div style="width: 35%; overflow:hidden; text-align: justify">${tag_cloud}</div>
\ No newline at end of file +%if articles != []: + </br /> + <h1>Tag cloud</h1> + <form method=get action="/feed/${feed['feed_id']}"> + Minimum size of a word: + <input type="number" name="word_size" value="${word_size}" min="2" max="15" step="1" size="2"> + </form> + <div style="width: 35%; overflow:hidden; text-align: justify">${tag_cloud}</div> +%endif
\ No newline at end of file |