UI: Add 'ID' detail to info display on submission page #48
@ -17,10 +17,17 @@ import extensions.views.mixins
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ReportList(ListView):
|
class ReportList(
|
||||||
|
LoginRequiredMixin,
|
||||||
|
UserPassesTestMixin,
|
||||||
|
ListView,
|
||||||
|
):
|
||||||
model = AbuseReport
|
model = AbuseReport
|
||||||
paginate_by = 100
|
paginate_by = 100
|
||||||
|
|
||||||
|
def test_func(self) -> bool:
|
||||||
|
return self.request.user.is_moderator
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return AbuseReport.objects.all().order_by('-date_created')
|
return AbuseReport.objects.all().order_by('-date_created')
|
||||||
|
|
||||||
@ -116,6 +123,6 @@ class ReportView(LoginRequiredMixin, DetailView):
|
|||||||
|
|
||||||
def get_object(self, *args, **kwargs):
|
def get_object(self, *args, **kwargs):
|
||||||
obj = super().get_object(*args, **kwargs)
|
obj = super().get_object(*args, **kwargs)
|
||||||
if obj.reporter.pk != self.request.user.pk and not self.request.user.is_staff:
|
if obj.reporter.pk != self.request.user.pk and not self.request.user.is_moderator:
|
||||||
raise Http404()
|
raise Http404()
|
||||||
return obj
|
return obj
|
||||||
|
@ -145,6 +145,8 @@
|
|||||||
<i class="i-coffee"></i> Admin
|
<i class="i-coffee"></i> Admin
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if user.is_moderator %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'abuse:report-list' %}" class="dropdown-item">
|
<a href="{% url 'abuse:report-list' %}" class="dropdown-item">
|
||||||
<i class="i-shield"></i> {% trans "Abuse Reports" %}
|
<i class="i-shield"></i> {% trans "Abuse Reports" %}
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
{% extends "common/base.html" %}
|
{% extends "common/base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="p-5">
|
<div class="row">
|
||||||
<h4 class="mb-4">
|
<div class="col-md-6 mx-auto text-center">
|
||||||
|
<div class="box">
|
||||||
|
<h3>
|
||||||
|
{{ status }}
|
||||||
{% if status == 400 %}
|
{% if status == 400 %}
|
||||||
Bad Request
|
Bad Request
|
||||||
{% elif status == 401 %}
|
{% elif status == 401 %}
|
||||||
@ -13,21 +16,25 @@
|
|||||||
Page Not Found
|
Page Not Found
|
||||||
{% elif status == 405 %}
|
{% elif status == 405 %}
|
||||||
Method Not Allowed
|
Method Not Allowed
|
||||||
{#% elif status >= 500 %#}
|
{% elif status >= 500 %}
|
||||||
|
Server Error
|
||||||
{% else %}
|
{% else %}
|
||||||
Houston, we have a problem
|
Houston, we have a problem.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h4>
|
</h3>
|
||||||
<div class="alert">
|
<p class="m-0">
|
||||||
{% if status == 400 %}
|
{% if status == 400 %}
|
||||||
{% elif status == 401 %}
|
{% elif status == 401 %}
|
||||||
|
You are not authorized to visit this page.
|
||||||
{% elif status == 403 %}
|
{% elif status == 403 %}
|
||||||
|
Access denied.
|
||||||
{% elif status == 404 %}
|
{% elif status == 404 %}
|
||||||
The page you requested does not exist
|
The page you requested does not exist.
|
||||||
{% elif status == 405 %}
|
{% elif status == 405 %}
|
||||||
{% elif status >= 500 %}
|
{% elif status >= 500 %}
|
||||||
{% else %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
{% load filters %}
|
||||||
|
<tr>
|
||||||
|
<td class="ext-review-list-type">{{ extension.get_type_display }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ extension.get_review_url }}">
|
||||||
|
{{ extension.name }}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if extension.authors.count %}
|
||||||
|
{% include "extensions/components/authors.html" %}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td title="{{ extension.date_created }}">{{ extension.date_created|naturaltime_compact }}</td>
|
||||||
|
<td class="d-flex">
|
||||||
|
<a href="{{ extension.get_review_url }}#activity">
|
||||||
|
<span>{{ extension.review_activity.all|length }}</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{% if extension.review_activity.all %}
|
||||||
|
<a href="{{ extension.get_review_url }}#activity-{{ extension.review_activity.all.last.id }}" class="ml-3">
|
||||||
|
<span>{{ extension.review_activity.all.last.date_created|naturaltime_compact }}</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ extension.get_review_url }}" class="text-decoration-none">
|
||||||
|
{% include "common/components/status.html" with object=extension class="d-block" %}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
@ -35,36 +35,11 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for extension in object_list %}
|
{% for extension in object_list %}
|
||||||
<tr>
|
{% if extension.get_status_display|lower != 'incomplete' %}
|
||||||
<td class="ext-review-list-type">{{ extension.get_type_display }}</td>
|
{% include 'reviewers/components/review_list_item.html' %}
|
||||||
<td>
|
{% elif user.is_moderator %}
|
||||||
<a href="{{ extension.get_review_url }}">
|
{% include 'reviewers/components/review_list_item.html' %}
|
||||||
{{ extension.name }}
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{% if extension.authors.count %}
|
|
||||||
{% include "extensions/components/authors.html" %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
|
||||||
<td title="{{ extension.date_created }}">{{ extension.date_created|naturaltime_compact }}</td>
|
|
||||||
<td class="d-flex">
|
|
||||||
<a href="{{ extension.get_review_url }}#activity">
|
|
||||||
<span>{{ extension.review_activity.all|length }}</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
{% if extension.review_activity.all %}
|
|
||||||
<a href="{{ extension.get_review_url }}#activity-{{ extension.review_activity.all.last.id }}" class="ml-3">
|
|
||||||
<span>{{ extension.review_activity.all.last.date_created|naturaltime_compact }}</span>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="{{ extension.get_review_url }}" class="text-decoration-none">
|
|
||||||
{% include "common/components/status.html" with object=extension class="d-block" %}
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user