From 1b198d1f9730839b47b78ce248d6b36dc803cba2 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Wed, 17 Nov 2010 22:33:41 +0100 Subject: Introduction of CCS tooltips (at the index page) to present description of articles on mouse over (without javascript). --- pyAggr3g470r.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 31c1c875..15353150 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -131,7 +131,7 @@ class Root: if self.articles: html += '\n' html += '\n' - html += '  |  ' + html += '      ' html += """\n""" % \ (self.nb_favorites,) @@ -139,7 +139,7 @@ class Root: html += """\n""" % \ (self.nb_mail_notifications,) - html += '  |  ' + html += '      ' html += '\n' if self.nb_unread_articles != 0: html += """\n""" % \ @@ -175,12 +175,20 @@ class Root: else: like = "" - # title of the article - html += article[1].encode('utf-8') + \ - " - " + not_read_begin + \ - """%s""" % \ - (rss_feed_id, article[0].encode('utf-8'), article[2].encode('utf-8')[:150]) + \ - not_read_end + like + \ + # descrition for the CSS ToolTips + article_content = utils.clear_string(article[4].encode('utf-8')) + 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[1].encode('utf-8') + " - " + \ + """%s%s%s%s""" % \ + (rss_feed_id, article[0].encode('utf-8'), not_read_begin, \ + " ".join(article[2].encode('utf-8')[:150].split(' ')[:-1]), \ + not_read_end, description) + like + \ "
\n" html += "
\n" -- cgit