From de227efcb01bee5a3e36976f854df22b833411bd Mon Sep 17 00:00:00 2001 From: ludo Date: Thu, 9 Jun 2016 13:07:02 +0200 Subject: [PATCH 01/52] Ajoute l'admin des tirages BDA sur la page d'accueil --- gestioncof/templates/home.html | 6 ++++++ 1 file changed, 6 insertions(+) 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
  • From 6cd89da67c5ec29090728f48d476da99dd8283f0 Mon Sep 17 00:00:00 2001 From: ludo Date: Thu, 9 Jun 2016 13:10:59 +0200 Subject: [PATCH 02/52] =?UTF-8?q?Donne=20plus=20d'infos=20=C3=A0=20la=20vu?= =?UTF-8?q?e=20spectacles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/views.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bda/views.py b/bda/views.py index f4495f55..2161b682 100644 --- a/bda/views.py +++ b/bda/views.py @@ -306,7 +306,17 @@ def revente(request, tirage_id): 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}) + attributions = spectacle.attribues.all() + participants = [] + for attrib in attributions: + participant = attrib.participant + if (participant in participants): + participant.nb_places = 2 + else: + participant.nb_places = 1 + participants.append(participant) + + return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": participants}) class SpectacleListView(ListView): From 96195f1e813dfab0d002dd3cf33dcac2c95a389b Mon Sep 17 00:00:00 2001 From: ludo Date: Thu, 9 Jun 2016 14:31:40 +0200 Subject: [PATCH 03/52] ajoute un tag True/False -> Oui/Non --- gestioncof/templatetags/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gestioncof/templatetags/utils.py b/gestioncof/templatetags/utils.py index 9c439dd3..5f90722e 100644 --- a/gestioncof/templatetags/utils.py +++ b/gestioncof/templatetags/utils.py @@ -34,3 +34,10 @@ def highlight_clipper(clipper, q): else: text = clipper.username return highlight_text(text, q) + +@register.filter +def oui_ou_non(b): + if b: + return "Oui" + else: + return "Non" From e93e60ec84665b4f763163234bc7465be2b4e5a2 Mon Sep 17 00:00:00 2001 From: ludo Date: Fri, 10 Jun 2016 18:04:02 +0200 Subject: [PATCH 04/52] =?UTF-8?q?fix=20=C3=A9limination=20des=20doublons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/views.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bda/views.py b/bda/views.py index 2161b682..2e405ec1 100644 --- a/bda/views.py +++ b/bda/views.py @@ -307,16 +307,17 @@ 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) attributions = spectacle.attribues.all() - participants = [] + participants = {} for attrib in attributions: participant = attrib.participant - if (participant in participants): - participant.nb_places = 2 + participant.given = attrib.given + if (participant.id in participants): + participants[participant.id].nb_places = 2 else: participant.nb_places = 1 - participants.append(participant) + participants[participant.id]=participant - return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": participants}) + return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": participants.values()}) class SpectacleListView(ListView): @@ -329,6 +330,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 From e15aed65c9b4a5f272d203c4de72f7965a58418e Mon Sep 17 00:00:00 2001 From: ludo Date: Fri, 10 Jun 2016 18:10:25 +0200 Subject: [PATCH 05/52] =?UTF-8?q?D=C3=A9place=20l'interface=20des=20tirage?= =?UTF-8?q?s=20vers=20une=20vue=20sp=C3=A9ciale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/templates/spectacle_list.html | 11 +++++++++-- gestioncof/templates/utile_bda.html | 10 ---------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/bda/templates/spectacle_list.html b/bda/templates/spectacle_list.html index d707dde4..e1863eef 100644 --- a/bda/templates/spectacle_list.html +++ b/bda/templates/spectacle_list.html @@ -1,11 +1,18 @@ {% extends "base_title.html" %} {% block realcontent %} -

    Spectacles

    +

    {{tirage_name}}

    +
    +

    Liste des spectacles

    +
    +

    Exports

    + {% endblock %} 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 %} From 185c7b5ca4e51b048898d24bf4f22807750315f8 Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 12 Jun 2016 17:57:31 +0200 Subject: [PATCH 06/52] =?UTF-8?q?Vue=20listant=20les=20participants=20?= =?UTF-8?q?=C3=A0=20un=20spectacle,=20avec=20quelques=20exports=20:=20list?= =?UTF-8?q?e=20des=20mails,=20et=20export=20des=20noms=20pour=20les=20sall?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/templates/bda-participants.html | 72 +++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 bda/templates/bda-participants.html diff --git a/bda/templates/bda-participants.html b/bda/templates/bda-participants.html new file mode 100644 index 00000000..64f260b8 --- /dev/null +++ b/bda/templates/bda-participants.html @@ -0,0 +1,72 @@ +{% extends "base_title.html" %} +{% load utils %} + +{% block realcontent %} +

    {{ spectacle }}

    + + + + + + + + + + + + {% for participant in participants %} + + + + + + + + + + {% endfor %} + + {% csrf_token %} + + + + + + + + + +
    NomClipperPlacesAdresse MailPayéDonné
    {{participant.user.get_full_name}}{{participant.user.username}}{{participant.nb_places}} place{{participant.nb_places|pluralize:",s"}}{{participant.user.email}} +
    + {{participant.paid|oui_ou_non}} +
    +
    +
    + {{participant.given|oui_ou_non}} +
    +
    +
    + + + +
    + + + + + +{% endblock %} From 7686d33dff38348eea98e4b70233d59b9a068f94 Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 12 Jun 2016 18:00:26 +0200 Subject: [PATCH 07/52] =?UTF-8?q?D=C3=A9but=20de=20l'ajout=20de=20particip?= =?UTF-8?q?ants=20=C3=A0=20un=20spectacle=20;=20cr=C3=A9ation=20d'url=20et?= =?UTF-8?q?=20gestion=20de=20formulaire=20(WIP)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/urls.py | 3 +++ bda/views.py | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bda/urls.py b/bda/urls.py index d3f4fe2f..8cd94d17 100644 --- a/bda/urls.py +++ b/bda/urls.py @@ -32,4 +32,7 @@ urlpatterns = patterns('', url(r'spectacles/unpaid/(?P\d+)$', "bda.views.unpaid", name="bda-unpaid"), + url(r'spectacles/add-attrib/(?P\d+)/(?P\d+)$', + 'bda.views.add_attrib', + name='bda-add-attrib'), ) diff --git a/bda/views.py b/bda/views.py index c79a5483..9c052c84 100644 --- a/bda/views.py +++ b/bda/views.py @@ -12,6 +12,8 @@ import hashlib from django.core.mail import send_mail from django.utils import timezone from django.views.generic.list import ListView +from django.http import HttpResponseRedirect +from django.core.urlresolvers import reverse from datetime import timedelta import time @@ -305,7 +307,18 @@ def spectacle(request, tirage_id, spectacle_id): return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": participants.values()}) - +@buro_required +def add_attrib(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) + # TODO : erreur + part= tirage.participant_set.get(user__username=request.POST['clipper']) + attrib = Attribution(participant=part, spectacle=spectacle, given=request.POST['given']) + attrib.save() + if request.POST['nb_places']==2: + attrib.save() + return HttpResponseRedirect(reverse('bda-spectacle', args=(tirage_id, spectacle_id,))) + class SpectacleListView(ListView): model = Spectacle template_name = 'spectacle_list.html' From 0def28e06d7c21f1fd6c2bf4e12a549416a5bc3b Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 12 Jun 2016 18:36:21 +0200 Subject: [PATCH 08/52] =?UTF-8?q?Change=20la=20vue=20bda.views.spectacle?= =?UTF-8?q?=20:=20donne=20plus=20d'informations=20=C3=A0=20la=20page=20bda?= =?UTF-8?q?-participants.html,=20et=20g=C3=A9n=C3=A8re=20une=20liste=20de?= =?UTF-8?q?=20participants=20sans=20doublons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/views.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bda/views.py b/bda/views.py index 41c3c94d..bdc74322 100644 --- a/bda/views.py +++ b/bda/views.py @@ -292,8 +292,18 @@ def revente(request, tirage_id): 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}) - + attributions = spectacle.attribues.all() + participants = {} + for attrib in attributions: + participant = attrib.participant + participant.given = attrib.given + if (participant.id in participants): + participants[participant.id].nb_places = 2 + else: + participant.nb_places = 1 + participants[participant.id]=participant + + return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": participants.values()}) class SpectacleListView(ListView): model = Spectacle @@ -305,6 +315,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 From b1c8abcc3cd3f1b565df813f5b989d56132b233f Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 12 Jun 2016 18:39:47 +0200 Subject: [PATCH 09/52] =?UTF-8?q?Rajout=20de=20fonctionnalit=C3=A9s=20?= =?UTF-8?q?=C3=A0=20la=20liste=20des=20spectacles=20:=20acc=C3=A8s=20?= =?UTF-8?q?=C3=A0=20la=20page=20sp=C3=A9cifique=20=C3=A0=20chaque=20specta?= =?UTF-8?q?cle,=20export=20en=20.ics=20et=20mailing=20list=20des=20impay?= =?UTF-8?q?=C3=A9s=20(pr=C3=A9c=C3=A9demment=20dans=20utile=5Fbda)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/templates/spectacle_list.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bda/templates/spectacle_list.html b/bda/templates/spectacle_list.html index d707dde4..e1863eef 100644 --- a/bda/templates/spectacle_list.html +++ b/bda/templates/spectacle_list.html @@ -1,11 +1,18 @@ {% extends "base_title.html" %} {% block realcontent %} -

    Spectacles

    +

    {{tirage_name}}

    +
    +

    Liste des spectacles

    +
    +

    Exports

    + {% endblock %} From 7cd015dce88c214c2b22792d2a5ba9296d824c9a Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 12 Jun 2016 18:41:37 +0200 Subject: [PATCH 10/52] =?UTF-8?q?Ajout=20d'un=20tag=20qui=20transforme=20u?= =?UTF-8?q?n=20bool=C3=A9en=20(True/False)=20en=20son=20=C3=A9quivalent=20?= =?UTF-8?q?fran=C3=A7ais=20(Oui/Non)=20pour=20plus=20de=20lisibilit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestioncof/templatetags/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gestioncof/templatetags/utils.py b/gestioncof/templatetags/utils.py index 9c439dd3..5f90722e 100644 --- a/gestioncof/templatetags/utils.py +++ b/gestioncof/templatetags/utils.py @@ -34,3 +34,10 @@ def highlight_clipper(clipper, q): else: text = clipper.username return highlight_text(text, q) + +@register.filter +def oui_ou_non(b): + if b: + return "Oui" + else: + return "Non" From 7b2900e7ec4ef8afe6d56dbe3772af5a9a1a687f Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 12 Jun 2016 18:42:51 +0200 Subject: [PATCH 11/52] =?UTF-8?q?D=C3=A9placement=20de=20la=20gestion=20de?= =?UTF-8?q?s=20tirages=20de=20utile=5Fbda.html=20=C3=A0=20home.hmtl=20pour?= =?UTF-8?q?=20plus=20d'accessibilit=C3=A9=20;=20des=20fonctionnalit=C3=A9s?= =?UTF-8?q?=20sont=20aussi=20d=C3=A9plac=C3=A9es=20vers=20spectacle=5Flist?= =?UTF-8?q?.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestioncof/templates/home.html | 6 ++++++ gestioncof/templates/utile_bda.html | 10 ---------- 2 files changed, 6 insertions(+), 10 deletions(-) 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 %} From ac1c82b99ddc9090d8385b86ffce6246fc3db40c Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 12 Jun 2016 18:44:01 +0200 Subject: [PATCH 12/52] =?UTF-8?q?Cr=C3=A9=C3=A9e=20un=20template=20avec=20?= =?UTF-8?q?les=20informations=20sur=20un=20spectacle=20:=20participants,?= =?UTF-8?q?=20pay=C3=A9=20ou=20non,=20donn=C3=A9=20ou=20non...=20Possibili?= =?UTF-8?q?t=C3=A9=20d'exporter=20la=20liste=20mail=20des=20participants,?= =?UTF-8?q?=20ou=20celle=20des=20noms=20=C3=A0=20envoyer=20aux=20salles=20?= =?UTF-8?q?(avec=20doublons)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/templates/bda-participants.html | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 bda/templates/bda-participants.html diff --git a/bda/templates/bda-participants.html b/bda/templates/bda-participants.html new file mode 100644 index 00000000..f3592148 --- /dev/null +++ b/bda/templates/bda-participants.html @@ -0,0 +1,55 @@ +{% extends "base_title.html" %} +{% load utils %} + +{% block realcontent %} +

    {{ spectacle }}

    + + + + + + + + + + + + {% for participant in participants %} + + + + + + + + + + {% endfor %} + + +
    + + + + + +{% endblock %} From f4fe231d4b032e41c6f387e34ca59030e96399ac Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 12 Jun 2016 19:10:03 +0200 Subject: [PATCH 13/52] =?UTF-8?q?rajout=C3=A9=20balise=20
    NomClipperPlacesAdresse MailPayéDonné
    {{participant.user.get_full_name}}{{participant.user.username}}{{participant.nb_places}} place{{participant.nb_places|pluralize:",s"}}{{participant.user.email}} +
    + {{participant.paid|oui_ou_non}} +
    +
    +
    + {{participant.given|oui_ou_non}} +
    +
    =20manqua?= =?UTF-8?q?nte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/templates/bda-participants.html | 1 + 1 file changed, 1 insertion(+) diff --git a/bda/templates/bda-participants.html b/bda/templates/bda-participants.html index f3592148..22e2564a 100644 --- a/bda/templates/bda-participants.html +++ b/bda/templates/bda-participants.html @@ -33,6 +33,7 @@ {% endfor %} +
    +{% spaceless %} +{%endspaceless%}