@@ -112,7 +112,7 @@ class TiersMember(MyBaseForm): | |||||
csrf = False | csrf = False | ||||
year_uid = SelectField(u'Année', coerce=int, | year_uid = SelectField(u'Année', coerce=int, | ||||
choices=zip(range(2006, CurrentYear + 1), range(2006, CurrentYear + 1))) | |||||
choices=list(zip(range(2006, CurrentYear + 1), range(2006, CurrentYear + 1)))) | |||||
user_uid = StringField(u'user') | user_uid = StringField(u'user') | ||||
role = StringField(u'Role') | role = StringField(u'Role') | ||||
@@ -122,7 +122,7 @@ class TiersRole(MyBaseForm): | |||||
csrf = False | csrf = False | ||||
year_uid = SelectField(u'Année', coerce=int, | year_uid = SelectField(u'Année', coerce=int, | ||||
choices=zip(range(2006, CurrentYear + 1), range(2006, CurrentYear + 1))) | |||||
choices=list(zip(range(2006, CurrentYear + 1), range(2006, CurrentYear + 1)))) | |||||
tiers_role = SelectField(u'Role', choices=TIERS_ROLE) | tiers_role = SelectField(u'Role', choices=TIERS_ROLE) | ||||
@@ -1,6 +1,6 @@ | |||||
<%inherit file="jm2l:templates/layout.mako"/> | <%inherit file="jm2l:templates/layout.mako"/> | ||||
<%def name="jsAddOn()"> | <%def name="jsAddOn()"> | ||||
<script src="/vendor/timeline/js/timeline-src.js"></script> | |||||
<script src="/vendor/timeline/js/timeline-min.js"></script> | |||||
<script> | <script> | ||||
var timeline = new VMM.Timeline("timeline", '95%', '600px'); | var timeline = new VMM.Timeline("timeline", '95%', '600px'); | ||||
var c = {language:{ lang:"fr",api:{wikipedia:"fr"},date:{month:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],month_abbr:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","dec."],day:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],day_abbr:["Dim.","Lu.","Ma.","Me.","Jeu.","Vend.","Sam."]},dateformats:{year:"yyyy",month_short:"mmm",month:"mmmm yyyy",full_short:"d mmm",full:"d mmmm yyyy",time_short:"HH:MM:SS",time_no_seconds_short:"HH:MM",time_no_seconds_small_date:"HH:MM'<br/><small>'d mmmm yyyy'</small>'",full_long:"dddd',' d mmm yyyy 'à' HH:MM",full_long_small_date:"HH:MM'<br/><small>'dddd',' d mmm yyyy'</small>'"},messages:{loading_timeline:"Chargement de la frise en cours... ",return_to_title:"Retour à la page d'accueil",expand_timeline:"Elargir la frise",contract_timeline:"Réduire la frise",wikipedia:"Extrait de Wikipedia, l'encyclopédie libre",loading_content:"Chargement",loading:"Chargement",swipe_nav:"Swipe to Navigate"}}}; | var c = {language:{ lang:"fr",api:{wikipedia:"fr"},date:{month:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],month_abbr:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","dec."],day:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],day_abbr:["Dim.","Lu.","Ma.","Me.","Jeu.","Vend.","Sam."]},dateformats:{year:"yyyy",month_short:"mmm",month:"mmmm yyyy",full_short:"d mmm",full:"d mmmm yyyy",time_short:"HH:MM:SS",time_no_seconds_short:"HH:MM",time_no_seconds_small_date:"HH:MM'<br/><small>'d mmmm yyyy'</small>'",full_long:"dddd',' d mmm yyyy 'à' HH:MM",full_long_small_date:"HH:MM'<br/><small>'dddd',' d mmm yyyy'</small>'"},messages:{loading_timeline:"Chargement de la frise en cours... ",return_to_title:"Retour à la page d'accueil",expand_timeline:"Elargir la frise",contract_timeline:"Réduire la frise",wikipedia:"Extrait de Wikipedia, l'encyclopédie libre",loading_content:"Chargement",loading:"Chargement",swipe_nav:"Swipe to Navigate"}}}; | ||||
@@ -314,8 +314,10 @@ class MediaUpload(MediaPath): | |||||
timage = Image.new('RGBA', (THUMBNAIL_SIZE, THUMBNAIL_SIZE), (255, 255, 255, 0)) | timage = Image.new('RGBA', (THUMBNAIL_SIZE, THUMBNAIL_SIZE), (255, 255, 255, 0)) | ||||
timage.paste( | timage.paste( | ||||
image, | image, | ||||
((THUMBNAIL_SIZE - image.size[0]) / 2, (THUMBNAIL_SIZE - image.size[1]) / 2)) | |||||
(int((THUMBNAIL_SIZE - image.size[0]) / 2), int((THUMBNAIL_SIZE - image.size[1]) / 2))) | |||||
TargetFileName = self.thumbnailpath(filename) | TargetFileName = self.thumbnailpath(filename) | ||||
if not TargetFileName.endswith('png'): | |||||
timage = timage.convert('RGB') | |||||
timage.save(TargetFileName) | timage.save(TargetFileName) | ||||
return self.thumbnailurl(os.path.basename(TargetFileName)) | return self.thumbnailurl(os.path.basename(TargetFileName)) | ||||
@@ -331,7 +333,7 @@ class MediaUpload(MediaPath): | |||||
# Add thumbnail | # Add thumbnail | ||||
timage.paste( | timage.paste( | ||||
image, | image, | ||||
((THUMBNAIL_SIZE - image.size[0]) / 2, (THUMBNAIL_SIZE - image.size[1]) / 2)) | |||||
(int((THUMBNAIL_SIZE - image.size[0]) / 2), int((THUMBNAIL_SIZE - image.size[1]) / 2))) | |||||
# Stamp with PDF file type | # Stamp with PDF file type | ||||
timage.paste( | timage.paste( | ||||
pdf_indicator, | pdf_indicator, | ||||
@@ -355,7 +357,7 @@ class MediaUpload(MediaPath): | |||||
# Add thumbnail | # Add thumbnail | ||||
timage.paste( | timage.paste( | ||||
image, | image, | ||||
((THUMBNAIL_SIZE - image.size[0]) / 2, (THUMBNAIL_SIZE - image.size[1]) / 2)) | |||||
(int((THUMBNAIL_SIZE - image.size[0]) / 2), int((THUMBNAIL_SIZE - image.size[1]) / 2))) | |||||
# Stamp with PDF file type | # Stamp with PDF file type | ||||
timage.paste( | timage.paste( | ||||
pdf_indicator, | pdf_indicator, | ||||
@@ -387,7 +389,7 @@ class MediaUpload(MediaPath): | |||||
# Add thumbnail | # Add thumbnail | ||||
timage.paste( | timage.paste( | ||||
image, | image, | ||||
((THUMBNAIL_SIZE - image.size[0]) / 2, (THUMBNAIL_SIZE - image.size[1]) / 2)) | |||||
(int((THUMBNAIL_SIZE - image.size[0]) / 2), int((THUMBNAIL_SIZE - image.size[1]) / 2))) | |||||
# Stamp with PDF file type | # Stamp with PDF file type | ||||
timage.paste( | timage.paste( | ||||
stamp, | stamp, | ||||
@@ -420,7 +422,7 @@ class MediaUpload(MediaPath): | |||||
# Add thumbnail | # Add thumbnail | ||||
timage.paste( | timage.paste( | ||||
image, | image, | ||||
((THUMBNAIL_SIZE - image.size[0]) / 2, (THUMBNAIL_SIZE - image.size[1]) / 2)) | |||||
(int((THUMBNAIL_SIZE - image.size[0]) / 2), int((THUMBNAIL_SIZE - image.size[1]) / 2))) | |||||
# Stamp with Blender file type | # Stamp with Blender file type | ||||
timage.paste( | timage.paste( | ||||
blender_indicator, | blender_indicator, | ||||
@@ -526,8 +528,8 @@ class MediaUpload(MediaPath): | |||||
return self.delete() | return self.delete() | ||||
results = [] | results = [] | ||||
for name, fieldStorage in self.request.POST.items(): | for name, fieldStorage in self.request.POST.items(): | ||||
if isinstance(fieldStorage, unicode): | |||||
continue | |||||
# if isinstance(fieldStorage, unicode): | |||||
# continue | |||||
result = {} | result = {} | ||||
result['name'] = os.path.basename(fieldStorage.filename) | result['name'] = os.path.basename(fieldStorage.filename) | ||||
result['type'] = fieldStorage.type | result['type'] = fieldStorage.type | ||||