feat: make status of disabled ANs more clear
This commit is contained in:
@@ -7,9 +7,14 @@
|
||||
{% block content %}
|
||||
<h1 class="title is-1">403 Forbidden</h1>
|
||||
<p>
|
||||
{% 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 %}
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -31,5 +31,14 @@
|
||||
{{ adoption_notice.status_description }}
|
||||
</div>
|
||||
</article>
|
||||
{% elif adoption_notice.is_disabled %}
|
||||
<article class="message is-warning">
|
||||
<div class="message-header">
|
||||
<p>{% translate 'Vermittlung wurde gesperrt' %}</p>
|
||||
</div>
|
||||
<div class="message-body content">
|
||||
{{ adoption_notice.status_description }}
|
||||
</div>
|
||||
</article>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -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.")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user