From b913c86dcba406455f2dda0f680577f5c108014d Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 6 Jan 2024 18:02:23 +0000 Subject: [PATCH] lists: Add link to archive and controls to subscribe/unsubscribe Signed-off-by: Michael Tremer --- src/backend/lists.py | 4 ++++ src/templates/lists/index.html | 40 ++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/backend/lists.py b/src/backend/lists.py index 525a6b00..d2adff40 100644 --- a/src/backend/lists.py +++ b/src/backend/lists.py @@ -126,6 +126,10 @@ class List(misc.Object): def description(self): return self.data.get("description") + @property + def archive_url(self): + return "https://lists.ipfire.org/hyperkitty/list/%s/" % self.list_id + async def subscribe(self, account): pass # XXX TODO diff --git a/src/templates/lists/index.html b/src/templates/lists/index.html index 3d8adee2..61c6d397 100644 --- a/src/templates/lists/index.html +++ b/src/templates/lists/index.html @@ -29,24 +29,36 @@ {% for list in sorted(lists) %}
-
+

{{ list }} +

- {# Show if subscribed #} - {% if list in subscribed_lists %} - - {{ _("Subscribed") }} - - {% else %} - - {{ _("Not Subscribed") }} +
+ {{ list.description }} +
+ +
+ + + + + + {{ _("Archive") }} - {% end %} - + - {% if list.description %} -
{{ list.description }}
- {% end %} + {% if current_user %} + {% if list in subscribed_lists %} + + {{ _("Subscribed") }} + + {% else %} + + {{ _("Subscribe") }} + + {% end %} + {% end %} +
{% end %} -- 2.47.3