|
@@ -33,6 +33,8 @@ import shutil |
|
|
import glob |
|
|
import glob |
|
|
from jm2l.const import CurrentYear |
|
|
from jm2l.const import CurrentYear |
|
|
|
|
|
|
|
|
|
|
|
from passlib.hash import argon2 |
|
|
|
|
|
|
|
|
## =-=- Here, We keep some usefull function -=-= |
|
|
## =-=- Here, We keep some usefull function -=-= |
|
|
def remove_accents(input_str): |
|
|
def remove_accents(input_str): |
|
|
""" This function is intended to remove all accent from input unicode string """ |
|
|
""" This function is intended to remove all accent from input unicode string """ |
|
@@ -297,7 +299,7 @@ def JSON_TimeLine_Request(request): |
|
|
"asset": |
|
|
"asset": |
|
|
{ |
|
|
{ |
|
|
#"media":"https://www.youtube.com/watch?v=91X65eEKxvU&t=6s", |
|
|
#"media":"https://www.youtube.com/watch?v=91X65eEKxvU&t=6s", |
|
|
"media":embeed_video("video/ogg","http://jm2l.linux-azur.org/resources/2015/Video/jm2l_france3-2015.ogv"), |
|
|
|
|
|
|
|
|
"media":embeed_video("video/ogg","/resources/2015/Video/jm2l_france3-2015.ogv"), |
|
|
"credit":"Reportage France 3", |
|
|
"credit":"Reportage France 3", |
|
|
"caption":"JM2L 2015" |
|
|
"caption":"JM2L 2015" |
|
|
} |
|
|
} |
|
@@ -312,7 +314,7 @@ def JSON_TimeLine_Request(request): |
|
|
"asset": |
|
|
"asset": |
|
|
{ |
|
|
{ |
|
|
#"media":"https://www.youtube.com/watch?v=91X65eEKxvU&t=6s", |
|
|
#"media":"https://www.youtube.com/watch?v=91X65eEKxvU&t=6s", |
|
|
"media":embeed_video("video/ogg","http://jm2l.linux-azur.org/resources/2015/Video/jm2l_france3-2015.ogv"), |
|
|
|
|
|
|
|
|
"media":embeed_video("video/ogg","/resources/2015/Video/jm2l_france3-2015.ogv"), |
|
|
"credit":"Reportage France 3", |
|
|
"credit":"Reportage France 3", |
|
|
"caption":"JM2L 2015" |
|
|
"caption":"JM2L 2015" |
|
|
} |
|
|
} |
|
@@ -339,7 +341,7 @@ def JSON_TimeLine_Request(request): |
|
|
"text":"<i><span class='c1'>5ème Édition</span></i>", |
|
|
"text":"<i><span class='c1'>5ème Édition</span></i>", |
|
|
"asset": |
|
|
"asset": |
|
|
{ |
|
|
{ |
|
|
"media":embeed_video("video/ogg","http://jm2l.linux-azur.org/resources/2010/Video/reportages/JM2L2010-PleinSudTV.ogv"), |
|
|
|
|
|
|
|
|
"media":embeed_video("video/ogg","/resources/2010/Video/reportages/JM2L2010-PleinSudTV.ogv"), |
|
|
"credit":"<a href='http://pleinsudtv.com/index.php/casa/affichage-en-vignettes/93-casa-culture/582-les-jm-du-logiciel-libre-2010'>Le reportage Plein-sud TV</a>", |
|
|
"credit":"<a href='http://pleinsudtv.com/index.php/casa/affichage-en-vignettes/93-casa-culture/582-les-jm-du-logiciel-libre-2010'>Le reportage Plein-sud TV</a>", |
|
|
"caption":"JM2L", |
|
|
"caption":"JM2L", |
|
|
} |
|
|
} |
|
@@ -352,7 +354,7 @@ def JSON_TimeLine_Request(request): |
|
|
"text":"<i><span class='c1'>2ème Édition</span></i>", |
|
|
"text":"<i><span class='c1'>2ème Édition</span></i>", |
|
|
"asset": |
|
|
"asset": |
|
|
{ |
|
|
{ |
|
|
"media":embeed_video("video/ogg","http://jm2l.linux-azur.org/resources/2007/Video/20071110-linux.ogv"), |
|
|
|
|
|
|
|
|
"media":embeed_video("video/ogg","/resources/2007/Video/20071110-linux.ogv"), |
|
|
"credit":"<a href='http://pleinsudtv.com/index.php/casa/affichage-en-vignettes/93-casa-culture/245-logiciel-libre-linux-jm2l'>Le reportage Plein-sud TV</a>", |
|
|
"credit":"<a href='http://pleinsudtv.com/index.php/casa/affichage-en-vignettes/93-casa-culture/245-logiciel-libre-linux-jm2l'>Le reportage Plein-sud TV</a>", |
|
|
"caption":"JM2L 2007", |
|
|
"caption":"JM2L 2007", |
|
|
} |
|
|
} |
|
@@ -518,12 +520,20 @@ def expenses(request): |
|
|
if dic_out[tab_path[4]].get('RIB') is None: |
|
|
if dic_out[tab_path[4]].get('RIB') is None: |
|
|
dic_out[tab_path[4]]['RIB'] = {'files':[], 'thumb':[]} |
|
|
dic_out[tab_path[4]]['RIB'] = {'files':[], 'thumb':[]} |
|
|
u = User.by_slug(tab_path[4]) |
|
|
u = User.by_slug(tab_path[4]) |
|
|
dic_out[tab_path[4]]['User'] = { |
|
|
|
|
|
'uid':u.uid, |
|
|
|
|
|
'nom':u.nom, |
|
|
|
|
|
'prenom':u.prenom, |
|
|
|
|
|
'slug':u.slug |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if u is None: |
|
|
|
|
|
dic_out[tab_path[4]]['User'] = { |
|
|
|
|
|
'uid':'# NOT FOUND', |
|
|
|
|
|
'nom':name, |
|
|
|
|
|
'prenom':'# NOT FOUND', |
|
|
|
|
|
'slug':'# NOT FOUND' |
|
|
|
|
|
} |
|
|
|
|
|
else: |
|
|
|
|
|
dic_out[tab_path[4]]['User'] = { |
|
|
|
|
|
'uid':u.uid, |
|
|
|
|
|
'nom':u.nom, |
|
|
|
|
|
'prenom':u.prenom, |
|
|
|
|
|
'slug':u.slug |
|
|
|
|
|
} |
|
|
dic_out[tab_path[4]]['RIB']['files'].append( name ) |
|
|
dic_out[tab_path[4]]['RIB']['files'].append( name ) |
|
|
dic_out[tab_path[4]]['RIB']['thumb'].append( name + ".jpg" ) |
|
|
dic_out[tab_path[4]]['RIB']['thumb'].append( name + ".jpg" ) |
|
|
|
|
|
|
|
@@ -539,12 +549,20 @@ def expenses(request): |
|
|
if dic_out[tab_path[4]].get('Justif') is None: |
|
|
if dic_out[tab_path[4]].get('Justif') is None: |
|
|
dic_out[tab_path[4]]['Justif'] = {'files':[], 'thumb':[]} |
|
|
dic_out[tab_path[4]]['Justif'] = {'files':[], 'thumb':[]} |
|
|
u = User.by_slug(tab_path[4]) |
|
|
u = User.by_slug(tab_path[4]) |
|
|
dic_out[tab_path[4]]['User'] = { |
|
|
|
|
|
'uid':u.uid, |
|
|
|
|
|
'nom':u.nom, |
|
|
|
|
|
'prenom':u.prenom, |
|
|
|
|
|
'slug':u.slug |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if u is None: |
|
|
|
|
|
dic_out[tab_path[4]]['User'] = { |
|
|
|
|
|
'uid':'# NOT FOUND', |
|
|
|
|
|
'nom':name, |
|
|
|
|
|
'prenom':'# NOT FOUND', |
|
|
|
|
|
'slug':'# NOT FOUND' |
|
|
|
|
|
} |
|
|
|
|
|
else: |
|
|
|
|
|
dic_out[tab_path[4]]['User'] = { |
|
|
|
|
|
'uid':u.uid, |
|
|
|
|
|
'nom':u.nom, |
|
|
|
|
|
'prenom':u.prenom, |
|
|
|
|
|
'slug':u.slug |
|
|
|
|
|
} |
|
|
dic_out[tab_path[4]]['Justif']['files'].append( name ) |
|
|
dic_out[tab_path[4]]['Justif']['files'].append( name ) |
|
|
dic_out[tab_path[4]]['Justif']['thumb'].append( name + ".jpg" ) |
|
|
dic_out[tab_path[4]]['Justif']['thumb'].append( name + ".jpg" ) |
|
|
|
|
|
|
|
@@ -1171,7 +1189,7 @@ def Modal(request): |
|
|
response = render_to_response('jm2l:templates/modals_js.mako', |
|
|
response = render_to_response('jm2l:templates/modals_js.mako', |
|
|
{'modtype':modtype}, |
|
|
{'modtype':modtype}, |
|
|
request=request) |
|
|
request=request) |
|
|
request.user.password = form.password.data |
|
|
|
|
|
|
|
|
request.user.password = argon2.using(rounds=4).hash(form.password.data) |
|
|
DBSession.merge(request.user) |
|
|
DBSession.merge(request.user) |
|
|
response.content_type = 'text/javascript' |
|
|
response.content_type = 'text/javascript' |
|
|
return response |
|
|
return response |
|
|