aboutsummaryrefslogtreecommitdiff
path: root/web/views/article.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-12-12 21:14:28 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-12-17 09:42:56 +0100
commitb35e9773198ef2d8b37c4ca223f08147db47de0b (patch)
treeba4b1b171b3c1ab9414a96ad264c47b0f9d1246b /web/views/article.py
parentUpdated link to Heroku deploy button on the About page. (diff)
downloadnewspipe-b35e9773198ef2d8b37c4ca223f08147db47de0b.tar.gz
newspipe-b35e9773198ef2d8b37c4ca223f08147db47de0b.tar.bz2
newspipe-b35e9773198ef2d8b37c4ca223f08147db47de0b.zip
moving the root of source code from / to /src/
Diffstat (limited to 'web/views/article.py')
-rw-r--r--web/views/article.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/web/views/article.py b/web/views/article.py
deleted file mode 100644
index bb914a6b..00000000
--- a/web/views/article.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: utf-8 -
-
-from flask import Blueprint, g, render_template, redirect
-
-from web import controllers, utils
-from web.lib.view_utils import etag_match
-from web.decorators import pyagg_default_decorator
-
-articles_bp = Blueprint('articles', __name__, url_prefix='/articles')
-article_bp = Blueprint('article', __name__, url_prefix='/article')
-
-
-@article_bp.route('/redirect/<int:article_id>', methods=['GET'])
-@pyagg_default_decorator
-def redirect_to_article(article_id):
- article = controllers.ArticleController(g.user.id).get(id=article_id)
- return redirect(article.link)
-
-
-@article_bp.route('/<int:article_id>', methods=['GET'])
-@pyagg_default_decorator
-@etag_match
-def article(article_id=None):
- """
- Presents the content of an article.
- """
- article = controllers.ArticleController(g.user.id).get(id=article_id)
- previous_article = article.previous_article()
- if previous_article is None:
- previous_article = article.source.articles[0]
- next_article = article.next_article()
- if next_article is None:
- next_article = article.source.articles[-1]
-
- return render_template('article.html',
- head_titles=[utils.clear_string(article.title)],
- article=article,
- previous_article=previous_article,
- next_article=next_article)
bgstack15