mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
adjusting newest to new internally
This commit is contained in:
parent
7b5de79d3f
commit
7aced03976
2 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<div class="btn-group mt-1 mb-2" aria-label="{{ _('Sorting methods: ') }}">
|
||||
<a href="/read-posts/newest" class="btn {{ 'btn-primary' if sort == 'newest' else 'btn-outline-secondary' }}" rel="nofollow noindex" title="{{ _('Newest posts') }}">
|
||||
<a href="/read-posts/new" class="btn {{ 'btn-primary' if sort == 'new' else 'btn-outline-secondary' }}" rel="nofollow noindex" title="{{ _('Newest posts') }}">
|
||||
{{ _('Newest') }}
|
||||
</a>
|
||||
<a href="/read-posts/oldest" class="btn {{ 'btn-primary' if sort == 'oldest' else 'btn-outline-secondary' }}" rel="nofollow noindex" title="{{ _('Oldest posts') }}">
|
||||
|
|
|
@ -1290,7 +1290,7 @@ def user_read_posts(sort=None):
|
|||
posts = posts.order_by(desc(Post.sticky)).order_by(desc(Post.ranking)).order_by(desc(Post.posted_at))
|
||||
elif sort == 'top':
|
||||
posts = posts.filter(Post.posted_at > utcnow() - timedelta(days=7)).order_by(desc(Post.sticky)).order_by(desc(Post.up_votes - Post.down_votes))
|
||||
elif sort == 'newest':
|
||||
elif sort == 'new':
|
||||
posts = posts.order_by(desc(Post.posted_at))
|
||||
elif sort == 'oldest':
|
||||
posts = posts.order_by(asc(Post.posted_at))
|
||||
|
|
Loading…
Add table
Reference in a new issue