From 8d4584d66066fde84b3d76ed3a1574670fe7e10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Sun, 23 Apr 2023 00:38:27 +0200 Subject: [PATCH] feat: project RSS feed. --- CONTRIBUTORS | 1 + MANIFEST.in | 2 +- ihatemoney/models.py | 6 +- ihatemoney/templates/layout.html | 1 + ihatemoney/templates/list_bills.html | 3 + ihatemoney/templates/project_feed.xml | 22 ++ ihatemoney/tests/budget_test.py | 364 ++++++++++++++++++ .../tests/common/ihatemoney_testcase.py | 2 + ihatemoney/web.py | 52 ++- setup.cfg | 1 + tox.ini | 2 +- 11 files changed, 451 insertions(+), 5 deletions(-) create mode 100644 ihatemoney/templates/project_feed.xml diff --git a/CONTRIBUTORS b/CONTRIBUTORS index df9628b8..e76f9475 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -23,6 +23,7 @@ DavidRThrashJr donkers Edwin Smulders Elizabeth Sherrock +Éloi Rivard eMerzh Erwan Lacoudre Feth AREZKI diff --git a/MANIFEST.in b/MANIFEST.in index ff5fdcba..80b2334e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include *.rst -recursive-include ihatemoney *.rst *.py *.yaml *.po *.mo *.html *.css *.js *.eot *.svg *.woff *.txt *.png *.webp *.ini *.cfg *.j2 *.jpg *.gif *.ico +recursive-include ihatemoney *.rst *.py *.yaml *.po *.mo *.html *.css *.js *.eot *.svg *.woff *.txt *.png *.webp *.ini *.cfg *.j2 *.jpg *.gif *.ico *.xml include LICENSE CONTRIBUTORS CHANGELOG.rst diff --git a/ihatemoney/models.py b/ihatemoney/models.py index 80732529..c3d72dc8 100644 --- a/ihatemoney/models.py +++ b/ihatemoney/models.py @@ -453,7 +453,8 @@ class Project(db.Model): """Generate a timed and serialized JsonWebToken :param token_type: Either "auth" for authentication (invalidated when project code changed), - or "reset" for password reset (invalidated after expiration) + or "reset" for password reset (invalidated after expiration), + or "feed" for project feeds (invalidated when project code changed) """ if token_type == "reset": @@ -476,7 +477,8 @@ class Project(db.Model): :param token: Serialized TimedJsonWebToken :param token_type: Either "auth" for authentication (invalidated when project code changed), - or "reset" for password reset (invalidated after expiration) + or "reset" for password reset (invalidated after expiration), + or "feed" for project feeds (invalidated when project code changed) :param project_id: Project ID. Used for token_type "auth" to use the password as serializer secret key. :param max_age: Token expiration time (in seconds). Only used with token_type "reset" diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index c99960eb..9cfd2cef 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -103,6 +103,7 @@ {% if g.project %}
  • {{ _("History") }}
  • {{ _("Settings") }}
  • +
  • {{ _("RSS Feed") }}
  • {% endif %} {% if session['projects'] and not ((session['projects'] | length) == 1 and g.project and g.project.id in session['projects']) %} diff --git a/ihatemoney/templates/list_bills.html b/ihatemoney/templates/list_bills.html index 947e9778..78d0b952 100644 --- a/ihatemoney/templates/list_bills.html +++ b/ihatemoney/templates/list_bills.html @@ -44,6 +44,9 @@ {% endblock %} +{% block head %} + +{% endblock %} {% block sidebar %}