From 51e6a6196e4f8e1ea189d145c3c5ada3f87061d4 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Fri, 3 Sep 2010 14:06:01 +0200 Subject: Improvements of list_favorites and unread_articles pages. --- pyAggr3g470r.py | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index a99d16ed..62bca1ff 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -515,15 +515,25 @@ class Root: if feed_id == "All": html += "

Unread article(s)

" for rss_feed_id in self.feeds.keys(): + new_feed_section = True for article in self.articles[rss_feed_id]: if article[5] == "0": + if new_feed_section is True: + new_feed_section = False + html += """

%s +

\n""" % \ + (rss_feed_id, \ + self.feeds[rss_feed_id][5].encode('utf-8'), \ + self.feeds[rss_feed_id][3].encode('utf-8'), \ + self.feeds[rss_feed_id][4].encode('utf-8'), \ + self.feeds[rss_feed_id][2].encode('utf-8')) + html += article[1].encode('utf-8') + \ - """ - %s - from %s
\n""" % \ + """ - %s
\n""" % \ (rss_feed_id, article[0].encode('utf-8'), \ - article[2].encode('utf-8'), \ - self.feeds[rss_feed_id][5].encode('utf-8'), \ - self.feeds[rss_feed_id][3].encode('utf-8')) + article[2].encode('utf-8')) html += """
\nMark articles as read\n""" else: try: @@ -837,14 +847,24 @@ class Root: html += """
""" html += "

Your favorites articles

" for rss_feed_id in self.feeds.keys(): + new_feed_section = True for article in self.articles[rss_feed_id]: if article[7] == "1": + if new_feed_section is True: + new_feed_section = False + html += """

%s +

\n""" % \ + (rss_feed_id, \ + self.feeds[rss_feed_id][5].encode('utf-8'), \ + self.feeds[rss_feed_id][3].encode('utf-8'), \ + self.feeds[rss_feed_id][4].encode('utf-8'), \ + self.feeds[rss_feed_id][2].encode('utf-8')) + html += article[1].encode('utf-8') + \ - """ - %s - from %s
\n""" % \ - (rss_feed_id, article[0].encode('utf-8'), article[2].encode('utf-8'), \ - self.feeds[rss_feed_id][5].encode('utf-8'), \ - self.feeds[rss_feed_id][3].encode('utf-8')) + """ - %s
\n""" % \ + (rss_feed_id, article[0].encode('utf-8'), article[2].encode('utf-8')) html += "
\n" html += htmlfooter return html -- cgit