aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-06-02 08:15:13 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-06-02 08:15:13 +0200
commitde0f251cb8ff525ab597fa6f450451cbfeb80649 (patch)
treefc2b34ea5924d156ca3b45b8d3ef69fbcf45e7a2 /pyaggr3g470r
parentThe search is now case unsensitive. (diff)
downloadnewspipe-de0f251cb8ff525ab597fa6f450451cbfeb80649.tar.gz
newspipe-de0f251cb8ff525ab597fa6f450451cbfeb80649.tar.bz2
newspipe-de0f251cb8ff525ab597fa6f450451cbfeb80649.zip
It is now possible to sort the list of articles on the second column (title of article).
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/templates/home.html2
-rw-r--r--pyaggr3g470r/views/views.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/pyaggr3g470r/templates/home.html b/pyaggr3g470r/templates/home.html
index 3d0e3849..dbb95451 100644
--- a/pyaggr3g470r/templates/home.html
+++ b/pyaggr3g470r/templates/home.html
@@ -72,7 +72,7 @@
<tr>
<th></th>
<th><a href="{{ gen_url(sort_='-feed' if sort_ == 'feed' else 'feed') }}">{{ _('Feed') }}</a></th>
- <th>{{ _('Article') }}</th>
+ <th><a href="{{ gen_url(sort_='-article' if sort_ == 'article' else 'article') }}">{{ _('Article') }}</a></th>
<th><a href="{{ gen_url(sort_='-date' if sort_ == 'date' else 'date') }}">{{ _('Date') }}</a></th>
</tr>
</thead>
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py
index 58b3e7f0..f064236a 100644
--- a/pyaggr3g470r/views/views.py
+++ b/pyaggr3g470r/views/views.py
@@ -264,8 +264,10 @@ def render_home(filters=None, head_titles=None,
sort_param = {"feed": Feed.title.desc(),
"date": Article.date.desc(),
+ "article": Article.title.desc(),
"-feed": Feed.title.asc(),
"-date": Article.date.asc(),
+ "-article": Article.title.asc()
}.get(sort_, Article.date.desc())
articles = arti_contr.read(**filters).join(Article.source). \
bgstack15