From 84fcc358fa3c11be63967e9fa8729eae89b14e7e Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 8 Sep 2021 14:05:08 -0700 Subject: [PATCH 01/18] Renames layout file --- bookwyrm/templates/settings/announcement.html | 2 +- bookwyrm/templates/settings/announcements.html | 2 +- bookwyrm/templates/settings/edit_server.html | 2 +- bookwyrm/templates/settings/federated_server.html | 2 +- bookwyrm/templates/settings/federation.html | 2 +- bookwyrm/templates/settings/{admin_layout.html => layout.html} | 0 bookwyrm/templates/settings/manage_invite_requests.html | 2 +- bookwyrm/templates/settings/manage_invites.html | 2 +- bookwyrm/templates/settings/server_blocklist.html | 2 +- bookwyrm/templates/settings/site.html | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) rename bookwyrm/templates/settings/{admin_layout.html => layout.html} (100%) diff --git a/bookwyrm/templates/settings/announcement.html b/bookwyrm/templates/settings/announcement.html index c0e5dec88..b3375bb50 100644 --- a/bookwyrm/templates/settings/announcement.html +++ b/bookwyrm/templates/settings/announcement.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %}{% load humanize %} {% block title %}{% trans "Announcement" %} - {{ announcement.preview }}{% endblock %} diff --git a/bookwyrm/templates/settings/announcements.html b/bookwyrm/templates/settings/announcements.html index 18e765317..aba412473 100644 --- a/bookwyrm/templates/settings/announcements.html +++ b/bookwyrm/templates/settings/announcements.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %}{% load humanize %} {% block title %}{% trans "Announcements" %}{% endblock %} diff --git a/bookwyrm/templates/settings/edit_server.html b/bookwyrm/templates/settings/edit_server.html index 55346a526..452316e43 100644 --- a/bookwyrm/templates/settings/edit_server.html +++ b/bookwyrm/templates/settings/edit_server.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% block title %}{% trans "Add instance" %}{% endblock %} diff --git a/bookwyrm/templates/settings/federated_server.html b/bookwyrm/templates/settings/federated_server.html index c47dd285c..140a0af75 100644 --- a/bookwyrm/templates/settings/federated_server.html +++ b/bookwyrm/templates/settings/federated_server.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% load markdown %} diff --git a/bookwyrm/templates/settings/federation.html b/bookwyrm/templates/settings/federation.html index e0a9ba73a..ed122e0b2 100644 --- a/bookwyrm/templates/settings/federation.html +++ b/bookwyrm/templates/settings/federation.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% block title %}{% trans "Federated Instances" %}{% endblock %} diff --git a/bookwyrm/templates/settings/admin_layout.html b/bookwyrm/templates/settings/layout.html similarity index 100% rename from bookwyrm/templates/settings/admin_layout.html rename to bookwyrm/templates/settings/layout.html diff --git a/bookwyrm/templates/settings/manage_invite_requests.html b/bookwyrm/templates/settings/manage_invite_requests.html index 5b7315f98..e0cfd6469 100644 --- a/bookwyrm/templates/settings/manage_invite_requests.html +++ b/bookwyrm/templates/settings/manage_invite_requests.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% load humanize %} {% block header %}{% trans "Invite Requests" %}{% endblock %} diff --git a/bookwyrm/templates/settings/manage_invites.html b/bookwyrm/templates/settings/manage_invites.html index 6efaefcf2..95b8bdf00 100644 --- a/bookwyrm/templates/settings/manage_invites.html +++ b/bookwyrm/templates/settings/manage_invites.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% block header %}{% trans "Invites" %}{% endblock %} {% load humanize %} diff --git a/bookwyrm/templates/settings/server_blocklist.html b/bookwyrm/templates/settings/server_blocklist.html index 49334982f..926ab5f4a 100644 --- a/bookwyrm/templates/settings/server_blocklist.html +++ b/bookwyrm/templates/settings/server_blocklist.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% block title %}{% trans "Add instance" %}{% endblock %} diff --git a/bookwyrm/templates/settings/site.html b/bookwyrm/templates/settings/site.html index 05b504a97..354e49e81 100644 --- a/bookwyrm/templates/settings/site.html +++ b/bookwyrm/templates/settings/site.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% block title %}{% trans "Site Settings" %}{% endblock %} From fd0cf49b408cea033ebe86c78d97cf63bbadd668 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 8 Sep 2021 14:32:11 -0700 Subject: [PATCH 02/18] Adds html and view for email blocklist --- bookwyrm/templates/moderation/report.html | 2 +- bookwyrm/templates/moderation/reports.html | 2 +- .../templates/settings/email_blocklist.html | 40 +++++++++++++++++++ bookwyrm/templates/settings/layout.html | 19 ++++++--- bookwyrm/templates/user_admin/user.html | 2 +- bookwyrm/templates/user_admin/user_admin.html | 2 +- bookwyrm/urls.py | 1 + bookwyrm/views/__init__.py | 1 + bookwyrm/views/email_blocklist.py | 19 +++++++++ 9 files changed, 78 insertions(+), 10 deletions(-) create mode 100644 bookwyrm/templates/settings/email_blocklist.html create mode 100644 bookwyrm/views/email_blocklist.py diff --git a/bookwyrm/templates/moderation/report.html b/bookwyrm/templates/moderation/report.html index db03850f8..d0e4026a7 100644 --- a/bookwyrm/templates/moderation/report.html +++ b/bookwyrm/templates/moderation/report.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% load humanize %} diff --git a/bookwyrm/templates/moderation/reports.html b/bookwyrm/templates/moderation/reports.html index 95a276af4..c83f626fa 100644 --- a/bookwyrm/templates/moderation/reports.html +++ b/bookwyrm/templates/moderation/reports.html @@ -1,4 +1,4 @@ -{% extends 'settings/admin_layout.html' %} +{% extends 'settings/layout.html' %} {% load i18n %} {% block title %} diff --git a/bookwyrm/templates/settings/email_blocklist.html b/bookwyrm/templates/settings/email_blocklist.html new file mode 100644 index 000000000..62561f747 --- /dev/null +++ b/bookwyrm/templates/settings/email_blocklist.html @@ -0,0 +1,40 @@ +{% extends 'settings/layout.html' %} +{% load i18n %} +{% block title %}{% trans "Email Blocklist" %}{% endblock %} + +{% block header %}{% trans "Email Blocklist" %}{% endblock %} + +{% block edit-button %} + + + {% trans "Add domain" %} + +{% endblock %} + +{% block panel %} + + + {% url 'settings-federation' as url %} + + + + + + + +
+ {% trans "Domain" as text %} + {% include 'snippets/table-sort-header.html' with field="server_name" sort=sort text=text %} + + {% trans "Options" %} +
gmail.com + {% trans "Delete" as button_text %} + +
+ +{% include 'snippets/pagination.html' with page=servers path=request.path %} +{% endblock %} + diff --git a/bookwyrm/templates/settings/layout.html b/bookwyrm/templates/settings/layout.html index 6d6516476..119f52bfa 100644 --- a/bookwyrm/templates/settings/layout.html +++ b/bookwyrm/templates/settings/layout.html @@ -32,12 +32,6 @@ {% url 'settings-invites' as alt_url %} {% trans "Invites" %} - {% if perms.bookwyrm.moderate_user %} -
  • - {% url 'settings-reports' as url %} - {% trans "Reports" %} -
  • - {% endif %} {% if perms.bookwyrm.control_federation %}
  • {% url 'settings-federation' as url %} @@ -46,6 +40,19 @@ {% endif %} {% endif %} + {% if perms.bookwyrm.moderate_user %} + + + {% endif %} {% if perms.bookwyrm.edit_instance_settings %}