mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-23 14:31:09 -05:00
here we go
This commit is contained in:
88
templates/moderation/partials/submission_list.html
Normal file
88
templates/moderation/partials/submission_list.html
Normal file
@@ -0,0 +1,88 @@
|
||||
{% for submission in submissions %}
|
||||
<div class="submission-card">
|
||||
<div class="submission-header">
|
||||
<div>
|
||||
<h3 class="submission-title">
|
||||
{{ submission.get_content_type_display }} -
|
||||
{% if submission.submission_type == 'CREATE' %}New{% else %}Edit{% endif %}
|
||||
</h3>
|
||||
<div class="submission-meta">
|
||||
Submitted by {{ submission.user.username }} on {{ submission.created_at|date:"M d, Y H:i" }}
|
||||
</div>
|
||||
</div>
|
||||
{% if submission.status == 'APPROVED' %}
|
||||
<span class="px-2 py-1 text-sm text-white bg-green-500 rounded-full">Approved</span>
|
||||
{% elif submission.status == 'REJECTED' %}
|
||||
<span class="px-2 py-1 text-sm text-white bg-red-500 rounded-full">Rejected</span>
|
||||
{% elif submission.status == 'ESCALATED' %}
|
||||
<span class="px-2 py-1 text-sm text-white bg-yellow-500 rounded-full">Escalated</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if submission.reason %}
|
||||
<div class="p-3 mt-2 rounded bg-gray-50 dark:bg-gray-600">
|
||||
<div class="text-sm font-medium text-gray-700 dark:text-gray-300">Reason:</div>
|
||||
<div class="text-gray-600 dark:text-gray-400">{{ submission.reason }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if submission.source %}
|
||||
<div class="p-3 mt-2 rounded bg-gray-50 dark:bg-gray-600">
|
||||
<div class="text-sm font-medium text-gray-700 dark:text-gray-300">Source:</div>
|
||||
<div class="text-gray-600 dark:text-gray-400">
|
||||
<a href="{{ submission.source }}" target="_blank" class="text-blue-500 hover:underline">
|
||||
{{ submission.source }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="submission-changes">
|
||||
{% for field, value in submission.changes.items %}
|
||||
<div class="change-item">
|
||||
<div class="change-label">{{ field|title }}:</div>
|
||||
<div class="change-value">{{ value }}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if submission.status == 'NEW' %}
|
||||
<div class="action-buttons">
|
||||
<button class="btn-approve"
|
||||
hx-post="{% url 'moderation:approve_submission' submission.id %}"
|
||||
hx-target="#submissions-content">
|
||||
<i class="mr-2 fas fa-check"></i>Approve
|
||||
</button>
|
||||
<button class="btn-reject"
|
||||
hx-post="{% url 'moderation:reject_submission' submission.id %}"
|
||||
hx-target="#submissions-content">
|
||||
<i class="mr-2 fas fa-times"></i>Reject
|
||||
</button>
|
||||
{% if user.role == 'MODERATOR' %}
|
||||
<button class="btn-escalate"
|
||||
hx-post="{% url 'moderation:escalate_submission' submission.id %}"
|
||||
hx-target="#submissions-content">
|
||||
<i class="mr-2 fas fa-arrow-up"></i>Escalate
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% elif submission.status == 'ESCALATED' and user.role in 'ADMIN,SUPERUSER' %}
|
||||
<div class="action-buttons">
|
||||
<button class="btn-approve"
|
||||
hx-post="{% url 'moderation:approve_submission' submission.id %}"
|
||||
hx-target="#submissions-content">
|
||||
<i class="mr-2 fas fa-check"></i>Approve
|
||||
</button>
|
||||
<button class="btn-reject"
|
||||
hx-post="{% url 'moderation:reject_submission' submission.id %}"
|
||||
hx-target="#submissions-content">
|
||||
<i class="mr-2 fas fa-times"></i>Reject
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="p-8 text-center text-gray-500 dark:text-gray-400">
|
||||
No submissions found in this category.
|
||||
</div>
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user