From 1eb41e8ea86dc510f80f3d492dc4df070319e8bb Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 4 Mar 2020 21:58:25 +0100 Subject: Renmoved some useless blank spaces. --- newspipe/crawler/default_crawler.py | 2 +- newspipe/lib/data.py | 4 ++-- newspipe/lib/misc_utils.py | 4 ++-- newspipe/notifications/emails.py | 4 ++-- newspipe/notifications/notifications.py | 4 ++-- newspipe/runserver.py | 4 ++-- newspipe/web/forms.py | 4 ++-- newspipe/web/models/__init__.py | 4 ++-- newspipe/web/models/article.py | 4 ++-- newspipe/web/models/bookmark.py | 4 ++-- newspipe/web/models/feed.py | 4 ++-- newspipe/web/models/role.py | 4 ++-- newspipe/web/models/user.py | 4 ++-- newspipe/web/static/js/articles.js | 2 +- newspipe/web/views/bookmark.py | 4 ++-- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/newspipe/crawler/default_crawler.py b/newspipe/crawler/default_crawler.py index 96a8e30e..828066ff 100644 --- a/newspipe/crawler/default_crawler.py +++ b/newspipe/crawler/default_crawler.py @@ -4,7 +4,7 @@ # newspipe - A Web based news aggregator. # Copyright (C) 2010-2019 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/lib/data.py b/newspipe/lib/data.py index 94f98ac4..b8cc3c07 100644 --- a/newspipe/lib/data.py +++ b/newspipe/lib/data.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/lib/misc_utils.py b/newspipe/lib/misc_utils.py index e79bab49..ab57037f 100755 --- a/newspipe/lib/misc_utils.py +++ b/newspipe/lib/misc_utils.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/notifications/emails.py b/newspipe/notifications/emails.py index 6c32ecec..dcfcf771 100644 --- a/newspipe/notifications/emails.py +++ b/newspipe/notifications/emails.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/notifications/notifications.py b/newspipe/notifications/notifications.py index 2358cdc5..664c19a7 100644 --- a/newspipe/notifications/notifications.py +++ b/newspipe/notifications/notifications.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/runserver.py b/newspipe/runserver.py index 963ea681..8880d5b9 100755 --- a/newspipe/runserver.py +++ b/newspipe/runserver.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/web/forms.py b/newspipe/web/forms.py index 9f632c7d..e1921210 100644 --- a/newspipe/web/forms.py +++ b/newspipe/web/forms.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : http://gitlab.com/newspipe/newspipe +# For more information: http://gitlab.com/newspipe/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/newspipe/web/models/__init__.py b/newspipe/web/models/__init__.py index 23c9d831..a58a7ad5 100644 --- a/newspipe/web/models/__init__.py +++ b/newspipe/web/models/__init__.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/web/models/article.py b/newspipe/web/models/article.py index 7fdc4c35..4e623ba2 100644 --- a/newspipe/web/models/article.py +++ b/newspipe/web/models/article.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/web/models/bookmark.py b/newspipe/web/models/bookmark.py index 558049fc..11b2db53 100644 --- a/newspipe/web/models/bookmark.py +++ b/newspipe/web/models/bookmark.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/web/models/feed.py b/newspipe/web/models/feed.py index afebe934..70a5d521 100644 --- a/newspipe/web/models/feed.py +++ b/newspipe/web/models/feed.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/web/models/role.py b/newspipe/web/models/role.py index d456f4bc..4a0bd42d 100644 --- a/newspipe/web/models/role.py +++ b/newspipe/web/models/role.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/web/models/user.py b/newspipe/web/models/user.py index 288e7ea9..f96c8ccb 100644 --- a/newspipe/web/models/user.py +++ b/newspipe/web/models/user.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # newspipe - A Web based news aggregator. -# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/newspipe/web/static/js/articles.js b/newspipe/web/static/js/articles.js index 350723a4..f9f41f14 100644 --- a/newspipe/web/static/js/articles.js +++ b/newspipe/web/static/js/articles.js @@ -2,7 +2,7 @@ * pyAggr3g470r - A Web based news aggregator. * Copyright (C) 2010-2014 Cédric Bonhomme - http://cedricbonhomme.org/ * -* For more information : https://bitbucket.org/cedricbonhomme/pyaggr3g470r/ +* For more information: https://bitbucket.org/cedricbonhomme/pyaggr3g470r/ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/newspipe/web/views/bookmark.py b/newspipe/web/views/bookmark.py index 071cf260..6e67716f 100644 --- a/newspipe/web/views/bookmark.py +++ b/newspipe/web/views/bookmark.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # Newspipe - A Web based news aggregator. -# Copyright (C) 2010-2017 Cédric Bonhomme - https://www.cedricbonhomme.org +# Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # -# For more information : https://git.sr.ht/~cedric/newspipe +# For more information: https://git.sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as -- cgit From 3ae03c10a0975006343c3ecb4a37a6e6d72ef4ef Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 4 Mar 2020 22:14:46 +0100 Subject: Fixed some issues with the bookmark view. --- newspipe/web/templates/bookmarks.html | 5 +++-- newspipe/web/templates/layout.html | 2 +- newspipe/web/views/bookmark.py | 13 ++++--------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/newspipe/web/templates/bookmarks.html b/newspipe/web/templates/bookmarks.html index 88b31abb..0f6e02c4 100644 --- a/newspipe/web/templates/bookmarks.html +++ b/newspipe/web/templates/bookmarks.html @@ -18,10 +18,11 @@
{% if tag %} -   {{ tag }} +   {{ tag }} {% endif %} {% if query %} -   {{ query }} + {% if tag %}
{% endif %} +   {{ query }} {% endif %}
diff --git a/newspipe/web/templates/layout.html b/newspipe/web/templates/layout.html index c122bb46..b40b540c 100644 --- a/newspipe/web/templates/layout.html +++ b/newspipe/web/templates/layout.html @@ -79,7 +79,7 @@ diff --git a/newspipe/web/views/bookmark.py b/newspipe/web/views/bookmark.py index 6e67716f..db15be42 100644 --- a/newspipe/web/views/bookmark.py +++ b/newspipe/web/views/bookmark.py @@ -94,15 +94,10 @@ def list_(per_page, status="all"): # query for the shared bookmarks (of all users) head_titles = [gettext("Recent bookmarks")] filters["shared"] = True - last_bookmark = ( - BookmarkController(user_id) - .read(**filters) - .order_by(desc("time")) - .limit(1)[0] - ) - not_created_before = last_bookmark.time - datetime.timedelta(days=365) - filters["time__gt"] = not_created_before # only "recent" bookmarks - bookmarks = BookmarkController(user_id).read(**filters).order_by(desc("time")) + + bookmarks = ( + BookmarkController(user_id).read(**filters).order_by(desc("time")).limit(100) + ) # tag_contr = BookmarkTagController(user_id) # tag_contr.read().join(bookmarks).all() -- cgit From 0f713e5a5c7e61d32c67b55761df2a17e5204cfc Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 4 Mar 2020 22:18:14 +0100 Subject: Load only 1000 bookmarks when user is not authenticated. --- newspipe/web/views/bookmark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newspipe/web/views/bookmark.py b/newspipe/web/views/bookmark.py index db15be42..2577f747 100644 --- a/newspipe/web/views/bookmark.py +++ b/newspipe/web/views/bookmark.py @@ -96,7 +96,7 @@ def list_(per_page, status="all"): filters["shared"] = True bookmarks = ( - BookmarkController(user_id).read(**filters).order_by(desc("time")).limit(100) + BookmarkController(user_id).read(**filters).order_by(desc("time")).limit(1000) ) # tag_contr = BookmarkTagController(user_id) -- cgit