From 62d21db0ea90aec7f653d0cc831d21f534ba638e Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 11 Nov 2016 11:41:26 +0100 Subject: Added a template for articles of public feeds. --- src/web/templates/article_pub.html | 24 ++++++++++++++++++++++++ src/web/views/article.py | 13 +++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/web/templates/article_pub.html (limited to 'src/web') diff --git a/src/web/templates/article_pub.html b/src/web/templates/article_pub.html new file mode 100644 index 00000000..f9275217 --- /dev/null +++ b/src/web/templates/article_pub.html @@ -0,0 +1,24 @@ +{% extends "layout.html" %} +{% block content %} +
+
+

{{ article.title|safe }}

+

{{ _('from') }} {{ article.source.title }}

+
{{ article.date | datetime }}
+
+
+ {{ article.content | safe }} +
+ +
+{% endblock %} diff --git a/src/web/views/article.py b/src/web/views/article.py index 572c019e..163ba413 100644 --- a/src/web/views/article.py +++ b/src/web/views/article.py @@ -39,6 +39,19 @@ def article(article_id=None): head_titles=[clear_string(article.title)], article=article) +@article_bp.route('/public/', methods=['GET']) +@etag_match +def article_pub(article_id=None): + """ + Presents the content of an article of a public feed. + """ + article = ArticleController().get(id=article_id) + if article.source.private: + return render_template('errors/404.html'), 404 + return render_template('article_pub.html', + head_titles=[clear_string(article.title)], + article=article) + @article_bp.route('/like/', methods=['GET']) @login_required -- cgit