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 title %}Overview{% endblock %}
{% block head %} {% block head %}
<script src="{% static 'minecraft_manager/js/chart.min.js' %}"></script> <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 %} {% endblock %}
{% block section %} {% block section %}
<div id="content"> <div id="content">
{% if request.user.is_staff %} {% if request.user.is_staff %}
<div class="panel panel-danger"> <div class="panel panel-danger">
<div class="panel-body"> <div class="panel-body">
<h4><span class="label label-danger">Admin Area</span></h4> <h4><span class="label label-danger">Admin Area</span></h4>
<h3>Resolved Tickets</h3> <h3>Resolved Tickets</h3>
<div class="row"> <label>Active Only
{% for staff in data.resolved %} <input id="active-only" type="checkbox" checked/>
<div class="col-xs-6 col-md-4"> </label>
<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="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> </div>
{% endfor %} </div>
</div>
</div>
</div> </div>
<hr/> <hr/>
{% endif %} {% endif %}