From 09f56684dc9bd6136644cbc08de8eab887b15170 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Tue, 7 Dec 2010 10:59:00 +0100 Subject: Added links to Previous and following articles on the description page. --- pyAggr3g470r.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 32eda14a..c97a6861 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -455,12 +455,28 @@ class Root: # Description (full content) of the article description = article.article_description if description: - html += description + html += description + "\n
" else: - html += "No description available." + html += "No description available.\n
" + + # Previous and following articles + try: + following = feed.articles.values()[feed.articles.keys().index(article_id) - 1] + html += """
Following
\n""" % \ + (feed_id, following.article_id, following.article_title) + except: + pass + try: + previous = feed.articles.values()[feed.articles.keys().index(article_id) + 1] + html += """
Previous
\n""" % \ + (feed_id, previous.article_id, previous.article_title) + except: + pass + + html += "\n\n" # Footer menu - html += "\n\n
\n" + html += "
\n" html += """\nPlain text\n""" % (feed_id, article.article_id) html += """ - Export to EPUB\n""" % (feed_id, article.article_id) html += """
\nComplete story\n
\n""" % (article.article_link,) @@ -1125,9 +1141,9 @@ class Root: except OSError: return self.error_page(utils.path + "var/export/epub/"+" already exists.\nYou should delete this folder.") section = ez_epub.Section() - section.title = article.article_title + section.title = article.article_title.decode() section.paragraphs = [utils.clear_string(article.article_description)] - ez_epub.makeBook(article.article_title, [feed.feed_title], [section], \ + ez_epub.makeBook(article.article_title.decode(), [feed.feed_title.decode()], [section], \ os.path.normpath(folder + "article"), lang='en-US', cover=None) return self.description(param) epub.exposed = True -- cgit