feat: add mod tool overview

This commit is contained in:
2025-06-19 23:06:30 +02:00
parent 8420c698d4
commit d9730e765e
5 changed files with 47 additions and 9 deletions

View File

@@ -1,5 +1,7 @@
{% load static %}
{% load i18n %}
{% load custom_tags %}
<footer class="footer">
<div class="columns">
<div class="column">
@@ -52,7 +54,7 @@
Technisches
</h4>
<div >
<div>
<a class="nav-link " href="{% url "rss" %}">
<i class="fa-solid fa-rss"></i> {% translate 'RSS' %}
</a>
@@ -78,17 +80,20 @@
</a>
</div>
</div>
<div class="column">
<div class="column">
<h4 class="title is-4 has-text-justify">
{% trans 'Hilfreiche Links' %}
</h4>
<div >
<a class="nav-link " href="{% url "rescue-organizations" %}">
{% translate 'Tierheime in der Nähe' %}
<a class="nav-link " href="{% url "rescue-organizations" %}">
{% translate 'Tierheime in der Nähe' %}
</a>
<br/>
{% trust_level "MODERATOR" as coordinator_trust_level %}
{% if request.user.trust_level >= coordinator_trust_level %}
<a class="nav-link " href="{% url "modtools" %}">
{% translate 'Moderationstools' %}
</a>
<br/>
</div>
{% endif %}
</div>
</div>
</footer>

View File

@@ -0,0 +1,20 @@
{% extends "fellchensammlung/base.html" %}
{% load i18n %}
{% block title %}<title>{% translate 'Moderationstools' %}</title>{% endblock %}
{% block content %}
<div class="block">
<h1 class="title is-1">{% translate 'Moderationstools' %}</h1>
<div class="block">
<a class="button is-primary is-fullwidth" href="{% url 'modqueue' %}">{% translate 'Moderationswarteschlange' %}</a>
</div>
<div class="block">
<a class="button is-primary is-fullwidth" href="{% url 'updatequeue' %}">{% translate 'Up-To-Date Check' %}</a>
</div>
<div class="block">
<a class="button is-primary is-fullwidth" href="{% url 'organization-check' %}">{% translate 'Organisations Check' %}</a>
</div>
</div>
{% endblock %}

View File

@@ -3,9 +3,11 @@ import markdown
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from notfellchen import settings
from urllib.parse import urlparse
from notfellchen import settings
from fellchensammlung.models import TrustLevel
register = template.Library()
@@ -96,3 +98,8 @@ def type_to_bulma_class(value):
return "is-danger"
else:
return value
@register.simple_tag
def trust_level(level_string):
return getattr(TrustLevel, level_string)

View File

@@ -67,6 +67,7 @@ urlpatterns = [
path("updatequeue/", views.updatequeue, name="updatequeue"),
path("organization-check/", views.rescue_organization_check, name="organization-check"),
path("modtools/", views.moderation_tools_overview, name="modtools"),
###########
## USERS ##

View File

@@ -715,3 +715,8 @@ def rescue_organization_check(request):
last_checked_rescue_orgs = RescueOrganization.objects.order_by("last_checked")
context = {"rescue_orgs": last_checked_rescue_orgs, }
return render(request, 'fellchensammlung/rescue-organization-check.html', context=context)
@user_passes_test(user_is_trust_level_or_above)
def moderation_tools_overview(request):
return render(request, 'fellchensammlung/mod-tool-overview.html')