From 16f5be7f1446d3906343c6bf4ebe44fd3c3395b0 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 25 Nov 2012 19:23:50 +0100 Subject: Template for the /statistics page. --- source/pyAggr3g470r.py | 23 ++++------------------- source/templates/statistics.html | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 source/templates/statistics.html (limited to 'source') 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 += """
\n""" - - # Some statistics (most frequent word) - if articles: - top_words = utils.top_words(articles, n=50, size=int(word_size)) - html += "

Statistics

\n" - html += "

Tag cloud

\n" - # Tags cloud - html += '
\n' - html += "Minimum size of a word:\n" - html += """
\n""" % (word_size) - html += '
' + \ - utils.tag_cloud(top_words) + '
' - html += "
\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 diff --git a/source/templates/statistics.html b/source/templates/statistics.html new file mode 100644 index 00000000..42577efd --- /dev/null +++ b/source/templates/statistics.html @@ -0,0 +1,17 @@ +## statistics.html +<%inherit file="base.html"/> +

pyAggr3g470r - News aggregator

+pyAggr3g470r (source code) +
+ %if articles: +

Statistics

+

Tag cloud

+
+ Minimum size of a word: + +
+
+ ${tag_cloud} +
+ %endif \ No newline at end of file -- cgit