From 4098a0de815013c521618b6419d91f997c986ef0 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Fri, 29 Jan 2016 14:26:02 +0100 Subject: draft displaying article --- src/web/views/views.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/web/views') diff --git a/src/web/views/views.py b/src/web/views/views.py index 84d1eacb..3e7bf80a 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -306,6 +306,17 @@ def get_middle_panel(): return _articles_to_json(articles, fd_hash) +@app.route('/getart/') +@login_required +def get_article(article_id): + article = ArticleController(g.user.id).get(id=article_id).dump() + article['category_id'] = article['category_id'] or 0 + feed = FeedController(g.user.id).get(id=article['feed_id']) + article['icon_url'] = url_for('icon.icon', url=feed.icon_url) \ + if feed.icon_url else None + return jsonify(**article) + + @app.route('/mark_all_as_read', methods=['PUT']) @login_required def mark_all_as_read(): -- cgit