diff --git a/AKScheduling/api.py b/AKScheduling/api.py index 2e065b467427c3c70a7175e43aacc9695d2dac34..7e60c86475615d655543a1ef0b752f81b6344a71 100644 --- a/AKScheduling/api.py +++ b/AKScheduling/api.py @@ -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') diff --git a/AKScheduling/templates/admin/AKScheduling/constraint_violations.html b/AKScheduling/templates/admin/AKScheduling/constraint_violations.html index c987f3119284f551f5f74d06eba1c10f6faffdf6..056eb4de54fb93d59c0c59c90a6db06607cae4f1 100644 --- a/AKScheduling/templates/admin/AKScheduling/constraint_violations.html +++ b/AKScheduling/templates/admin/AKScheduling/constraint_violations.html @@ -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>