diff --git a/bda/templates/bda-participants.html b/bda/templates/bda-participants.html
new file mode 100644
index 00000000..c21d4248
--- /dev/null
+++ b/bda/templates/bda-participants.html
@@ -0,0 +1,56 @@
+{% extends "base_title.html" %}
+
+{% block realcontent %}
+
{{ spectacle }}
+
+
+
+ Nom |
+ Identifiant |
+ Places |
+ Adresse Mail |
+ Payé |
+ Donné |
+
+
+ {% for participant in participants %}
+
+ {{participant.name}} |
+ {{participant.username}} |
+ {{participant.nb_places}} place{{participant.nb_places|pluralize}} |
+ {{participant.email}} |
+
+
+ {% if participant.paid %}Oui{% else %}Non{%endif%}
+
+ |
+
+
+ {% if participant.given %}Oui{% else %}Non{%endif%}
+
+ |
+
+
+ {% endfor %}
+
+
+
+
+{%for participant in participants %}{{participant.email}}, {%endfor%}
+
+
+
+
+{% for participant in participants %}{{participant.name}}{% if participant.nb_places == 2 %}
+{{participant.name}}{%endif%}
+{% endfor %}
+
+
+
+
+{% endblock %}
diff --git a/bda/templates/spectacle_list.html b/bda/templates/spectacle_list.html
index d707dde4..752a9315 100644
--- a/bda/templates/spectacle_list.html
+++ b/bda/templates/spectacle_list.html
@@ -1,11 +1,16 @@
{% extends "base_title.html" %}
{% block realcontent %}
- Spectacles
+ {{tirage_name}}
+ Liste des spectacles
+ Exports
+
{% endblock %}
diff --git a/bda/views.py b/bda/views.py
index 41c3c94d..fd0a0cdc 100644
--- a/bda/views.py
+++ b/bda/views.py
@@ -291,9 +291,27 @@ def revente(request, tirage_id):
@buro_required
def spectacle(request, tirage_id, spectacle_id):
tirage = get_object_or_404(Tirage, id=tirage_id)
- spectacle = get_object_or_404(Spectacle, id = spectacle_id, tirage=tirage)
- return render(request, "bda-emails.html", {"spectacle": spectacle})
+ spectacle = get_object_or_404(Spectacle, id=spectacle_id, tirage=tirage)
+ attributions = spectacle.attribues.all()
+ participants = {}
+ for attrib in attributions:
+ participant = attrib.participant
+ participant_info = {'lastname': participant.user.last_name,
+ 'name': participant.user.get_full_name,
+ 'username': participant.user.username,
+ 'email': participant.user.email,
+ 'given': attrib.given,
+ 'paid': participant.paid,
+ 'nb_places': 1}
+ if participant.id in participants:
+ participants[participant.id]['nb_places'] += 1
+ else:
+ participants[participant.id] = participant_info
+ participants_info = sorted(participants.values(),
+ key=lambda part: part['lastname'])
+ return render(request, "bda-participants.html",
+ {"spectacle": spectacle, "participants": participants_info})
class SpectacleListView(ListView):
model = Spectacle
@@ -305,6 +323,7 @@ class SpectacleListView(ListView):
def get_context_data(self, **kwargs):
context = super(SpectacleListView, self).get_context_data(**kwargs)
context['tirage_id'] = self.tirage.id
+ context['tirage_name'] = self.tirage.title
return context
@buro_required
diff --git a/gestioncof/templates/home.html b/gestioncof/templates/home.html
index f0aecebc..52c0ebfd 100644
--- a/gestioncof/templates/home.html
+++ b/gestioncof/templates/home.html
@@ -63,6 +63,12 @@
Sondage : {{ survey.title }}
{% endfor %}
+ Gestion tirages BDA
+ {% for tirage in open_tirages %}
+ {{ tirage.title }}
+ {% endfor %}
+
+
Liens utiles du COF
Liens utiles BdA
diff --git a/gestioncof/templates/utile_bda.html b/gestioncof/templates/utile_bda.html
index 5f4f383a..8948de97 100644
--- a/gestioncof/templates/utile_bda.html
+++ b/gestioncof/templates/utile_bda.html
@@ -10,14 +10,4 @@
BdA diffusion
BdA revente
- Tirages
- {% for tirage in tirages %}
- {{ tirage.title }}
-
- {% endfor %}
{% endblock %}
diff --git a/gestioncof/templatetags/utils.py b/gestioncof/templatetags/utils.py
index 9c439dd3..c8bd96ea 100644
--- a/gestioncof/templatetags/utils.py
+++ b/gestioncof/templatetags/utils.py
@@ -34,3 +34,5 @@ def highlight_clipper(clipper, q):
else:
text = clipper.username
return highlight_text(text, q)
+
+