Allow filtering of active users for resolved tickets (#40)

reminder^2
Etzelia 2019-09-30 21:44:29 +02:00 committed by Gitea
parent 3af8642ff0
commit aa221fb398
1 changed files with 25 additions and 10 deletions

View File

@ -3,22 +3,37 @@
{% block title %}Overview{% endblock %}
{% block head %}
<script src="{% static 'minecraft_manager/js/chart.min.js' %}"></script>
<script>
$(document).ready(function() {
$(".staff-inactive").hide();
$("#active-only").change(function() {
if ($(this)[0].checked) {
$(".staff-inactive").hide();
} else {
$(".staff-inactive").show();
}
});
});
</script>
{% endblock %}
{% block section %}
<div id="content">
{% if request.user.is_staff %}
<div class="panel panel-danger">
<div class="panel-body">
<h4><span class="label label-danger">Admin Area</span></h4>
<h3>Resolved Tickets</h3>
<div class="row">
{% for staff in data.resolved %}
<div class="col-xs-6 col-md-4">
<p><span class="label label-{% if staff.active %}success{% else %}danger{% endif %}">{% if staff.active %}Active{% else %}Inactive{% endif %}</span> {{ staff.username }}: {{ staff.tickets }}</p>
<div class="panel-body">
<h4><span class="label label-danger">Admin Area</span></h4>
<h3>Resolved Tickets</h3>
<label>Active Only
<input id="active-only" type="checkbox" checked/>
</label>
<div class="row">
{% for staff in data.resolved %}
<div class="col-xs-6 col-md-4{% if not staff.active %} staff-inactive{% endif %}">
<p><span class="label label-{% if staff.active %}success{% else %}danger{% endif %}">{% if staff.active %}Active{% else %}Inactive{% endif %}</span> {{ staff.username }}: {{ staff.tickets }}</p>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
<hr/>
{% endif %}