aboutsummaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2017-06-01 23:25:36 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2017-06-01 23:25:36 +0200
commitc98c76bc7b50a03d90de3c3ae8bf6ea24857cba4 (patch)
treeda0437271144ed1a6ad0e5207e573f123efec965 /src/web
parentUpdated translations. (diff)
downloadnewspipe-c98c76bc7b50a03d90de3c3ae8bf6ea24857cba4.tar.gz
newspipe-c98c76bc7b50a03d90de3c3ae8bf6ea24857cba4.tar.bz2
newspipe-c98c76bc7b50a03d90de3c3ae8bf6ea24857cba4.zip
Display only recent bookmarks when disconnected.
Diffstat (limited to 'src/web')
-rw-r--r--src/web/templates/bookmarks.html2
-rw-r--r--src/web/views/bookmark.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/web/templates/bookmarks.html b/src/web/templates/bookmarks.html
index 66c6df52..a3ec4580 100644
--- a/src/web/templates/bookmarks.html
+++ b/src/web/templates/bookmarks.html
@@ -39,7 +39,7 @@
{{ pagination.links }}
</div>
</div>
- <br />
+
<div class="row">
<div class="col-md-8">
<ul class="list-group">
diff --git a/src/web/views/bookmark.py b/src/web/views/bookmark.py
index 477ca5fc..e7a4181e 100644
--- a/src/web/views/bookmark.py
+++ b/src/web/views/bookmark.py
@@ -27,6 +27,7 @@ __copyright__ = "Copyright (c) Cedric Bonhomme"
__license__ = "AGPLv3"
import logging
+import datetime
from werkzeug.exceptions import BadRequest
from flask import Blueprint, render_template, flash, \
@@ -64,7 +65,6 @@ def list_(per_page, status='all'):
query_regex = '%' + query + '%'
filters['__or__'] = {'title__ilike': query_regex,
'description__ilike': query_regex}
-
if current_user.is_authenticated:
# query for the bookmarks of the authenticated user
user_id = current_user.id
@@ -83,6 +83,10 @@ def list_(per_page, status='all'):
pass
else:
# query for the shared bookmarks (of all users)
+ head_titles = [gettext("Recent bookmarks")]
+ not_created_before = datetime.datetime.today() - \
+ datetime.timedelta(days=900)
+ filters['time__gt'] = not_created_before # only "recent" bookmarks
filters['shared'] = True
bookmarks = BookmarkController(user_id) \
bgstack15