|
@@ -89,21 +89,30 @@ def ICal_Progamme_Dyn_Request(request): |
|
|
cal.add('version', '2.0') |
|
|
cal.add('version', '2.0') |
|
|
today = datetime.datetime.now() |
|
|
today = datetime.datetime.now() |
|
|
tz = timezone('Europe/Paris') |
|
|
tz = timezone('Europe/Paris') |
|
|
|
|
|
|
|
|
|
|
|
event = Evt() |
|
|
|
|
|
event['uid'] = "%d/%d" % ( year, 100 ) |
|
|
|
|
|
event.add('summary', "Les stands JM2L 2015" ) |
|
|
|
|
|
event.add('dtstart', datetime.datetime.now().replace(tzinfo=tz, hour=10, minute=00 ) ) |
|
|
|
|
|
event.add('dtend', datetime.datetime.now().replace(tzinfo=tz, hour=18, minute=00 ) ) |
|
|
|
|
|
event.add('created', datetime.datetime.now().replace(tzinfo=tz, hour=10, minute=00 ) ) |
|
|
|
|
|
event.add('description', "https://www.youtube.com/watch?v=91X65eEKxvU&t=6s" ) |
|
|
|
|
|
event.add('location', "http://jm2l.linux-azur.org/img/325.gif" ) |
|
|
|
|
|
event.add('url', "http://jm2l.linux-azur.org/2015/le-programme" ) |
|
|
|
|
|
event.add('priority', 5) |
|
|
|
|
|
cal.add_component(event) |
|
|
|
|
|
|
|
|
for i, ev in enumerate(Events): |
|
|
for i, ev in enumerate(Events): |
|
|
if ev.event_type: |
|
|
if ev.event_type: |
|
|
event = Evt() |
|
|
event = Evt() |
|
|
event['uid'] = "%d/%d" % ( year, ev.uid ) |
|
|
event['uid'] = "%d/%d" % ( year, ev.uid ) |
|
|
event.add('summary', ev.name +'_night' ) |
|
|
|
|
|
event.add('dtstart', ev.start_time.replace(tzinfo=tz, day=today.day, month = today.month, hour=(ev.start_time.hour)%24) ) |
|
|
|
|
|
event.add('dtend', ev.end_time.replace(tzinfo=tz, day=today.day, month = today.month, hour=(ev.end_time.hour)%24) ) |
|
|
|
|
|
|
|
|
event.add('summary', ev.name ) |
|
|
|
|
|
event.add('dtstart', ev.start_time.replace(tzinfo=tz, day=today.day, month = today.month, hour=(ev.start_time.hour)%24 ) ) |
|
|
|
|
|
event.add('dtend', ev.end_time.replace(tzinfo=tz, day=today.day, month = today.month, hour=(ev.end_time.hour)%24 ) ) |
|
|
event.add('created', ev.last_change.replace(tzinfo=tz) ) |
|
|
event.add('created', ev.last_change.replace(tzinfo=tz) ) |
|
|
if i%2: |
|
|
|
|
|
event.add('description', "http://video.webmfiles.org/big-buck-bunny_trailer.webm" ) |
|
|
|
|
|
else: |
|
|
|
|
|
event.add('description', "http://video.webmfiles.org/elephants-dream.webm" ) |
|
|
|
|
|
event.add('location', "http://jm2l.linux-azur.org/image/tasks/89/le-projet-de-learning-centre-sophiatech-32-638.jpg" ) |
|
|
|
|
|
|
|
|
event.add('description', "http://jm2l.linux-azur.org:8081/%d.webm" % ev.Salle.phy_salle_id ) |
|
|
|
|
|
event.add('location', "http://jm2l.linux-azur.org/img/%d.gif" % ev.Salle.phy_salle_id ) |
|
|
event.add('url', "http://www.linux-azur.org/event/%s/%s" % (ev.for_year, ev.slug) ) |
|
|
event.add('url', "http://www.linux-azur.org/event/%s/%s" % (ev.for_year, ev.slug) ) |
|
|
event.add('salle', "%s" % (ev.Salle.name) ) |
|
|
|
|
|
event.add('priority', 5) |
|
|
event.add('priority', 5) |
|
|
cal.add_component(event) |
|
|
cal.add_component(event) |
|
|
request.response.content_type = "text/calendar" |
|
|
request.response.content_type = "text/calendar" |
|
@@ -1221,7 +1230,7 @@ def link_event_user(request): |
|
|
else: |
|
|
else: |
|
|
TargetUser = Exist |
|
|
TargetUser = Exist |
|
|
|
|
|
|
|
|
uev = User_Event(year_uid=year, role=u"Animateur d'un évenement JM2L", user_uid=TargetUser.uid) |
|
|
|
|
|
|
|
|
uev = User_Event(year_uid=year, role=u"Animateur d'un évènement JM2L", user_uid=TargetUser.uid) |
|
|
TargetEvent.interventions.append( uev ) |
|
|
TargetEvent.interventions.append( uev ) |
|
|
|
|
|
|
|
|
return HTTPFound(location=request.route_url('edit_event', sep='/', |
|
|
return HTTPFound(location=request.route_url('edit_event', sep='/', |
|
@@ -1340,7 +1349,7 @@ def delete_event(request): |
|
|
intervention = request.matchdict.get('intervention', None) |
|
|
intervention = request.matchdict.get('intervention', None) |
|
|
# Check intervention |
|
|
# Check intervention |
|
|
if not intervention in ['Stand', 'Table_ronde', 'Atelier', 'Conference', 'Concert']: |
|
|
if not intervention in ['Stand', 'Table_ronde', 'Atelier', 'Conference', 'Concert']: |
|
|
raise HTTPNotFound(u"Ce type d'évenement n'est pas reconnu") |
|
|
|
|
|
|
|
|
raise HTTPNotFound(u"Ce type d'évènement n'est pas reconnu") |
|
|
# We should remove all links before to remove the event |
|
|
# We should remove all links before to remove the event |
|
|
if event_id.isdigit(): |
|
|
if event_id.isdigit(): |
|
|
TheEvent = Event.by_id(event_id) |
|
|
TheEvent = Event.by_id(event_id) |
|
@@ -1381,7 +1390,7 @@ def edit_event(request): |
|
|
IntervLabel = u'Table ronde' |
|
|
IntervLabel = u'Table ronde' |
|
|
# Check intervention |
|
|
# Check intervention |
|
|
if not intervention in ['Stand', 'Table_ronde', 'Atelier', 'Conference', 'Concert']: |
|
|
if not intervention in ['Stand', 'Table_ronde', 'Atelier', 'Conference', 'Concert']: |
|
|
raise HTTPNotFound(u"Ce type d'évenement n'est pas reconnu") |
|
|
|
|
|
|
|
|
raise HTTPNotFound(u"Ce type d'évènement n'est pas reconnu") |
|
|
TheYear = DBSession.query(JM2L_Year)\ |
|
|
TheYear = DBSession.query(JM2L_Year)\ |
|
|
.filter(JM2L_Year.year_uid==year)\ |
|
|
.filter(JM2L_Year.year_uid==year)\ |
|
|
.first() |
|
|
.first() |
|
@@ -1525,7 +1534,7 @@ def edit_event(request): |
|
|
# First we ensure there is no related event that already exist with that slug |
|
|
# First we ensure there is no related event that already exist with that slug |
|
|
CheckEvent = Event.by_slug( unicode(slugify(TheEvent.name)), year) |
|
|
CheckEvent = Event.by_slug( unicode(slugify(TheEvent.name)), year) |
|
|
if CheckEvent: |
|
|
if CheckEvent: |
|
|
request.session.flash(('warning',u'Choisissez un autre titre pour votre évenement, il est en conflit avec un autre.')) |
|
|
|
|
|
|
|
|
request.session.flash(('warning',u'Choisissez un autre titre pour votre évènement, il est en conflit avec un autre.')) |
|
|
return {'event':TheEvent, 'form':form, 'formAdd':formAdd, 'formAddT':formAddT, 'Salles':Salles } |
|
|
return {'event':TheEvent, 'form':form, 'formAdd':formAdd, 'formAddT':formAddT, 'Salles':Salles } |
|
|
else: |
|
|
else: |
|
|
SRCPath = path.join('jm2l/upload', *(IMAGEPATH + ['event'] + [ str(year) ] + [ TheEvent.slug ]) ) |
|
|
SRCPath = path.join('jm2l/upload', *(IMAGEPATH + ['event'] + [ str(year) ] + [ TheEvent.slug ]) ) |
|
|