diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2018-10-27 00:34:08 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2018-10-27 00:34:08 +0200 |
commit | 488327324ab2f65fa8e0bc49a1d13efb505bba21 (patch) | |
tree | a56fbd64da4607ef4f94e354ea7605fdc6e0de2e /src/web/templates | |
parent | Merge branch 'master' of github.com:newspipe/newspipe (diff) | |
download | newspipe-488327324ab2f65fa8e0bc49a1d13efb505bba21.tar.gz newspipe-488327324ab2f65fa8e0bc49a1d13efb505bba21.tar.bz2 newspipe-488327324ab2f65fa8e0bc49a1d13efb505bba21.zip |
Filter feeds per category on the user profile page.
Diffstat (limited to 'src/web/templates')
-rw-r--r-- | src/web/templates/feed_list_per_categories.html | 54 | ||||
-rw-r--r-- | src/web/templates/profile_public.html | 2 |
2 files changed, 55 insertions, 1 deletions
diff --git a/src/web/templates/feed_list_per_categories.html b/src/web/templates/feed_list_per_categories.html new file mode 100644 index 00000000..4b0e517e --- /dev/null +++ b/src/web/templates/feed_list_per_categories.html @@ -0,0 +1,54 @@ +<div class="row"> + <div class="col-md-6"> + <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 category in user.categories %} + <option value="{{category.id}}" {% if category.id==selected_category_id %}selected{% endif %}>{{ category.name }}</option> + {% endfor %} + </select> + <button type="submit" class="btn btn-primary mb-2">OK</button> + </div> + </form> + </div> +</div> + +<br /> + +{% if feeds | length != 0 %} +<div class="table-responsive"> + <table id="table-feeds" class="table table-striped"> + <thead> + <tr> + <th>#</th> + <th>{{ _('Title') }}</th> + <th>{{ _('Site') }}</th> + </tr> + </thead> + <tbody> + {% for feed in feeds %} + <tr> + <td>{{ loop.index }}</td> + <td>{% if feed.icon_url %}<img src="{{ url_for('icon.icon', url=feed.icon_url) }}" width="16px" /> {% endif %} <a href="{{ url_for('feed.feed_pub', feed_id=feed.id) }}">{{ feed.title }}</a></td> + <td><a href="{{ feed.site_link }}">{{ feed.site_link }}</a></td> + </tr> + {% endfor %} + </tbody> + </table> +</div> +<script> +$(document).ready(function() { + $('#table-feeds').DataTable( { + responsive: true, + columnDefs: [ + { + bSortable: false, + targets: [0] + } + ] + }); +}); +</script> +{% endif %} diff --git a/src/web/templates/profile_public.html b/src/web/templates/profile_public.html index 9198acea..e30ae300 100644 --- a/src/web/templates/profile_public.html +++ b/src/web/templates/profile_public.html @@ -38,7 +38,7 @@ <h2>{{ _('Feeds') }}</h2> <div class="row"> <div class="col-md-12"> - {% include "feed_list_simple.html" %} + {% include "feed_list_per_categories.html" %} </div> </div> </div><!-- /.container --> |