aboutsummaryrefslogtreecommitdiff
path: root/source/pyAggr3g470r.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2012-11-25 19:23:50 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2012-11-25 19:23:50 +0100
commit16f5be7f1446d3906343c6bf4ebe44fd3c3395b0 (patch)
tree30f0348152a94d10b3c081b7de9000f0d59b69d0 /source/pyAggr3g470r.py
parentTemplate for the /notifications page. (diff)
downloadnewspipe-16f5be7f1446d3906343c6bf4ebe44fd3c3395b0.tar.gz
newspipe-16f5be7f1446d3906343c6bf4ebe44fd3c3395b0.tar.bz2
newspipe-16f5be7f1446d3906343c6bf4ebe44fd3c3395b0.zip
Template for the /statistics page.
Diffstat (limited to 'source/pyAggr3g470r.py')
-rwxr-xr-xsource/pyAggr3g470r.py23
1 files changed, 4 insertions, 19 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py
index fb7da783..a7f12de8 100755
--- a/source/pyAggr3g470r.py
+++ b/source/pyAggr3g470r.py
@@ -289,25 +289,10 @@ class pyAggr3g470r(object):
More advanced statistics.
"""
articles = self.mongo.get_all_articles()
- html = htmlheader()
- html += htmlnav
- html += """<div class="left inner">\n"""
-
- # Some statistics (most frequent word)
- if articles:
- top_words = utils.top_words(articles, n=50, size=int(word_size))
- html += "<h1>Statistics</h1>\n"
- html += "<h3>Tag cloud</h3>\n"
- # Tags cloud
- html += '<form method=get action="/statistics/">\n'
- html += "Minimum size of a word:\n"
- html += """<input type="number" name="word_size" value="%s" min="2" max="15" step="1" size="2"></form>\n""" % (word_size)
- html += '<div style="width: 35%; overflow:hidden; text-align: justify">' + \
- utils.tag_cloud(top_words) + '</div>'
- html += "<hr />\n"
-
- html += htmlfooter
- return html
+ top_words = utils.top_words(articles, n=50, size=int(word_size))
+ tag_cloud = utils.tag_cloud(top_words)
+ tmpl = lookup.get_template("statistics.html")
+ return tmpl.render(articles=articles, word_size=word_size, tag_cloud=tag_cloud)
statistics.exposed = True
bgstack15