@@ -300,17 +300,15 @@ class MetaData:
300
300
list_display_related = [list_display_base [0 ]] + [('get_display_link' , _ (u'Affichage' )), ] + list_display_base [1 :] + [('get_conflits_list' , _ (u'Conflits' )), ]
301
301
302
302
forced_widths = {
303
- '1' : '15 %' ,
303
+ '1' : '20 %' ,
304
304
'4' : '150px' ,
305
305
'5' : '150px' ,
306
- '6' : '150px' ,
307
306
}
308
307
309
308
forced_widths_related = {
310
- '1' : '15%' ,
311
- '4' : '150px' ,
312
- '5' : '150px' ,
313
- '6' : '150px' ,
309
+ '1' : '20%' ,
310
+ '4' : '90px' ,
311
+ '5' : '90px' ,
314
312
'7' : '80px' ,
315
313
}
316
314
@@ -400,7 +398,7 @@ def genericFormExtraClean(self, data, form):
400
398
def get_display_infos (self ):
401
399
"""Affiche les infos sur les affichages pour une réserversation"""
402
400
403
- tpl = mark_safe (u'<div style="margin-top: 5px;">%s, %s <span class="label label-info">%s </span></div>' % (escape (self .display .title ), _ (u'gérée par' ), escape (self .display .unit .name ), ))
401
+ tpl = mark_safe (u'<div style="margin-top: 5px;">{}, {} <span class="label label-info">{} </span></div>' . format (escape (self .display .title ), _ (u'gérée par' ), escape (self .display .unit .name )))
404
402
405
403
return tpl
406
404
@@ -410,23 +408,21 @@ def get_conflits(self):
410
408
status__in = ['1_asking' , '2_online' ], end_date__gt = self .start_date , start_date__lt = self .end_date )
411
409
412
410
if not liste :
413
- return mark_safe ('<span class="txt-color-green"><i class="fa fa-check"></i> %s</span>' % (
414
- unicode (_ ('Pas de conflits !' )),))
411
+ return mark_safe ('<span class="txt-color-green"><i class="fa fa-check"></i> {}</span>' .format (_ ('Pas de conflits !' )))
415
412
else :
416
- retour = '<span class="txt-color-red"><i class="fa fa-warning"></i> %s</span><ul>' % (
417
- unicode (_ (u'Il y a d\' autres réservations en même temps !' )),)
413
+ retour = u'<span class="txt-color-red"><i class="fa fa-warning"></i> {}</span><ul>' .format (_ (u'Il y a d\' autres réservations en même temps !' ))
418
414
419
415
for elem in liste :
420
- retour + = u'<li><span class="label label-%s "><i class="%s "></i> %s </span> %s pour l \' unité %s <span data-toggle="tooltip" data-placement="right" title="Du %s au %s"><i class="fa fa-clock-o"></i> </span></li>' % (
421
- elem . status_color (), elem . status_icon (), elem . get_status_display () , elem , elem .get_unit_name (),
422
- localtime (elem .start_date ), localtime (elem .end_date ), )
416
+ retour = u'{} <li><span class="label label-{} "><i class="{} "></i> {} </span>' . format ( retour , elem . status_color (), elem . status_icon (), elem . get_status_display ())
417
+ retour = u'{} {} pour l \' unité {}' . format ( retour , elem , elem .get_unit_name ())
418
+ retour = u'{} <span data-toggle="tooltip" data-placement="right" title="Du {} au {}"><i class="fa fa-clock-o"></i></span></li>' . format ( retour , localtime (elem .start_date ), localtime (elem .end_date ))
423
419
424
- retour += ' </ul>'
420
+ retour = u'{} </ul>'. format ( retour )
425
421
426
422
return retour
427
423
428
424
def get_display_link (self ):
429
- return '<a href="%s">%s </a>' % (reverse ('communication.views.display_show' , args = (self .display .pk ,)), self .display , )
425
+ return '<a href="{}">{} </a>' . format (reverse ('communication.views.display_show' , args = (self .display .pk ,)), self .display )
430
426
431
427
def get_conflits_list (self ):
432
428
@@ -437,11 +433,14 @@ def get_conflits_list(self):
437
433
return '<span class="txt-color-green"><i class="fa fa-check"></i></span>'
438
434
else :
439
435
440
- retour = ' '
436
+ retour = u'<ul> '
441
437
442
438
for elem in liste :
443
- retour += u'%s, %s, pour %s du %s au %s, ' % (
444
- elem , elem .get_status_display (), elem .unit if elem .unit else elem .unit_blank_name ,
445
- localtime (elem .start_date ), localtime (elem .end_date ),)
439
+ unit = escape (elem .unit ) if elem .unit else escape (elem .unit_blank_name )
440
+
441
+ retour = u'{}<li><span>{} ({}) [{}]<br>' .format (retour , escape (elem ), unit , elem .get_status_display ())
442
+ retour = u'{}du {}<br>au {}</span></li>' .format (retour , localtime (elem .start_date ), localtime (elem .end_date ))
443
+
444
+ retour = u'{}</ul>' .format (retour )
446
445
447
- return '<span class="txt-color-red" title="%s "><i class="fa fa-warning"></i></span><ul>' % (retour [: - 2 ],)
446
+ return u '<span class="txt-color-red conflicts-tooltip-parent" rel="tooltip" data-placement="bottom" data-html="true" title="{} "><i class="fa fa-warning"></i></span>' . format (retour )
0 commit comments