8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-05-20 09:32:29 +00:00

Affichage des tickets sur le profil

This commit is contained in:
Grizzly 2019-07-10 09:16:37 +00:00 committed by Gabriel Detraz
parent c4259658eb
commit a0293a11b3
3 changed files with 29 additions and 5 deletions

View file

@ -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

View file

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

View file

@ -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,