From ae4bb8ebcbf89ea6615e97df7c4efd5881631205 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sat, 9 May 2015 13:52:37 +0200 Subject: Removed 'articles' view. --- pyaggr3g470r/templates/articles.html | 43 ------------------------------------ pyaggr3g470r/templates/feed.html | 2 +- pyaggr3g470r/templates/home.html | 2 -- pyaggr3g470r/views/article.py | 16 -------------- 4 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 pyaggr3g470r/templates/articles.html (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/templates/articles.html b/pyaggr3g470r/templates/articles.html deleted file mode 100644 index 383c28a4..00000000 --- a/pyaggr3g470r/templates/articles.html +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "layout.html" %} -{% block content %} -
-
-

{{ feed.title|safe }}

- - - {% if nb_articles == 10**9 %} -

{{ feed.articles.all()|count }} articles.

- {% else %} -

Last {{ feed.articles.all()|count }} articles. See all articles.

- {% endif %} -
- {% if feed.articles.all()|count == 0 %} -

No articles.

- {% else %} - {% for number in range(0, feed.articles.all()|length-(feed.articles.all()|length % 3), 3) %} -
- {% for n in range(number, number+3) %} -
- {% if feed.articles[n].readed %}

{% else %}

{% endif %} - {{ feed.articles[n].title|safe }} - {% if feed.articles[n].readed %}

{% else %}{% endif %} -
{{ feed.articles[n].date }}
-
- {% endfor %} -
- {% endfor %} - {% if feed.articles.all()|length % 3 != 0 %} -
- {% for n in range(feed.articles.all()|length-(feed.articles.all()|length % 3), feed.articles.all()|length) %} -
- {% if feed.articles[n].readed %}

{% else %}

{% endif %} - {{ feed.articles[n].title|safe }} - {% if feed.articles[n].readed %}

{% else %}{% endif %} -
{{ feed.articles[n].date }}
-
- {% endfor %} -
- {% endif %} - {% endif %} -
-{% endblock %} diff --git a/pyaggr3g470r/templates/feed.html b/pyaggr3g470r/templates/feed.html index c888e04f..09a064e5 100644 --- a/pyaggr3g470r/templates/feed.html +++ b/pyaggr3g470r/templates/feed.html @@ -9,7 +9,7 @@

- {{ _('This feed contains') }} {{ feed.articles.all()|count }} {{ _('articles') }}.
+ {{ _('This feed contains') }} {{ feed.articles.all()|count }} {{ _('articles') }}.
{{ _('Address of the feed') }}: {{ feed.link }}
{% if feed.site_link != "" %} {{ _('Address of the site') }}: {{ feed.site_link }}
diff --git a/pyaggr3g470r/templates/home.html b/pyaggr3g470r/templates/home.html index 82f23dfa..e5db30e1 100644 --- a/pyaggr3g470r/templates/home.html +++ b/pyaggr3g470r/templates/home.html @@ -29,7 +29,6 @@

  • - @@ -47,7 +46,6 @@
  • - diff --git a/pyaggr3g470r/views/article.py b/pyaggr3g470r/views/article.py index 75360485..5843551e 100644 --- a/pyaggr3g470r/views/article.py +++ b/pyaggr3g470r/views/article.py @@ -11,22 +11,6 @@ articles_bp = Blueprint('articles', __name__, url_prefix='/articles') article_bp = Blueprint('article', __name__, url_prefix='/article') -@articles_bp.route('/', methods=['GET']) -@articles_bp.route('//', methods=['GET']) -@pyagg_default_decorator -def articles(feed_id=None, nb_articles=-1): - """List articles of a feed. The administrator of the platform is able to - access to this view for every users.""" - feed = controllers.FeedController(g.user.id).get(id=feed_id) - feed.articles = controllers.ArticleController(g.user.id)\ - .read(feed_id=feed.id)\ - .order_by(desc("Article.date")) - if len(feed.articles.all()) <= nb_articles or nb_articles == -1: - nb_articles = int(1e9) - feed.articles = feed.articles.limit(nb_articles) - return render_template('articles.html', feed=feed, nb_articles=nb_articles) - - @article_bp.route('/redirect/', methods=['GET']) @pyagg_default_decorator def redirect_to_article(article_id): -- cgit