From c2220095f3f9cc4042c2df2d3791bfd3c958d709 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Tue, 22 Feb 2011 18:10:18 +0100 Subject: Improvement on the feed page. Only displays favs when there is. --- pyAggr3g470r.py | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 7cce0064..3d52f704 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -519,6 +519,7 @@ class Root: def feed(self, feed_id): """ + This page gives summary informations about a feed. """ try: feed = self.feeds[feed_id] @@ -572,26 +573,23 @@ class Root: html += "
\n" html += """All articles   """ % (feed.feed_id,) + favs = [article for article in feed.articles.values() if article.like == "1"] + if len(favs) != 0: + html += "

Your favorites articles for this feed

" + for article in favs: + if article.like == "1": + # descrition for the CSS ToolTips + article_content = utils.clear_string(article.article_description) + if article_content: + description = " ".join(article_content[:500].split(' ')[:-1]) + else: + description = "No description." - html += "

Your favorites articles for this feed

" - for article in feed.articles.values(): - if article.like == "1": - # descrition for the CSS ToolTips - article_content = utils.clear_string(article.article_description) - if article_content: - description = " ".join(article_content[:500].split(' ')[:-1]) - else: - description = "No description." - - # a description line per article (date, title of the article and - # CSS description tooltips on mouse over) - html += article.article_date + " - " + \ - """%s%s
\n""" % \ - (feed.feed_id, article.article_id, article.article_title[:150], description) - - - - + # a description line per article (date, title of the article and + # CSS description tooltips on mouse over) + html += article.article_date + " - " + \ + """%s%s
\n""" % \ + (feed.feed_id, article.article_id, article.article_title[:150], description) html += "
" html += htmlfooter return html -- cgit