aboutsummaryrefslogtreecommitdiff
path: root/source/pyAggr3g470r.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2012-11-25 16:22:15 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2012-11-25 16:22:15 +0100
commitce9e5e6988b5777d78d714d6ef695472d55c6099 (patch)
tree732df494ae83cd74bab1d366e59681030e3a4722 /source/pyAggr3g470r.py
parentTemplate for the /management page. (diff)
downloadnewspipe-ce9e5e6988b5777d78d714d6ef695472d55c6099.tar.gz
newspipe-ce9e5e6988b5777d78d714d6ef695472d55c6099.tar.bz2
newspipe-ce9e5e6988b5777d78d714d6ef695472d55c6099.zip
Template for the /articles page.
Diffstat (limited to 'source/pyAggr3g470r.py')
-rwxr-xr-xsource/pyAggr3g470r.py43
1 files changed, 2 insertions, 41 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py
index 9c4e6766..4cb304fe 100755
--- a/source/pyAggr3g470r.py
+++ b/source/pyAggr3g470r.py
@@ -606,47 +606,8 @@ class pyAggr3g470r(object):
articles = self.mongo.get_articles_from_collection(feed_id)
except KeyError:
return self.error_page("This feed do not exists.")
- html = htmlheader()
- html += htmlnav
- html += """<div class="right inner">\n"""
- html += """<a href="/mark_as_read/Feed:%s">Mark all articles from this feed as read</a>""" % (feed_id,)
- html += """<br />\n<form method=get action="/search/%s"><input type="search" name="query" value="" placeholder="Search this feed" maxlength=2048 autocomplete="on"></form>\n""" % ("Feed:"+feed_id,)
- html += "<hr />\n"
- html += self.create_list_of_feeds()
- html += """</div> <div class="left inner">"""
- html += """<h1>Articles of the feed <i><a href="/feed/%s">%s</a></i></h1><br />""" % (feed_id, feed["feed_title"])
-
- for article in articles:
-
- if article["article_readed"] == False:
- # not readed articles are in bold
- not_read_begin, not_read_end = "<b>", "</b>"
- else:
- not_read_begin, not_read_end = "", ""
-
- if article["article_like"] == True:
- like = """ <img src="/img/heart.png" title="I like this article!" />"""
- else:
- like = ""
-
- # descrition for the CSS ToolTips
- article_content = utils.clear_string(article["article_content"])
- 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"].strftime('%Y-%m-%d %H:%M') + " - " + \
- """<a class="tooltip" href="/article/%s:%s" rel="noreferrer" target="_blank">%s%s%s<span class="classic">%s</span></a>""" % \
- (feed_id, article["article_id"], not_read_begin, \
- article["article_title"][:150], not_read_end, description) + like + "<br />\n"
-
- html += """\n<h4><a href="/">All feeds</a></h4>"""
- html += "<hr />\n"
- html += htmlfooter
- return html
+ tmpl = lookup.get_template("articles.html")
+ return tmpl.render(articles=articles, feed=feed)
articles.exposed = True
bgstack15