Le repo des sources pour le site web des JM2L
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

784 рядки
32 KiB

  1. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. ## Afficher un form
  3. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4. <%def name="DisplayRespForm(form, DicFormat)">
  5. <%
  6. TabJs = {'select':[], 'desc':[]}
  7. %>
  8. <div class="row-fluid">
  9. % for FieldName, Field in form._fields.items():
  10. % if Field.name in DicFormat and DicFormat[Field.name].get("Ignore"):
  11. <% continue %>
  12. % endif
  13. % if Field.type in ['HiddenField', 'CSRFTokenField']:
  14. ${Field}
  15. <% continue %>
  16. % elif Field.type=="SelectField":
  17. <% TabJs['select'].append(Field.label.field_id) %>
  18. % endif
  19. <div class="${DicFormat[Field.name].get("ContainerClass")}">
  20. <label for="${Field.label.field_id}">${Field.label.text}
  21. % if Field.description:
  22. <% TabJs['desc'].append(Field.label.field_id) %>
  23. <a id="${Field.label.field_id}-help" data-toggle="popover"
  24. data-original-title="${Field.label.text}"
  25. data-content="${Field.description}">
  26. <i class="icon-me" style="background-image: url('/img/Help.png');background-position:0 0;"></i>
  27. </a>
  28. % endif
  29. </label>
  30. % if Field.name in DicFormat:
  31. <%
  32. PlaceHolder = DicFormat[Field.name].get("PlaceHolder")
  33. Class = [False,"ckeditor"][ "ckeditor" in DicFormat[Field.name] ]
  34. %>
  35. % if Field.type == "date":
  36. ${Field(placeholder=PlaceHolder or False, class_="datepicker", style="width:100%" )}
  37. % else:
  38. ${Field(placeholder=PlaceHolder or False, class_=Class, style="width:100%")}
  39. % endif
  40. % else:
  41. ${Field(style="width:100%")}
  42. % endif
  43. % for error in Field.errors:
  44. <div class="alert alert-error">
  45. <button type="button" class="close" data-dismiss="alert">&times;</button>
  46. <h4>Erreur!</h4>
  47. ${ error }
  48. </div>
  49. % endfor
  50. </div>
  51. % if Field.name in DicFormat and DicFormat[Field.name].get("next")==True:
  52. </div>
  53. <div class="row-fluid">
  54. % endif
  55. % endfor
  56. </div>
  57. <%
  58. for jsitem in TabJs['select']:
  59. context._kwargs['postpone_js'].append( "$('#%s').select2({});" % jsitem )
  60. for jsitem in TabJs['desc']:
  61. context._kwargs['postpone_js'].append( "$('#%s-help').popover();" % jsitem )
  62. %>
  63. </%def>
  64. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  65. ## Afficher un form
  66. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  67. <%def name="DisplayForm(form, DicFormat)">
  68. <%
  69. TabJs = {'select':[], 'desc':[]}
  70. %>
  71. % for FieldName, Field in form._fields.items():
  72. % if Field.name in DicFormat and DicFormat[Field.name].get("Ignore"):
  73. <% continue %>
  74. % endif
  75. % if Field.type in ['HiddenField', 'CSRFTokenField']:
  76. ${Field}
  77. <% continue %>
  78. % elif Field.type=="SelectField":
  79. <% TabJs['select'].append(Field.label.field_id) %>
  80. % endif
  81. % if Field.name in DicFormat and DicFormat[Field.name].get("fieldset"):
  82. <fieldset>
  83. <legend>${Field.label.text}</legend>
  84. % else:
  85. % if Field.name in DicFormat and DicFormat[Field.name].get("ContainerStyle"):
  86. <div style="padding-right:5px;${DicFormat[Field.name].get("ContainerStyle")}">
  87. % else:
  88. <div style="padding-right:5px;">
  89. % endif
  90. <label for="${Field.label.field_id}">${Field.label.text}
  91. % if Field.description:
  92. <% TabJs['desc'].append(Field.label.field_id) %>
  93. <a id="${Field.label.field_id}-help" data-toggle="popover"
  94. data-original-title="${Field.label.text}"
  95. data-content="${Field.description}">
  96. <i class="icon-me" style="background-image: url('/img/Help.png');background-position:1px 2px;"></i>
  97. </a>
  98. % endif
  99. </label>
  100. % endif
  101. % if Field.name in DicFormat:
  102. <%
  103. PlaceHolder = DicFormat[Field.name].get("PlaceHolder")
  104. FieldStyle = DicFormat[Field.name].get("FieldStyle")
  105. Class = [False, "ckeditor"][ "ckeditor" in DicFormat[Field.name] ]
  106. %>
  107. % if Field.type == "date":
  108. ${Field(placeholder=PlaceHolder or False, style=FieldStyle, class_="datepicker" )}
  109. % else:
  110. ${Field(placeholder=PlaceHolder or False, style=FieldStyle, class_=Class)}
  111. % endif
  112. % else:
  113. ${Field()}
  114. % endif
  115. % for error in Field.errors:
  116. <div class="alert alert-error">
  117. <button type="button" class="close" data-dismiss="alert">&times;</button>
  118. <h4>Erreur!</h4>
  119. ${ error }
  120. </div>
  121. % endfor
  122. % if Field.name in DicFormat and DicFormat[Field.name].get("fieldset"):
  123. </fieldset>
  124. % else:
  125. </div>
  126. % endif
  127. % endfor
  128. <%
  129. for jsitem in TabJs['select']:
  130. context._kwargs['postpone_js'].append( "$('#%s').select2({});" % jsitem )
  131. for jsitem in TabJs['desc']:
  132. context._kwargs['postpone_js'].append( "$('#%s-help').popover();" % jsitem )
  133. %>
  134. </%def>
  135. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  136. ## Wrapper pour la form Sejour
  137. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  138. <%def name="sejour_wrapper(Places)">
  139. <div class="form-inline">
  140. Départ :
  141. <select style="width:12em;" id="Arrival:Place" name="Arrival:Place" title="Lieu">
  142. % for place in Places:
  143. <option value="${place.place_id}">${place.display_name}</option>
  144. % endfor
  145. </select>
  146. </div>
  147. <br />
  148. <div class="form-inline">
  149. Arrivée :
  150. <select style="width:12em;" id="Arrival:Place" name="Arrival:Place" title="Lieu">
  151. % for place in Places:
  152. <option value="${place.place_id}">${place.display_name}</option>
  153. % endfor
  154. </select>
  155. </div>
  156. </%def>
  157. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  158. ## Wrapper pour la form Itineraire
  159. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  160. <%def name="itin_wrapper(itin_form)">
  161. <div style="padding:5px;">
  162. <div style="float:left;padding-right:5px;">
  163. <label for="${itin_form.start_place.label.field_id}">
  164. ${itin_form.start_place.label}
  165. </label>
  166. % for error in itin_form.start_place.errors:
  167. <div class="alert error">Le Depart ${ error }</div>
  168. % endfor
  169. ${itin_form.start_place(style='width:17em;')},
  170. </div>
  171. <div>
  172. <label for="${itin_form.arrival_place.label.field_id}">
  173. ${itin_form.arrival_place.label}
  174. </label>
  175. % for error in itin_form.arrival_place.errors:
  176. <div class="alert error">Arrivee ${ error }</div>
  177. % endfor
  178. ${itin_form.arrival_place(style='width:17em;')}
  179. </div>
  180. <div style="padding:5px;">
  181. <small style="color:#999">Si je n´ai pas trouvé le lieu dont j´ai besoin dans ces listes...</small>
  182. <br />
  183. <small style="color:#999">Je peux </small>
  184. <a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/${CurrentYear}/modal/Place/0');">
  185. <i class="icon-plus-sign icon-white"></i> Ajouter un lieu
  186. </a>
  187. </div>
  188. </div>
  189. <script>
  190. $("#${itin_form.start_place.label.field_id}").select2({});
  191. $("#${itin_form.arrival_place.label.field_id}").select2({});
  192. </script>
  193. </%def> \
  194. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  195. ## Wrapper pour afficher les fichiers
  196. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  197. <%def name="medias(Entity, UID=None, desc=None)"> \
  198. <hr>
  199. <ul class="thumbnails">
  200. % for filelink, thumb in Entity.DocLinks:
  201. <li class="span2">
  202. <div class="media">
  203. <a class="pull-left" href="${filelink}">
  204. <img class="media-object" src="${thumb}" alt="Fichier media" />
  205. </a>
  206. </div>
  207. </li>
  208. % endfor
  209. </ul>
  210. </%def>
  211. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  212. ## Wrapper pour uploader
  213. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  214. <%def name="uploader(MediaType, UID, desc=None, disp_only=False)"> \
  215. <!-- The file upload form used as target for the file upload widget -->
  216. % if disp_only:
  217. <form class="fileupload" id="fileupload_${MediaType}_${UID}" action="/uploader/_${MediaType}/${UID}/proceed" method="POST" enctype="multipart/form-data">
  218. % else:
  219. <form class="fileupload" id="fileupload_${MediaType}_${UID}" action="/uploader/${MediaType}/${UID}/proceed" method="POST" enctype="multipart/form-data">
  220. % endif
  221. <!-- Redirect browsers with JavaScript disabled to the origin page -->
  222. <noscript><input type="hidden" name="redirect" value="/"></noscript>
  223. <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
  224. <div class="fileupload-buttonbar" ${["","style=display:none"][disp_only]}>
  225. <!-- The fileinput-button span is used to style the file input field as button -->
  226. <span class="btn btn-success fileinput-button">
  227. <i class="icon-plus icon-white"></i>
  228. % if desc:
  229. <span>Ajouter ${desc}</span>
  230. % else:
  231. <span>Ajouter</span>
  232. % endif:
  233. <input type="file" name="files[]" multiple>
  234. </span>
  235. <!-- The global file processing state -->
  236. <span class="fileupload-process"></span>
  237. <!-- The global progress state -->
  238. <div class="fileupload-progress fade" style="float:right;">
  239. <!-- The global progress bar -->
  240. <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
  241. <div class="bar progress-bar progress-bar-success" style="width:0%;"></div>
  242. </div>
  243. <!-- The extended global progress state -->
  244. <div class="progress-extended">&nbsp;</div>
  245. </div>
  246. </div>
  247. <!-- The table listing the files available for upload/download -->
  248. <table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
  249. </form>
  250. </%def> \
  251. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  252. ## Wrapper pour uploader - Partie JavaScript
  253. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  254. <%def name="uploader_js()"> \
  255. <!-- The template to display files available for upload -->
  256. <script id="template-upload" type="text/x-tmpl">
  257. {% for (var i=0, file; file=o.files[i]; i++) { %}
  258. <tr class="template-upload fade">
  259. <td style="width: 80px;">
  260. <span class="preview"></span>
  261. </td>
  262. <td>
  263. <p class="name">{%=file.name%}</p>
  264. <strong class="error text-danger"></strong>
  265. <p class="size">Processing...</p>
  266. <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar progress-bar progress-bar-success" style="width:0%;"></div></div>
  267. </td>
  268. <td style="width: 85px;">
  269. {% if (!i && !o.options.autoUpload) { %}
  270. <button class="btn-mini btn-primary start" disabled style="width: 80px;">
  271. <i class="icon-upload icon-white"></i>
  272. <span>Upload</span>
  273. </button>
  274. {% } %}
  275. {% if (!i) { %}
  276. <button class="btn-mini btn-warning cancel" style="width: 80px;">
  277. <i class="icon-ban-circle icon-white"></i>
  278. <span>Annuler</span>
  279. </button>
  280. {% } %}
  281. </td>
  282. </tr>
  283. {% } %}
  284. </script>
  285. <!-- The template to display files available for download -->
  286. <script id="template-download" type="text/x-tmpl">
  287. {% for (var i=0, file; file=o.files[i]; i++) { %}
  288. <tr class="template-download fade">
  289. <td style="width: 80px;">
  290. <span class="preview">
  291. {% if (file.thumbnailUrl) { %}
  292. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}" alt="{%=file.name%}"></a>
  293. {% } %}
  294. </span>
  295. </td>
  296. <td>
  297. <p class="name">
  298. {% if (file.url) { %}
  299. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
  300. {% } else { %}
  301. <span>{%=file.name%}</span>
  302. {% } %}
  303. </p>
  304. <p><span class="size">{%=o.formatFileSize(file.size)%}</span></p>
  305. {% if (file.error) { %}
  306. <div><span class="label label-danger">Erreur</span> {%=file.error%}</div>
  307. {% } %}
  308. </td>
  309. <td style="width: 85px;">
  310. {% if (file.deleteUrl) { %}
  311. <button class="btn-mini btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
  312. <i class="icon-trash icon-white"></i>
  313. <span>Suppr.</span>
  314. </button>
  315. <input type="checkbox" name="delete" value="1" class="toggle">
  316. {% } else { %}
  317. <button class="btn-mini btn-warning cancel">
  318. <i class="icon-ban-circle icon-white"></i>
  319. <span>Annuler</span>
  320. </button>
  321. {% } %}
  322. </td>
  323. </tr>
  324. {% } %}
  325. </script>
  326. </%def> \
  327. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  328. ## Wrapper pour les intervention utilisateur
  329. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  330. <%def name="show_Interventions(ListEvent, HeadTitle=None, NotFoundTitle=None)"> \
  331. <table class="table table-striped table-bordered table-hover">
  332. <thead>
  333. <tr>
  334. <th style="width:6em;text-align:center;">Date</th>
  335. % if HeadTitle:
  336. <th style="text-align:center;">${HeadTitle}</th>
  337. % else:
  338. <th style="text-align:center;">L'historique des interventions</th>
  339. % endif
  340. </tr>
  341. </thead>
  342. <tbody>
  343. % if len(ListEvent)==0:
  344. <tr>
  345. <td style="text-align:center;" colspan="2">
  346. % if NotFoundTitle:
  347. <i>${NotFoundTitle | h}</i>
  348. % else:
  349. <i>Désolé;, Il n'y a rien dans l'historique.</i>
  350. % endif
  351. </td>
  352. </tr>
  353. % else:
  354. % for event in ListEvent:
  355. <tr>
  356. <td style="text-align:center;">
  357. <%
  358. start = event.start_time.time()
  359. end = event.end_time.time()
  360. vid = event.video.first()
  361. pres = event.presentation.first()
  362. %>
  363. ${event.start_time.strftime('%d %b %Y')}
  364. ${start.hour}:${"%.2d" % start.minute}-${end.hour}:${"%.2d" % end.minute}
  365. </td>
  366. <td style="position: relative;">${event.event_type}:
  367. <strong>
  368. <a href="/event/${event.for_year}/${event.slug}">${event.name}</a>
  369. </strong>
  370. <span style="float:right;">
  371. % if vid:
  372. <a href="${vid.get_path}">
  373. <i class="icon-film"></i>
  374. </a>
  375. % endif
  376. % if pres:
  377. <a href="${pres.get_path}">
  378. <i class="icon-list-alt"></i>
  379. </a>
  380. % endif
  381. </span>
  382. % if event.Salle:
  383. <div style="position: absolute; bottom: 2px; right: 5px;">
  384. ${event.Salle.name}
  385. </div>
  386. % endif
  387. <br/>
  388. % if len(event.intervenants)>1:
  389. avec
  390. % for num, inter in enumerate(event.intervenants):
  391. <%
  392. if inter==uprofil:
  393. continue
  394. %>
  395. <a href="/user/${inter.slug}">${inter.prenom} ${inter.nom}</a>,
  396. % endfor
  397. % endif
  398. </td>
  399. </tr>
  400. % endfor
  401. % endif
  402. </tbody>
  403. </table>
  404. </%def>
  405. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  406. ## Wrapper pour les badges des entités utilisateur
  407. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  408. <%def name="show_SummaryEntities(ListEntities, callback=None)"> \
  409. <ul class="thumbnails">
  410. % for tiers in ListEntities:
  411. <% Entity = tiers.get_entity_type %>
  412. <li class="span3 tiers">
  413. <div class="media">
  414. % if callback:
  415. ${callback(tiers)}
  416. % endif
  417. <a class="pull-left" href="/entity/${Entity.entity_type}/${tiers.slug}">
  418. % if tiers.ThumbLinks:
  419. <img class="media-object" src="${tiers.ThumbLinks.pop()}" alt="${tiers.slug}" />
  420. % else:
  421. <img class="media-object" src="/img/no-image-thumb.jpg" alt="no-image" />
  422. % endif
  423. </a>
  424. <div class="media-body">
  425. %if Entity.entity_subtype!=Entity.entity_type:
  426. <h5 style="margin:0">${Entity.entity_type} ${Entity.entity_subtype}</h5>
  427. %else:
  428. <h5 style="margin:0">${Entity.entity_type}</h5>
  429. %endif
  430. <a href="/entity/${Entity.entity_type}/${tiers.slug}">
  431. <h4 class="media-heading">${tiers.name}</h4>
  432. </a>
  433. % if Entity.entity_role:
  434. <span><i>${Entity.entity_role}</i></span>
  435. % endif
  436. </div>
  437. </div>
  438. </li>
  439. % endfor
  440. </ul>
  441. </%def>
  442. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  443. ## Wrapper pour les photos
  444. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  445. <%def name="show_my_pictures(uprofil)"> \
  446. <div class="profile-icon">
  447. <% photos = uprofil.PhotosLinks %>
  448. <div style="text-align: center;line-height:20px;"><b>${request.user.slug}</b></div>
  449. <div style="text-align: center;line-height:20px;">
  450. <a data-target="#AjaxModal" Myhref="/${CurrentYear}/modal/Password/1" role="button" handle="modal">Changer mon mot de passe</a>
  451. </div>
  452. <div id="MyPictureCarousel" class="carousel slide">
  453. % if len(photos)>1:
  454. <!-- Carousel nav -->
  455. <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
  456. <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
  457. % endif
  458. <!-- Carousel items -->
  459. <div class="carousel-inner">
  460. % if len(photos):
  461. % for num, link in enumerate(photos):
  462. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  463. <div style="margin:auto;text-align:center;">
  464. <img src="${link}" class="img-polaroid" style="max-height:310px;" alt="Photo ${uprofil.slug}" />
  465. </div>
  466. </div>
  467. % endfor
  468. % else:
  469. <div class="active item" id="UserPic0">
  470. <div style="margin:auto;text-align:center;">
  471. <img src="/img/default-user.png" style="max-height:310px;" class="img-polaroid" alt="Photo ${uprofil.slug}" />
  472. </div>
  473. </div>
  474. % endif
  475. </div>
  476. </div>
  477. <div style="text-align: center;line-height:20px;">
  478. <a data-target="#AjaxModal" Myhref="/${CurrentYear}/modal/UserPicture/${uprofil.uid}" handle="modal">Changer ma photo</a>
  479. </div>
  480. </div>
  481. </%def> \
  482. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  483. <%def name="show_pictures(uprofil)"> \
  484. <div class="profile-icon pull-right">
  485. <% photos = uprofil.PhotosLinks %>
  486. <div id="MyPictureCarousel-${uprofil.uid}" class="carousel slide">
  487. % if len(photos)>1:
  488. <!-- Carousel nav -->
  489. <a class="Ucarousel-control left" href="#MyPictureCarousel-${uprofil.uid}" data-slide="prev">&lsaquo;</a>
  490. <a class="Ucarousel-control right" href="#MyPictureCarousel-${uprofil.uid}" data-slide="next">&rsaquo;</a>
  491. % endif
  492. <!-- Carousel items -->
  493. <div class="carousel-inner" style="height: 220px;">
  494. % if len(photos):
  495. % for num, link in enumerate(photos):
  496. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  497. <div style="margin:auto;">
  498. <img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${uprofil.nom} ${uprofil.prenom}" />
  499. </div>
  500. </div>
  501. % endfor
  502. % else:
  503. <div class="active item" id="UserPic0">
  504. <div style="margin:auto;width:170px;">
  505. <img src="/img/default-user.png" class="img-polaroid" alt="Photo ${uprofil.nom} ${uprofil.prenom}" style="max-height:205px;" />
  506. </div>
  507. </div>
  508. % endif
  509. </div>
  510. </div>
  511. </div>
  512. </%def> \
  513. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  514. <%def name="show_salles(Salles, IdSalle)"> \
  515. <div class="profile-icon pull-right" style="padding: 0 15px;">
  516. <%
  517. if not IdSalle:
  518. return ""
  519. SallePhy = Salles.by_id(IdSalle).phy
  520. if not SallePhy:
  521. return ""
  522. photos = SallePhy.PhotosLinks
  523. %>
  524. <div id="CarName" style="text-align: center;line-height:20px;"><strong>Salle</strong>: ${Salles.by_id(IdSalle).name}</div>
  525. <div id="MyPictureCarousel" class="carousel slide">
  526. % if len(photos)>1:
  527. <!-- Carousel nav -->
  528. <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
  529. <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
  530. % endif
  531. <!-- Carousel items -->
  532. <div class="carousel-inner">
  533. % if len(photos):
  534. % for num, link in enumerate(photos):
  535. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  536. <div style="margin:auto;">
  537. <img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${SallePhy.name}" />
  538. </div>
  539. </div>
  540. % endfor
  541. % else:
  542. <div class="active item" id="UserPic0">
  543. <div class="center" style="margin:auto;width:170px;">
  544. <img src="/img/no-image.jpg" class="img-polaroid" alt="Photo ${SallePhy.name}" style="max-height:130px;" />
  545. </div>
  546. </div>
  547. % endif
  548. </div>
  549. </div>
  550. </div>
  551. </%def> \
  552. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  553. <%def name="show_salles_phy(SallePhy)"> \
  554. <div class="profile-icon text-center" style="padding: 0 15px;">
  555. <%
  556. photos = SallePhy.PhotosLinks
  557. %>
  558. <div id="CarName${SallePhy.uid}" style="text-align: center;line-height:20px;"><strong>${len(photos)} Photo(s)</strong></div>
  559. <div id="MyPictureCarousel${SallePhy.uid}" class="carousel slide">
  560. % if len(photos)>1:
  561. <!-- Carousel nav -->
  562. <a class="Ucarousel-control left" href="#MyPictureCarousel${SallePhy.uid}" data-slide="prev">&lsaquo;</a>
  563. <a class="Ucarousel-control right" href="#MyPictureCarousel${SallePhy.uid}" data-slide="next">&rsaquo;</a>
  564. % endif
  565. <!-- Carousel items -->
  566. <div class="carousel-inner">
  567. % if len(photos):
  568. % for num, link in enumerate(photos):
  569. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  570. <div style="margin:auto;">
  571. <img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${SallePhy.name}" />
  572. </div>
  573. </div>
  574. % endfor
  575. % else:
  576. <div class="active item" id="UserPic0">
  577. <div class="center" style="margin:auto;width:170px;">
  578. <img src="/img/no-image.jpg" class="img-polaroid" alt="Photo ${SallePhy.name}" style="max-height:130px;" />
  579. </div>
  580. </div>
  581. % endif
  582. </div>
  583. </div>
  584. </div>
  585. </%def> \
  586. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  587. ## Wrapper pour les photos de l'année
  588. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  589. <%def name="show_photos(photos)"> \
  590. <div class="profile-icon pull-right">
  591. <div id="PhotoCarousel" class="carousel slide">
  592. % if photos and len(photos)>1:
  593. <!-- Carousel nav -->
  594. <a class="Ucarousel-control left" href="#PhotoCarousel" data-slide="prev">&lsaquo;</a>
  595. <a class="Ucarousel-control right" href="#PhotoCarousel" data-slide="next">&rsaquo;</a>
  596. % endif
  597. <!-- Carousel items -->
  598. <div class="carousel-inner" style="height: 220px;">
  599. % if photos and len(photos):
  600. % for num, link in enumerate(photos):
  601. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  602. <div style="margin:auto;">
  603. <img src="${link}" class="img-polaroid" style="max-heights:205px;max-widths:235px;" alt="Photo" />
  604. </div>
  605. </div>
  606. % endfor
  607. % else:
  608. ## <div class="active item" id="UserPic0">
  609. ## <div style="margin:auto;widths:170px;">
  610. ## <img src="/img/default-user.png" class="img-polaroid" alt="Photo ${uprofil.nom} ${uprofil.prenom}" style="max-heights:205px;" />
  611. ## </div>
  612. ## </div>
  613. % endif
  614. </div>
  615. </div>
  616. </div>
  617. </%def> \
  618. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  619. ## Wrapper pour les échanges utilisateurs
  620. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  621. <%def name="show_exchange(Exchange, Asker, Provider)"> \
  622. <div class="media">
  623. % if Asker:
  624. <a class="pull-left" href="/user/${Asker.slug}">
  625. % if Asker.PhotosThumb:
  626. <img class="media-object"
  627. src="${Asker.PhotosThumb.pop()}"
  628. alt="${Asker.prenom} ${Asker.nom}"/>
  629. % else:
  630. <img class="media-object"
  631. src="/img/no-image-thumb.jpg"
  632. alt="${Asker.prenom} ${Asker.nom}"/>
  633. % endif
  634. </a>
  635. % else:
  636. <a class="pull-left" href="#">
  637. <img class="media-object" src="/img/personne.jpg" alt="Personne"/>
  638. </a>
  639. % endif
  640. % if Provider:
  641. <a class="pull-right" href="/user/${Provider.slug}">
  642. % if Provider.PhotosThumb:
  643. <img class="media-object"
  644. src="${Provider.PhotosThumb.pop()}"
  645. alt="${Provider.prenom} ${Provider.nom}"/>
  646. % else:
  647. <img class="media-object"
  648. src="/img/no-image-thumb.jpg"
  649. alt="${Provider.prenom} ${Provider.nom}"/>
  650. % endif
  651. </a>
  652. % else:
  653. <a class="pull-right" href="#">
  654. <img class="media-object" src="/img/personne.jpg" alt="Personne"/>
  655. </a>
  656. %endif
  657. <div class="media-body">
  658. <table style="width:100%">
  659. <tr>
  660. <td style="text-align:left;vertical-align:middle;width:40%">
  661. % if Asker:
  662. Demande de<br>
  663. <a href="/user/${Asker.slug}">${Asker.prenom} ${Asker.nom}</a>
  664. % else:
  665. <i>Pas de réponse</i>
  666. % endif
  667. </td>
  668. <td>
  669. % if Exchange.exch_done:
  670. <img class="media-object" src="/img/echange.png" alt="Echange"/>
  671. % elif Exchange.exch_state=='Ask':
  672. <img class="media-object" src="/img/asker.png" alt="Cherche"/>
  673. % elif Exchange.exch_state=='Proposal':
  674. <img class="media-object" src="/img/provider.png" alt="Propose"/>
  675. % endif
  676. </td>
  677. <td style="text-align:right;vertical-align:middle;width:40%">
  678. %if Provider:
  679. Proposition de<br>
  680. <a href="/user/${Provider.slug}">${Provider.prenom} ${Provider.nom}</a>
  681. % else:
  682. <i>Pas de réponse</i>
  683. % endif
  684. </td>
  685. </tr>
  686. </table>
  687. </div>
  688. </div>
  689. </%def> \
  690. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  691. ## Wrapper pour les addresses pour les utilisateurs
  692. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  693. <%def name="show_address(Place)"> \
  694. <address>
  695. <strong>${Place.display_name}</strong> ( ${Place.place_type} )<br>
  696. ${Place.name}<br>
  697. % if Place.specific:
  698. ${Place.specific}<br>
  699. % endif
  700. ${Place.adresse}<br>
  701. ${Place.codePostal} ${Place.ville}<br>
  702. </address>
  703. </%def> \
  704. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  705. ## Wrapper pour la description des places
  706. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  707. <%def name="show_desc(Place)"> \
  708. % if Place.description:
  709. ${Place.description | n}
  710. % endif
  711. </%def> \
  712. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  713. ## Wrapper pour les sponsors
  714. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  715. <%def name="participants(Year)"> \
  716. <div id='right_panel'>
  717. <table class="ShowEntities table">
  718. <thead>
  719. <tr>
  720. <th colspan="3">Sponsors ${Year}</th>
  721. </tr>
  722. </thead>
  723. <%
  724. import random
  725. num = -1
  726. sponsors = list(request.sponsors(Year))
  727. random.shuffle(sponsors)
  728. exposants = list(request.exposants(Year))
  729. random.shuffle(exposants)
  730. %>
  731. % for entity in sponsors:
  732. % for thumb in entity.ThumbLinks:
  733. <% num+=1 %>
  734. % if (num==0):
  735. <tr>
  736. % elif (num%3==0):
  737. </tr><tr>
  738. % endif
  739. <td>
  740. <a href="/entity/${entity.get_entity_type.entity_type}/${entity.slug}">
  741. <img src="${thumb}" alt="${entity.name}" />
  742. </a>
  743. </td>
  744. % endfor
  745. % endfor
  746. </tr>
  747. </table>
  748. <br />
  749. <table class="ShowEntities table">
  750. <thead>
  751. <tr>
  752. <th colspan="3">Exposants ${Year}</th>
  753. </tr>
  754. </thead>
  755. <% num = -1 %>
  756. % for entity in exposants:
  757. % for thumb in entity.ThumbLinks:
  758. <% num+=1 %>
  759. % if (num==0):
  760. <tr>
  761. % elif (num%3==0):
  762. </tr><tr>
  763. % endif
  764. <td>
  765. <a href="/entity/${entity.get_entity_type.entity_type}/${entity.slug}">
  766. <img src="${thumb}" alt="${entity.name}" />
  767. </a>
  768. </td>
  769. % endfor
  770. % endfor
  771. </tr>
  772. </table>
  773. </div>
  774. </%def> \