aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2018-10-28 14:48:26 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2018-10-28 14:48:26 +0100
commite1eed1624349a87bd53449cf25d4c88f47b0479f (patch)
tree607b721b3d8391c4ba2bfa405397e58335bffc9c /src
parentProposition for the new stream page. (diff)
downloadnewspipe-e1eed1624349a87bd53449cf25d4c88f47b0479f.tar.gz
newspipe-e1eed1624349a87bd53449cf25d4c88f47b0479f.tar.bz2
newspipe-e1eed1624349a87bd53449cf25d4c88f47b0479f.zip
Added a listbox to select the categories.
Diffstat (limited to 'src')
-rw-r--r--src/web/templates/user_stream.html21
-rw-r--r--src/web/views/user.py3
2 files changed, 21 insertions, 3 deletions
diff --git a/src/web/templates/user_stream.html b/src/web/templates/user_stream.html
index 3c20b241..b05376a8 100644
--- a/src/web/templates/user_stream.html
+++ b/src/web/templates/user_stream.html
@@ -1,10 +1,29 @@
{% extends "layout.html" %}
{% block content %}
<div class="container">
+ <div class="row">
+ <div class="col-md-8">
+ <form class="form-inline">
+ <div class="form-group">
+ <label>Filter per category</label>
+ <select class="form-control" id="category-select" name="category_id">
+ <option value="0">All</option>
+ {% for cur_category in user.categories %}
+ <option value="{{cur_category.id}}" {% if cur_category.id==category.id %}selected{% endif %}>{{ cur_category.name }}</option>
+ {% endfor %}
+ </select>
+ <button type="submit" class="btn btn-primary mb-2">OK</button>
+ </div>
+ </form>
+ </div>
+ </div>
+
+ <br /><br />
+
{% if category %}
<div class="row">
<div class="col-md-8 offset-md-1">
- <p class="lead">Articles from the category <a href="{{ url_for('user.profile_public', nickname=nickname, category_id=category.id) }}">{{ category.name }}</a></p>
+ <p class="lead">Articles from the category <a href="{{ url_for('user.profile_public', nickname=user.nickname, category_id=category.id) }}">{{ category.name }}</a></p>
</div>
</div>
{% endif %}
diff --git a/src/web/views/user.py b/src/web/views/user.py
index a697eb5b..693f24b7 100644
--- a/src/web/views/user.py
+++ b/src/web/views/user.py
@@ -73,8 +73,7 @@ def user_stream(per_page, nickname=None):
return render_template('user_stream.html', user=user,
articles=articles.offset(offset).limit(per_page),
category=category,
- pagination=pagination,
- nickname=nickname)
+ pagination=pagination)
@user_bp.route('/management', methods=['GET', 'POST'])
bgstack15