From 60d8c2c086bffb51deafea9312435e274293159d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Bouttier?= Date: Wed, 9 Nov 2016 00:41:54 +0100 Subject: [PATCH] workshop attendee: add relevant infos in xml --- planning/utils.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/planning/utils.py b/planning/utils.py index f9625d7..8713f5e 100644 --- a/planning/utils.py +++ b/planning/utils.py @@ -3,6 +3,7 @@ from django.utils.safestring import mark_safe from django.utils.html import escape from django.utils.timezone import localtime from django.core.cache import cache +from django.core.urlresolvers import reverse from datetime import datetime, timedelta from copy import deepcopy @@ -220,6 +221,19 @@ class Program: 'person_id': speaker.id, 'person': str(speaker.profile), } + links = '' + registration = '' + if talk.registration_required: + links += mark_safe(""" + %(link)s""" % { + 'link': reverse('subscribe-to-talk', args={'talk': talk.slug}), + }) + registration = """ + %(max)s + %(remain)s""" % { + 'max': talk.attendees_limit, + 'remain': talk.remaining_attendees or 0, + } days_xml += """ %(start)s %(duration)s @@ -234,8 +248,8 @@ class Program: %(description)s %(persons)s - - + %(links)s + %(registration)s \n""" % { 'id': talk.id, 'start': localtime(talk.start_date).strftime('%H:%M'), @@ -248,6 +262,8 @@ class Program: 'abstract': escape(talk.abstract), 'description': escape(talk.description), 'persons': persons, + 'links': links, + 'registration': registration, } days_xml += ' \n' days_xml += '\n'