8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

frontend kikoo

This commit is contained in:
Grizzly 2019-08-06 16:06:53 +00:00 committed by Gabriel Detraz
parent 209f118de2
commit 034dec924d
3 changed files with 42 additions and 6 deletions

View file

@ -31,7 +31,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block content %}
<h2> Ticket #{{ticket.id}} </h2>
<h2> Ticket #{{ticket.id}}
{% if ticket.solved %}
<span class="badge badge-success">{% trans "Solved" %}</span>
{% else %}
<span class="badge badge-danger">{% trans "Not Solved" %}</span>
{% endif %}
</h2>
<div class="panel panel-default">
<div class="panel-heading">
@ -59,13 +65,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% bootstrap_form changestatusform %}
{% if not ticket.solved %}
{% bootstrap_button "Résoudre" button_type="submit" button_class='btn-info' %}
{% bootstrap_button "Mark as Solved" button_type="submit" button_class='btn-info' %}
{% else %}
{% bootstrap_button "Ouvrir" button_type="submit" button_class='btn-warning' %}
{% bootstrap_button "Mark as not Solved" button_type="submit" button_class='btn-warning' %}
{% endif %}
</form>
</div>
</div>
</div>
<div class="text-right">
<a type="button" href="{% url 'tickets:aff-tickets' %}" class="btn btn-primary"><p>{% trans "Tous les tickets" %}</p></a>
</div>
{% endblock %}

View file

@ -28,8 +28,26 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}{% trans "Tickets" %}{% endblock %}
{% block content %}
<div class="container-fluid">
<hr class="col-sm-12">
<div class="row justify-content-start">
<div class="col-sm-4">
<span class="badge badge-light">{{ nbr_tickets }}</span> {% trans "Tickets" %}
</div>
<div class="col-sm-4">
<span class="badge badge-light">{{ nbr_tickets_unsolved }}</span>{% trans "Not Solved Tickets" %}
</div>
<div class="col-sm-4">
<span>{% trans "Last Ticket:" %} {{ last_ticket_date }}</span>
</div>
</div>
<hr class="col-sm-12">
</div>
<div class="table-responsiv">
<table class="table" id="machines_table">
<table class="table">
<thead>
<tr>
<th scope="col"></th>

View file

@ -57,8 +57,15 @@ def aff_ticket(request,ticketid):
def aff_tickets(request):
""" Vue d'affichage de tout les tickets """
tickets = Ticket.objects.all().order_by('-date')
return render(request,'tickets/index.html',
{'tickets_list':tickets})
last_ticket_date = tickets.first().date
nbr_tickets = tickets.count()
nbr_tickets_unsolved = Ticket.objects.filter(solved=False).count()
context = {'tickets_list':tickets,
'last_ticket_date':last_ticket_date,
'nbr_tickets':nbr_tickets,
'nbr_tickets_unsolved':nbr_tickets_unsolved}
return render(request,'tickets/index.html',context=context)
def edit_preferences(request):
""" Vue d'édition des préférences des tickets """