Suppression de code inutile
Plus de raison d'utiliser les autres exports ics
This commit is contained in:
parent
0887cf824d
commit
998298ccdc
6 changed files with 0 additions and 64 deletions
|
@ -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
|
|
@ -12,7 +12,6 @@
|
|||
{% endfor %}
|
||||
</ol>
|
||||
<h4>Total à payer : {{ total|floatformat }}€</h4>
|
||||
<h4><a href="{% url "bda-places-attribuees-ics" tirage.id %}">Exporter au format calendrier</a> (.ics, compatible avec tous les logiciels d'agenda)</h4>
|
||||
{% else %}
|
||||
<h3>Vous n'avez aucune place :(</h3>
|
||||
{% endif %}
|
||||
|
|
|
@ -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
|
|
@ -11,6 +11,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 %}
|
||||
|
|
|
@ -11,9 +11,6 @@ urlpatterns = patterns(
|
|||
url(r'^places/(?P<tirage_id>\d+)$',
|
||||
'bda.views.places',
|
||||
name="bda-places-attribuees"),
|
||||
url(r'^places/(?P<tirage_id>\d+)/places_bda.ics$',
|
||||
'bda.views.places_ics',
|
||||
name="bda-places-attribuees-ics"),
|
||||
url(r'^revente/(?P<tirage_id>\d+)$',
|
||||
'bda.views.revente',
|
||||
name='bda-revente'),
|
||||
|
@ -27,9 +24,6 @@ urlpatterns = patterns(
|
|||
url(r'^spectacles/(?P<tirage_id>\d+)/(?P<spectacle_id>\d+)$',
|
||||
"bda.views.spectacle",
|
||||
name="bda-spectacle"),
|
||||
url(r'^spectacles-ics/(?P<tirage_id>\d+)$',
|
||||
'bda.views.liste_spectacles_ics',
|
||||
name="bda-liste-spectacles-ics"),
|
||||
url(r'^spectacles/unpaid/(?P<tirage_id>\d+)$',
|
||||
"bda.views.unpaid",
|
||||
name="bda-unpaid"),
|
||||
|
|
36
bda/views.py
36
bda/views.py
|
@ -104,31 +104,6 @@ def places(request, tirage_id):
|
|||
"warning": warning})
|
||||
|
||||
|
||||
@cof_required
|
||||
def places_ics(request, tirage_id):
|
||||
tirage = get_object_or_404(Tirage, id=tirage_id)
|
||||
participant, created = Participant.objects.get_or_create(
|
||||
user=request.user, tirage=tirage)
|
||||
places = participant.attribution_set.order_by(
|
||||
"spectacle__date", "spectacle").all()
|
||||
filtered_places = []
|
||||
places_dict = {}
|
||||
spectacles = []
|
||||
for place in places:
|
||||
if place.spectacle in spectacles:
|
||||
places_dict[place.spectacle].double = True
|
||||
else:
|
||||
place.double = False
|
||||
place.spectacle.dtend = place.spectacle.date \
|
||||
+ timedelta(seconds=7200)
|
||||
places_dict[place.spectacle] = place
|
||||
spectacles.append(place.spectacle)
|
||||
filtered_places.append(place)
|
||||
return render(request, "resume_places.ics",
|
||||
{"participant": participant,
|
||||
"places": filtered_places}, content_type="text/calendar")
|
||||
|
||||
|
||||
@cof_required
|
||||
def inscription(request, tirage_id):
|
||||
tirage = get_object_or_404(Tirage, id=tirage_id)
|
||||
|
@ -361,17 +336,6 @@ def unpaid(request, tirage_id):
|
|||
return render(request, "bda-unpaid.html", {"unpaid": unpaid})
|
||||
|
||||
|
||||
@buro_required
|
||||
def liste_spectacles_ics(request, tirage_id):
|
||||
tirage = get_object_or_404(Tirage, id=tirage_id)
|
||||
spectacles = tirage.spectacle_set.order_by("date").all()
|
||||
for spectacle in spectacles:
|
||||
spectacle.dtend = spectacle.date + timedelta(seconds=7200)
|
||||
return render(request, "liste_spectacles.ics",
|
||||
{"spectacles": spectacles, "tirage": tirage},
|
||||
content_type="text/calendar")
|
||||
|
||||
|
||||
@buro_required
|
||||
def send_rappel(request, spectacle_id):
|
||||
show = get_object_or_404(Spectacle, id=spectacle_id)
|
||||
|
|
Loading…
Reference in a new issue