diff --git a/tickets/templates/tickets/aff_ticket.html b/tickets/templates/tickets/aff_ticket.html index f56a6b6c..7bf5b04d 100644 --- a/tickets/templates/tickets/aff_ticket.html +++ b/tickets/templates/tickets/aff_ticket.html @@ -31,7 +31,13 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %} -

Ticket #{{ticket.id}}

+

Ticket #{{ticket.id}} +{% if ticket.solved %} +{% trans "Solved" %} +{% else %} +{% trans "Not Solved" %} +{% endif %} +

@@ -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 %}
+ +
+

{% trans "Tous les tickets" %}

+
+ {% endblock %} diff --git a/tickets/templates/tickets/aff_tickets.html b/tickets/templates/tickets/aff_tickets.html index 5c10a4a4..1d447234 100644 --- a/tickets/templates/tickets/aff_tickets.html +++ b/tickets/templates/tickets/aff_tickets.html @@ -28,8 +28,26 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "Tickets" %}{% endblock %} {% block content %} + + +
+
+
+
+ {{ nbr_tickets }} {% trans "Tickets" %} +
+
+ {{ nbr_tickets_unsolved }}{% trans "Not Solved Tickets" %} +
+
+ {% trans "Last Ticket:" %} {{ last_ticket_date }} +
+
+
+
+
- +
diff --git a/tickets/views.py b/tickets/views.py index 0e89218d..7a86ecf4 100644 --- a/tickets/views.py +++ b/tickets/views.py @@ -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 """