\n"
-" 167"
-"a> "
-"powered by %(brand)s
\n"
-" 168"
-"a> "
-msgstr ""
+#~ msgid "General"
+#~ msgstr "Allgemein"
-#: htmlcov/d_665b89aa18c0023b_event_list_html.html:99
-#, python-format
-msgid ""
-"Add
\n"
-" 41"
-"span> %(title)s"
-msgstr ""
+#~ msgid "Administration"
+#~ msgstr "Administration"
-#, python-brace-format
#~ msgid "'{choice}' is not a valid signup action."
#~ msgstr "'{choice}' ist keinen gültige Anmeldeaktion."
@@ -2621,15 +2561,12 @@ msgstr ""
#~ msgid "Can decline after confirmation"
#~ msgstr "Kann nach Bestätigung absagen"
-#, python-brace-format
#~ msgid "{min} to {max}"
#~ msgstr "{min} bis {max}"
-#, python-brace-format
#~ msgid "at least {min}"
#~ msgstr "mindestens {min}"
-#, python-brace-format
#~ msgid "at most {max}"
#~ msgstr "höchstens {max}"
@@ -2663,11 +2600,9 @@ msgstr ""
#~ msgid "missing"
#~ msgstr "fehlen"
-#, python-brace-format
#~ msgid "You are rejected from {shift}."
#~ msgstr "Sie wurden für {shift} abgelehnt."
-#, python-brace-format
#~ msgid "You are bindingly signed up for {shift}."
#~ msgstr "Sie sind verbindlich für {shift} eingeteilt."
@@ -2727,7 +2662,6 @@ msgstr ""
#~ msgid "You are not allowed to change group associations."
#~ msgstr "Sie sind nicht berechtigt Gruppenmitgliedschaften zu bearbeiten."
-#, python-brace-format
#~ msgid ""
#~ "The participation of {participant} for {shift} was changed. The status is "
#~ "now {status}"
@@ -2741,7 +2675,6 @@ msgstr ""
#~ msgid "Advanced settings"
#~ msgstr "Erweiterte Einstellungen"
-#, python-format
#~ msgid "Add %(title)s"
#~ msgstr "%(title)s hinzufügen"
diff --git a/ephios/plugins/guests/views.py b/ephios/plugins/guests/views.py
index 6f0552e15..d4474e903 100644
--- a/ephios/plugins/guests/views.py
+++ b/ephios/plugins/guests/views.py
@@ -26,7 +26,7 @@ def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
def get_authenticated_url(self):
- return reverse("core:index")
+ return reverse("core:home")
class GuestRegistrationView(RedirectAuthenticatedUserMixin, CreateView):
diff --git a/ephios/plugins/pages/signals.py b/ephios/plugins/pages/signals.py
index 828b705a3..7018c099c 100644
--- a/ephios/plugins/pages/signals.py
+++ b/ephios/plugins/pages/signals.py
@@ -2,7 +2,7 @@
from django.urls import reverse
from django.utils.translation import gettext as _
-from ephios.core.signals import administration_settings_section, footer_link
+from ephios.core.signals import footer_link, management_settings_sections
from ephios.plugins.pages.models import Page
@@ -15,14 +15,18 @@ def pages_footer_links(sender, request, **kwargs):
@receiver(
- administration_settings_section,
+ management_settings_sections,
dispatch_uid="ephios.plugins.pages.signals.pages_settings_section",
)
def pages_settings_section(sender, request, **kwargs):
- return [
- {
- "label": _("Pages"),
- "url": reverse("pages:settings_page_list"),
- "active": request.resolver_match.url_name.startswith("settings_page"),
- },
- ]
+ return (
+ [
+ {
+ "label": _("Pages"),
+ "url": reverse("pages:settings_page_list"),
+ "active": request.resolver_match.url_name.startswith("settings_page"),
+ },
+ ]
+ if request.user.is_staff
+ else []
+ )
diff --git a/ephios/plugins/qualification_management/signals.py b/ephios/plugins/qualification_management/signals.py
index eeeda83bd..2ae46cbf1 100644
--- a/ephios/plugins/qualification_management/signals.py
+++ b/ephios/plugins/qualification_management/signals.py
@@ -2,18 +2,22 @@
from django.urls import reverse
from django.utils.translation import gettext as _
-from ephios.core.signals import administration_settings_section
+from ephios.core.signals import management_settings_sections
@receiver(
- administration_settings_section,
+ management_settings_sections,
dispatch_uid="ephios.plugins.qualification_management.signals.qualifications_settings_section",
)
def qualifications_settings_section(sender, request, **kwargs):
- return [
- {
- "label": _("Qualifications"),
- "url": reverse("qualification_management:settings_qualification_list"),
- "active": request.resolver_match.url_name.startswith("settings_qualification"),
- },
- ]
+ return (
+ [
+ {
+ "label": _("Qualifications"),
+ "url": reverse("qualification_management:settings_qualification_list"),
+ "active": request.resolver_match.url_name.startswith("settings_qualification"),
+ },
+ ]
+ if request.user.has_perm("core.change_qualification")
+ else []
+ )
diff --git a/ephios/plugins/qualification_management/views.py b/ephios/plugins/qualification_management/views.py
index 6beac6537..dba9b9902 100644
--- a/ephios/plugins/qualification_management/views.py
+++ b/ephios/plugins/qualification_management/views.py
@@ -9,7 +9,7 @@
from ephios.core.models import Qualification, QualificationCategory
from ephios.core.views.settings import SettingsViewMixin
-from ephios.extra.mixins import StaffRequiredMixin
+from ephios.extra.mixins import CustomPermissionRequiredMixin
from ephios.plugins.qualification_management.forms import (
QualificationCategoryFormset,
QualificationDeleteForm,
@@ -23,14 +23,16 @@
# Templates in this plugin are under core/, because Qualification is a core model.
-class QualificationListView(StaffRequiredMixin, SettingsViewMixin, ListView):
+class QualificationListView(CustomPermissionRequiredMixin, SettingsViewMixin, ListView):
model = Qualification
ordering = ("category__title", "title")
+ permission_required = "core.view_qualification"
-class QualificationImportView(StaffRequiredMixin, SettingsViewMixin, FormView):
+class QualificationImportView(CustomPermissionRequiredMixin, SettingsViewMixin, FormView):
template_name = "core/import.html"
form_class = QualificationImportForm
+ permission_required = "core.add_qualification"
def get_success_url(self):
return reverse("qualification_management:settings_qualification_list")
@@ -53,9 +55,10 @@ def form_valid(self, form):
return super().form_valid(form)
-class QualificationCreateView(StaffRequiredMixin, SettingsViewMixin, CreateView):
+class QualificationCreateView(CustomPermissionRequiredMixin, SettingsViewMixin, CreateView):
model = Qualification
form_class = QualificationForm
+ permission_required = "core.add_qualification"
def get_form_kwargs(self):
return {
@@ -68,28 +71,33 @@ def get_success_url(self):
return reverse("qualification_management:settings_qualification_list")
-class QualificationUpdateView(StaffRequiredMixin, SettingsViewMixin, UpdateView):
+class QualificationUpdateView(CustomPermissionRequiredMixin, SettingsViewMixin, UpdateView):
model = Qualification
form_class = QualificationForm
+ permission_required = "core.change_qualification"
def get_success_url(self):
messages.success(self.request, _("Qualification was saved."))
return reverse("qualification_management:settings_qualification_list")
-class QualificationDeleteView(StaffRequiredMixin, SettingsViewMixin, UpdateView):
+class QualificationDeleteView(CustomPermissionRequiredMixin, SettingsViewMixin, UpdateView):
model = Qualification
form_class = QualificationDeleteForm
template_name_suffix = "_confirm_delete"
+ permission_required = "core.delete_qualification"
def get_success_url(self):
messages.info(self.request, _("Qualification was deleted."))
return reverse("qualification_management:settings_qualification_list")
-class QualificationCategorySetUpdateView(StaffRequiredMixin, SettingsViewMixin, FormView):
+class QualificationCategorySetUpdateView(
+ CustomPermissionRequiredMixin, SettingsViewMixin, FormView
+):
form_class = QualificationCategoryFormset
template_name = "core/qualificationcategories_form.html"
+ permission_required = "core.change_qualification"
def get_form_kwargs(self):
return {"queryset": QualificationCategory.objects.all(), **super().get_form_kwargs()}
@@ -104,9 +112,10 @@ def get_success_url(self):
return reverse("qualification_management:settings_qualification_list")
-class QualificationReassignmentView(StaffRequiredMixin, SettingsViewMixin, FormView):
+class QualificationReassignmentView(CustomPermissionRequiredMixin, SettingsViewMixin, FormView):
form_class = QualificationReassignmentForm
template_name = "core/qualification_reassignment.html"
+ permission_required = "core.change_userprofile"
def form_valid(self, form):
with transaction.atomic():
@@ -125,7 +134,9 @@ def get_success_url(self):
return reverse("qualification_management:settings_qualification_list")
-class QualificationExportFixtureView(StaffRequiredMixin, View):
+class QualificationExportFixtureView(CustomPermissionRequiredMixin, View):
+ permission_required = "core.view_qualification"
+
def get(self, request, *args, **kwargs):
qualifications = Qualification.objects.all()
serializer = QualificationFixtureSerializer(qualifications, many=True)
diff --git a/ephios/templates/base.html b/ephios/templates/base.html
index 51110947b..78a092be0 100644
--- a/ephios/templates/base.html
+++ b/ephios/templates/base.html
@@ -83,7 +83,7 @@
{% with url_name=request.resolver_match.url_name %}
-
- {% trans "Home" %}
+ {% trans "Home" %}
-
diff --git a/ephios/templates/registration/password_change_done.html b/ephios/templates/registration/password_change_done.html
deleted file mode 100644
index acf069158..000000000
--- a/ephios/templates/registration/password_change_done.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block title %}
- {% trans "Password changed successfully" %}
-{% endblock %}
-
-{% block content %}
- {% trans "Password changed successfully" %}
- {% trans "Back to home page" %}
-{% endblock %}
\ No newline at end of file
diff --git a/tests/core/test_notifications.py b/tests/core/test_notifications.py
index d390de1ff..21a7a167f 100644
--- a/tests/core/test_notifications.py
+++ b/tests/core/test_notifications.py
@@ -32,7 +32,7 @@ def _enable_all_notifications(self, user):
user.preferences["notifications__notifications"] = preferences
def test_notification_form_render(self, django_app, volunteer):
- form = django_app.get(reverse("core:profile_notifications"), user=volunteer).form
+ form = django_app.get(reverse("core:settings_notifications"), user=volunteer).form
types = filter(
lambda notification_type: notification_type.unsubscribe_allowed,
enabled_notification_types(),
@@ -40,7 +40,7 @@ def test_notification_form_render(self, django_app, volunteer):
assert all(notification_type.slug in form.fields.keys() for notification_type in types)
def test_notification_form_submit(self, django_app, volunteer):
- form = django_app.get(reverse("core:profile_notifications"), user=volunteer).form
+ form = django_app.get(reverse("core:settings_notifications"), user=volunteer).form
form["ephios_new_event"] = ["ephios_backend_email"]
form.submit()
assert (
diff --git a/tests/core/test_plugins.py b/tests/core/test_plugins.py
index 269e50283..b344e90c5 100644
--- a/tests/core/test_plugins.py
+++ b/tests/core/test_plugins.py
@@ -29,15 +29,15 @@ def test_enabling_and_disabling(django_app, planner, page):
# This tests expects pages to be enabled by default
assert "ephios.plugins.pages" in original_plugins
- response = django_app.get(reverse("core:index"), user=planner)
+ response = django_app.get(reverse("core:home"), user=planner)
assert "Testimpressum" in response
preferences["general__enabled_plugins"] = []
- response = django_app.get(reverse("core:index"), user=planner)
+ response = django_app.get(reverse("core:home"), user=planner)
assert "Testimpressum" not in response
preferences["general__enabled_plugins"] = original_plugins
- response = django_app.get(reverse("core:index"), user=planner)
+ response = django_app.get(reverse("core:home"), user=planner)
assert "Testimpressum" in response
diff --git a/tests/core/test_views_settings.py b/tests/core/test_views_settings.py
index 982fb7bcc..60f22063b 100644
--- a/tests/core/test_views_settings.py
+++ b/tests/core/test_views_settings.py
@@ -2,5 +2,5 @@
def test_enabling_and_disabling(django_app, superuser):
- response = django_app.get(reverse("core:settings_general"), user=superuser)
+ response = django_app.get(reverse("core:settings_instance"), user=superuser)
assert response
diff --git a/tests/test_settings.py b/tests/test_settings.py
index 3363f48d4..4d265d1cc 100644
--- a/tests/test_settings.py
+++ b/tests/test_settings.py
@@ -5,5 +5,5 @@
class TestSettings:
@override_settings(COMPRESS_ENABLED=True)
def test_compression(self, django_app, volunteer):
- response = django_app.get(reverse("core:index"), user=volunteer)
+ response = django_app.get(reverse("core:home"), user=volunteer)
assert response.status_code == 200