feat: make status of disabled ANs more clear
This commit is contained in:
@@ -7,9 +7,14 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h1 class="title is-1">403 Forbidden</h1>
|
<h1 class="title is-1">403 Forbidden</h1>
|
||||||
<p>
|
<p>
|
||||||
|
{% if error_message %}
|
||||||
|
{{ error_message }}
|
||||||
|
{% else %}
|
||||||
{% blocktranslate %}
|
{% blocktranslate %}
|
||||||
Diese Aktion ist dir nicht erlaubt. Logge dich ein oder nutze einen anderen Account. Wenn du denkst, dass hier
|
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!
|
ein Fehler vorliegt, kontaktiere das Team!
|
||||||
{% endblocktranslate %}
|
{% endblocktranslate %}
|
||||||
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -31,5 +31,14 @@
|
|||||||
{{ adoption_notice.status_description }}
|
{{ adoption_notice.status_description }}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</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 %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -113,8 +113,8 @@ class AdoptionNoticeStatusChoicesDescriptions:
|
|||||||
_ansc.AwaitingAction.UNCHECKED: _(
|
_ansc.AwaitingAction.UNCHECKED: _(
|
||||||
"Vermittlung deaktiviert bis sie vom Team auf Aktualität geprüft wurde."),
|
"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.AGAINST_RULES: _("Die Vermittlung wurde gesperrt, da sie gegen die Regeln verstößt."),
|
||||||
_ansc.Disabled.OTHER: _("Vermittlung deaktiviert.")
|
_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):
|
def adoption_notice_detail(request, adoption_notice_id):
|
||||||
adoption_notice = get_object_or_404(AdoptionNotice, id=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
|
adoption_notice_meta = adoption_notice._meta
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user