diff --git a/src/fellchensammlung/templates/fellchensammlung/errors/403.html b/src/fellchensammlung/templates/fellchensammlung/errors/403.html index beff350..84a5e5d 100644 --- a/src/fellchensammlung/templates/fellchensammlung/errors/403.html +++ b/src/fellchensammlung/templates/fellchensammlung/errors/403.html @@ -7,9 +7,14 @@ {% block content %}

403 Forbidden

- {% blocktranslate %} - Diese Aktion ist dir nicht erlaubt. Logge dich ein oder nutze einen anderen Account. Wenn du denkst, dass hier - ein Fehler vorliegt, kontaktiere das Team! - {% endblocktranslate %} + {% if error_message %} + {{ error_message }} + {% else %} + {% blocktranslate %} + Diese Aktion ist dir nicht erlaubt. Logge dich ein oder nutze einen anderen Account. Wenn du denkst, + dass hier + ein Fehler vorliegt, kontaktiere das Team! + {% endblocktranslate %} + {% endif %}

{% endblock %} \ No newline at end of file diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice-status.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice-status.html index 1cfaea3..1d62405 100644 --- a/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice-status.html +++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice-status.html @@ -31,5 +31,14 @@ {{ adoption_notice.status_description }} +{% elif adoption_notice.is_disabled %} +
+
+

{% translate 'Vermittlung wurde gesperrt' %}

+
+
+ {{ adoption_notice.status_description }} +
+
{% endif %} diff --git a/src/fellchensammlung/tools/model_helpers.py b/src/fellchensammlung/tools/model_helpers.py index 7fc4614..d5509fd 100644 --- a/src/fellchensammlung/tools/model_helpers.py +++ b/src/fellchensammlung/tools/model_helpers.py @@ -113,8 +113,8 @@ class AdoptionNoticeStatusChoicesDescriptions: _ansc.AwaitingAction.UNCHECKED: _( "Vermittlung deaktiviert bis sie vom Team auf Aktualität geprüft wurde."), - _ansc.Disabled.AGAINST_RULES: _("Vermittlung deaktiviert da sie gegen die Regeln verstößt."), - _ansc.Disabled.OTHER: _("Vermittlung deaktiviert.") + _ansc.Disabled.AGAINST_RULES: _("Die Vermittlung wurde gesperrt, da sie gegen die Regeln verstößt."), + _ansc.Disabled.OTHER: _("Vermittlung gesperrt.") } diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 0b64adb..2d639e4 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -114,6 +114,13 @@ def handle_an_check_actions(request, action, adoption_notice=None): def adoption_notice_detail(request, adoption_notice_id): adoption_notice = get_object_or_404(AdoptionNotice, id=adoption_notice_id) + if adoption_notice.is_disabled and not user_is_owner_or_trust_level(request.user, adoption_notice): + error_message = _("Die Vermittlung wurde versteckt und ist nur Admins zugänglich. Grund dafür kann z.b. ein " + "Regelverstoß sein.") + return render(request, + "fellchensammlung/errors/403.html", + context={"error_message": error_message}, + status=403) adoption_notice_meta = adoption_notice._meta if request.user.is_authenticated: try: