aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-12-07 10:59:00 +0100
committercedricbonhomme <devnull@localhost>2010-12-07 10:59:00 +0100
commit09f56684dc9bd6136644cbc08de8eab887b15170 (patch)
tree10e42726da390409b023d93c004c067f8bac400c /pyAggr3g470r.py
parentBetter comments. (diff)
downloadnewspipe-09f56684dc9bd6136644cbc08de8eab887b15170.tar.gz
newspipe-09f56684dc9bd6136644cbc08de8eab887b15170.tar.bz2
newspipe-09f56684dc9bd6136644cbc08de8eab887b15170.zip
Added links to Previous and following articles on the description page.
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-xpyAggr3g470r.py26
1 files 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<br />"
else:
- html += "No description available."
+ html += "No description available.\n<br />"
+
+ # Previous and following articles
+ try:
+ following = feed.articles.values()[feed.articles.keys().index(article_id) - 1]
+ html += """<div style="float:right;"><a href="/description/%s:%s" title="%s">Following</a></div>\n""" % \
+ (feed_id, following.article_id, following.article_title)
+ except:
+ pass
+ try:
+ previous = feed.articles.values()[feed.articles.keys().index(article_id) + 1]
+ html += """<div style="float:left;"><a href="/description/%s:%s" title="%s">Previous</a></div>\n""" % \
+ (feed_id, previous.article_id, previous.article_title)
+ except:
+ pass
+
+ html += "\n</div>\n"
# Footer menu
- html += "\n</div>\n<hr />\n"
+ html += "<hr />\n"
html += """\n<a href="/plain_text/%s:%s">Plain text</a>\n""" % (feed_id, article.article_id)
html += """ - <a href="/epub/%s:%s">Export to EPUB</a>\n""" % (feed_id, article.article_id)
html += """<br />\n<a href="%s">Complete story</a>\n<br />\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
bgstack15