From 515d5bb237b428c08a4fbc4800a3c13aff8bb7ec Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 19 May 2021 14:55:01 -0700 Subject: [PATCH] Create announcements admin view --- bookwyrm/forms.py | 6 ++ bookwyrm/templates/settings/admin_layout.html | 4 + .../templates/settings/announcement_form.html | 80 +++++++++++++++++++ .../templates/settings/announcements.html | 49 ++++++++++++ bookwyrm/urls.py | 10 +++ bookwyrm/views/__init__.py | 1 + bookwyrm/views/announcements.py | 36 +++++++++ 7 files changed, 186 insertions(+) create mode 100644 bookwyrm/templates/settings/announcement_form.html create mode 100644 bookwyrm/templates/settings/announcements.html create mode 100644 bookwyrm/views/announcements.py diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index b6197f33a..25b72a119 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -269,6 +269,12 @@ class SiteForm(CustomForm): exclude = [] +class AnnouncementForm(CustomForm): + class Meta: + model = models.Announcement + exclude = ["remote_id"] + + class ListForm(CustomForm): class Meta: model = models.List diff --git a/bookwyrm/templates/settings/admin_layout.html b/bookwyrm/templates/settings/admin_layout.html index 4f71a2284..635e86072 100644 --- a/bookwyrm/templates/settings/admin_layout.html +++ b/bookwyrm/templates/settings/admin_layout.html @@ -43,6 +43,10 @@ {% if perms.bookwyrm.edit_instance_settings %}