Skip to content
Snippets Groups Projects
Commit 3badebd7 authored by Nadja Geisler's avatar Nadja Geisler ☀️
Browse files

Merge branch 'feature-better-cv-list' into 'main'

Mark resolved constraint violations in list and improve sorting

Closes #148

See merge request !127
parents 32906a9a 692e8f71
No related branches found
No related tags found
1 merge request!127Mark resolved constraint violations in list and improve sorting
Pipeline #96181 passed with stage
in 46 seconds
......@@ -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.
Finish editing this message first!
Please register or to comment