Merge branch 'Kerl/calendar' into 'master'

Ajout d'un calendrier dynamique

Ce patch propose aux adhérents du COF de télécharger un calendrier
dynamique (`.ics`).

Il est configurable : 

    - On peut s'abonner ou non aux événements du COF.
    - On peut choisir les spectacles auxquels on veut s'abonner.
        - Une checkbox permet d'ajouter d'un coup les spectacles pour lesquels on a obtenu une place
        - On peut en ajouter d'autres 

Pour faire fonctionner ce patch, il faut installer la bibliothèque python `icalendar` : 
    
    pip install --upgrade -r requirements.txt

Fixes #20
Fixes #14 

See merge request !63
This commit is contained in:
Martin Pepin 2016-07-29 21:42:58 +02:00
commit bbc4b59bfe
15 changed files with 211 additions and 73 deletions

View file

@ -1,10 +0,0 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GESTIOCOF/bda//EN
{% for spectacle in spectacles %}BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:{{ spectacle.date|date:'Ymd\\THis' }}
DTEND;TZID=Europe/Paris:{{ spectacle.dtend|date:'Ymd\\THis' }}
SUMMARY:{{ spectacle.title|safe }}
LOCATION:{{ spectacle.location.name|safe }}
END:VEVENT
{% endfor %}END:VCALENDAR

View file

@ -18,7 +18,9 @@
</table>
<h4 class="bda-prix">Total à payer : {{ total|floatformat }}€</h4>
<br/>
<h4><a href="{% url "bda-places-attribuees-ics" tirage.id %}">Exporter au format calendrier</a> (.ics, compatible avec tous les logiciels d'agenda)</h4>
<p>Ne manque pas un spectacle avec le
<a href="{% url "gestioncof.views.calendar" %}">calendrier
automatique&#8239;!</a></p>
{% else %}
<h3>Vous n'avez aucune place :(</h3>
{% endif %}

View file

@ -1,10 +0,0 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GESTIOCOF/bda//EN
{% for place in places %}BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:{{ place.spectacle.date|date:'Ymd\\THis' }}
DTEND;TZID=Europe/Paris:{{ place.spectacle.dtend|date:'Ymd\\THis' }}
SUMMARY:{{ place.spectacle.title|safe }}{% if place.double %} (deux places){% endif %}
LOCATION:{{ place.spectacle.location.name|safe }}
END:VEVENT
{% endfor %}END:VCALENDAR

View file

@ -48,6 +48,5 @@
<h3> Exports </h3>
<ul>
<li><a href="{% url 'bda-unpaid' tirage_id %}">Mailing list impayés</a>
<li><a href="{% url 'bda-liste-spectacles-ics' tirage_id %}">Calendrier des spectacles (.ics)</a>
</ul>
{% endblock %}