From a30f367425870f10cd95bce39e6ec13f98b73fe5 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 22 Nov 2012 11:18:11 +0100 Subject: Added template for the page of favorite articles. --- source/templates/base.html | 5 +++++ source/templates/favorites.html | 37 +++++++++++++++++++++++++++++++++++++ source/templates/plain_text.html | 7 +------ 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 source/templates/favorites.html (limited to 'source/templates') diff --git a/source/templates/base.html b/source/templates/base.html index 54cfc524..899bbce3 100644 --- a/source/templates/base.html +++ b/source/templates/base.html @@ -11,5 +11,10 @@ ${self.body()} +
+

This software is under GPLv3 license. You are welcome to copy, modify or +redistribute the source code according to the +GPLv3 license.

+ \ No newline at end of file diff --git a/source/templates/favorites.html b/source/templates/favorites.html new file mode 100644 index 00000000..6cdf34bc --- /dev/null +++ b/source/templates/favorites.html @@ -0,0 +1,37 @@ +## favorites.html +<%inherit file="base.html"/> +<%page enable_loop="True"/> +<% +import utils +%> +

pyAggr3g470r - News aggregator

+pyAggr3g470r (source code) +
+

Your favorites articles

+ %for feed in feeds: + <% + new_feed_section = True + %> + %for article in articles[feed["feed_id"]]: + %if article["article_like"]: + <% + if new_feed_section: + new_feed_section = False + title = """

%s

\n""" % \ + (feed["feed_id"], feed["site_link"], feed["feed_title"], feed["feed_link"], feed["feed_image"]) + else: + title = "" + article_content = utils.clear_string(article["article_content"]) + if article_content: + description = " ".join(article_content[:500].split(' ')[:-1]) + else: + description = "No description." + %> + ${title} + + + ${article["article_date"].strftime('%Y-%m-%d %H:%M')} - ${article["article_title"][:150]}${description}
+ %endif + %endfor + %endfor \ No newline at end of file diff --git a/source/templates/plain_text.html b/source/templates/plain_text.html index 3076e5bb..44b7da91 100644 --- a/source/templates/plain_text.html +++ b/source/templates/plain_text.html @@ -2,9 +2,4 @@ <%inherit file="base.html"/>

${article_title} from ${feed_title}


- ${description} -
-

This software is under GPLv3 license. You are welcome to copy, modify or - redistribute the source code according to the - GPLv3 license.

-
\ No newline at end of file + ${description} \ No newline at end of file -- cgit