Skip to content
Snippets Groups Projects
Commit 692e8f71 authored by Benjamin Hättasch's avatar Benjamin Hättasch Committed by Nadja Geisler
Browse files

Mark resolved constraint violations in list and improve sorting

This implements #148
parent 32906a9a
No related branches found
No related tags found
No related merge requests found
......@@ -125,4 +125,4 @@ class ConstraintViolationsViewSet(EventSlugMixin, viewsets.ModelViewSet):
return get_object_or_404(ConstraintViolation, pk=self.kwargs["pk"])
def get_queryset(self):
return ConstraintViolation.objects.filter(event=self.event)
return ConstraintViolation.objects.filter(event=self.event).order_by('manually_resolved', '-type', '-timestamp')
......@@ -63,7 +63,11 @@
// Update violations table
for(let i=0;i<response.length;i++) {
table_html += "<tr><td>" + response[i].level_display + "</td><td>" + response[i].type_display + "</td><td>" + response[i].details + "</td><td class='nowrap'>" + response[i].timestamp_display + "</td><td><a href='" + response[i].edit_url + "'><i class='btn btn-primary fa fa-pen'></i></a></td></tr>";
if(response[i].manually_resolved)
table_html += '<tr class="text-muted"><td class="nowrap">{% fa5_icon "check" "fas" %}</td>';
else
table_html += '<tr><td></td>';
table_html += "<td>" + response[i].level_display + "</td><td>" + response[i].type_display + "</td><td>" + response[i].details + "</td><td class='nowrap'>" + response[i].timestamp_display + "</td><td><a href='" + response[i].edit_url + "'><i class='btn btn-primary fa fa-pen'></i></a></td></tr>";
}
}
else {
......@@ -115,6 +119,7 @@
<table class="table table-striped mt-4 mb-4">
<thead>
<tr>
<th></th>
<th>{% trans "Violation" %}</th>
<th>{% trans "Problem" %}</th>
<th>{% trans "Details" %}</th>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment