Browse Source

Affichage des tickets sur le profil

tickets
Grizzly 7 years ago
committed by Gabriel Detraz
parent
commit
a0293a11b3
  1. 1
      tickets/templates/tickets/aff_tickets.html
  2. 25
      users/templates/users/profil.html
  3. 8
      users/views.py

1
tickets/templates/tickets/aff_tickets.html

@ -1,4 +1,3 @@
{% extends 'users/sidebar.html' %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en

25
users/templates/users/profil.html

@ -120,10 +120,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'tickets:new-ticket' %}">
<i class="fa fa-ticket"></i>{% trans " Open a Ticket" %}
</a>
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse"
@ -532,6 +528,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#ticket">
<h3 class="panel-title pull-left">
<i class="fa fa-ticket"></i>{% trans " Tickets" %}
</h3>
</div>
<div id="ticket" class="panel-collapse collapse">
<div class="panel-body">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'tickets:new-ticket' %}">
<i class="fa fa-ticket"></i>{% trans " Open a Ticket" %}
</a>
</div>
<div class="panel-body">
{% if tickets_list %}
{% include 'tickets/aff_tickets.html' with tickets_list=tickets_list %}
{% else %}
<p>{% trans "No tickets" %}</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}

8
users/views.py

@ -53,6 +53,10 @@ from reversion import revisions as reversion
from cotisations.models import Facture, Paiement
from machines.models import Machine
# A IMPORTER SOUS CONDITION QUE TICKET SOIT INSTALLED
from tickets.models import Ticket
from preferences.models import OptionalUser, GeneralOption, AssoOption
from re2o.views import form
from re2o.utils import (
@ -974,6 +978,8 @@ def profil(request, users, **_kwargs):
request.GET.get('order'),
SortTable.MACHINES_INDEX
)
tickets = Ticket.objects.filter(user=users).all()
nb_tickets = tickets.count()
pagination_large_number = GeneralOption.get_cached_value(
'pagination_large_number'
)
@ -1016,6 +1022,8 @@ def profil(request, users, **_kwargs):
'users': users,
'machines_list': machines,
'nb_machines': nb_machines,
'tickets_list': tickets,
'nb_tickets': nb_tickets,
'facture_list': factures,
'ban_list': bans,
'white_list': whitelists,

Loading…
Cancel
Save