From 66177d7bb656aa6ec49114051aabf764d452038c Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 18 Mar 2013 08:43:02 +0100 Subject: The plain_text views and plain_text template has been removed. There is now alink in the /article page to see the content of the article in plain text. --- source/pyAggr3g470r.py | 27 +++++---------------------- source/static/templates/article.html | 2 +- source/static/templates/plain_text.html | 5 ----- 3 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 source/static/templates/plain_text.html (limited to 'source') diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index c90dfcb4..e7beac47 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -192,7 +192,7 @@ class pyAggr3g470r(object): fetch.exposed = True @auth.require() - def article(self, param): + def article(self, param, plain_text=0): """ Display the article in parameter in a new Web page. """ @@ -209,7 +209,10 @@ class pyAggr3g470r(object): self.mark_as_read("Article:"+article["article_id"]+":"+feed["feed_id"]) # Description (full content) of the article - description = article["article_content"] + if plain_text == "1": + description = utils.clear_string(article["article_content"]) + else: + description = article["article_content"] if description: p = re.compile(r'<') q = re.compile(r'>') @@ -331,26 +334,6 @@ class pyAggr3g470r(object): history.exposed = True - @auth.require() - def plain_text(self, target): - """ - Display an article in plain text (without HTML tags). - """ - try: - feed_id, article_id = target.split(':') - feed = self.mongo.get_feed(feed_id) - article = self.mongo.get_articles(feed_id, article_id) - except: - return self.error("

Bad URL. This article do not exists.

") - description = utils.clear_string(article["article_content"]) - if not description: - description = "Unvailable" - tmpl = lookup.get_template("plain_text.html") - return tmpl.render(feed_title=feed["feed_title"], \ - article_title=article["article_title"], description = description) - - plain_text.exposed = True - @auth.require() def error(self, message): """ diff --git a/source/static/templates/article.html b/source/static/templates/article.html index 9225993a..123aaa9f 100644 --- a/source/static/templates/article.html +++ b/source/static/templates/article.html @@ -19,7 +19,7 @@
- Plain text + Plain text - Export to EPUB
Complete story diff --git a/source/static/templates/plain_text.html b/source/static/templates/plain_text.html deleted file mode 100644 index 44b7da91..00000000 --- a/source/static/templates/plain_text.html +++ /dev/null @@ -1,5 +0,0 @@ -## plain_text.html -<%inherit file="base.html"/> -
-

${article_title} from ${feed_title}


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