aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2020-06-06 14:06:37 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2020-06-06 14:06:37 +0200
commitc53112594e46bec8330c1f38be97e8edfb7b78e7 (patch)
tree9ba07b68fd69b96d407a85321d8643d8a2f4ef37
parentchg: [views] improved article view (diff)
downloadnewspipe-c53112594e46bec8330c1f38be97e8edfb7b78e7.tar.gz
newspipe-c53112594e46bec8330c1f38be97e8edfb7b78e7.tar.bz2
newspipe-c53112594e46bec8330c1f38be97e8edfb7b78e7.zip
chg: [views] sort categories by number of unread articles for each category
-rw-r--r--newspipe/templates/home.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/newspipe/templates/home.html b/newspipe/templates/home.html
index 82787c25..126f3638 100644
--- a/newspipe/templates/home.html
+++ b/newspipe/templates/home.html
@@ -27,7 +27,7 @@
<a href="{{ url_for('article.mark_as', new_value='read') }}"><i class="fa fa-check-square-o" aria-hidden="true" title="{{ _('Mark all as read') }}"></i></a>
</span></li>
</ul>
- {% for catid, nbunread in unread_by_cat.items() if catid %}
+ {% for catid, nbunread in unread_by_cat|dictsort(by='value')|reverse if catid %}
<ul class="nav flex-column">
<div class="bg-primary clearfix">{{ categories[catid].name }}</div>
{% for feed in categories[catid].feeds if feed.id in unread.keys() %}
@@ -75,6 +75,7 @@
{% endfor %}
</ul>
+ <hr />
<ul class="nav flex-column">
{% for fid, feed in feeds.items() if not fid in unread %}
<li class="nav-item feed-menu {% if in_error.get(fid, 0) > 0 %}d-none{% endif %}" data-feed="{{ fid }}"><a class="nav-link" href="{{ gen_url(feed=fid) }}">
bgstack15