diff --git a/jm2l/views.py b/jm2l/views.py
index 4331a0d..8f9b1fc 100644
--- a/jm2l/views.py
+++ b/jm2l/views.py
@@ -170,9 +170,17 @@ def JSON_TimeLine_Request(request):
.filter("strftime('%d', start_time) = :dow").params(dow=Day.day)\
.order_by(Event.start_time)
- ListEv = []
+ #ListEv = []
for ev in Events:
if ev.event_type:
+ CurMedia = ev.video.first() or ""
+ if CurMedia:
+ Container = """
"
+ else:
+ Container = ""
ListEv.append( {
#"uid":"%d/%d" % ( year, ev.uid ),
"headline":ev.name,
@@ -182,32 +190,55 @@ def JSON_TimeLine_Request(request):
"tags":ev.Salle and (ev.Salle.name or "unk") ,
#"status":ev.event_type,
"asset": {
- "media":"", #http://jm2l.linux-azur.org/sites/jm2l.linux-azur.org/files/videos/2012/2012_Introduction_aux_logiciels_libres__Frederic_Couchet.ogv",
+ "media": Container,
"credit":"",
"caption":"" }
} )
- break
- DicResult = {
- "lang":"fr",
- "headline":"JM2L 2015",
- "type":"default",
- "startDate":"2015,11,28,10",
- "text":"
9ème Édition",
- "asset":
- {
- "media":"https://www.youtube.com/watch?v=DnfjrxVoLao",
- "credit":"JM2L",
- "caption":""
+ if year=="2015":
+ DicResult = {
+ "lang":"fr",
+ "headline":"JM2L 2015",
+ "type":"default",
+ "startDate":"2015,11,28,10",
+ "text":"
9ème Édition",
+ "asset":
+ {
+ "media":"https://www.youtube.com/watch?v=DnfjrxVoLao",
+ "credit":"JM2L",
+ "caption":""
+ }
+ }
+ else:
+ DicResult = {
+ "lang":"fr",
+ "headline":"JM2L %d" % year,
+ "type":"default",
+ "asset":
+ {
+ "media":"",
+ "credit":"JM2L",
+ "caption":""
+ }
}
- }
DicResult["date"] = ListEv
return { 'timeline':DicResult }
## =-=- Here, We handle HTTP requests - Public Part -=-=
@view_config(route_name='home', renderer="jm2l:templates/NewIndex.mako")
def index_page(request):
- MainTab = {'accueil':'active', "logged_in":request.authenticated_userid }
- return MainTab
+ year = request.matchdict.get('year')
+ if year:
+ year=int(year[:-1])
+ if 2004
ère" }
+ else:
+ edition = year - 2005
+ return {'year': year, 'edition':u"%dème" % edition }
+ else:
+ raise HTTPNotFound()
+ return {'year': CurrentYear, 'edition':u"9ème"}
+
@view_config(route_name='programme', renderer="jm2l:templates/Public/Programme.mako")
def programme(request):
@@ -250,7 +281,9 @@ def edit_presse(request):
return MainTab
@view_config(route_name='plan', renderer="jm2l:templates/Public/Plan.mako")
-def static_plan(request):
+def static_plan(request):
+ session = request.session
+ session['year'] = 2015
MainTab = {'plan':'active', "logged_in":request.authenticated_userid }
return MainTab
@@ -850,7 +883,7 @@ def change_year(request):
session = request.session
if year>-1:
session['year'] = year
- return HTTPFound(location='/%s/le-programme' % year)
+ return HTTPFound(location='/%s/' % year)
return HTTPFound(location=request.route_url('home'))
@view_config(route_name='pict_user', renderer="jm2l:templates/Profil/pict_user.mako")