Le repo des sources pour le site web des JM2L
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

652 lines
26 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 DicFormat.has_key(Field.name) 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:1px 2px;"></i>
  27. </a>
  28. % endif
  29. </label>
  30. % if DicFormat.has_key(Field.name):
  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 DicFormat.has_key(Field.name) 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 DicFormat.has_key(Field.name) 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 DicFormat.has_key(Field.name) and DicFormat[Field.name].get("fieldset"):
  82. <fieldset>
  83. <legend>${Field.label.text}</legend>
  84. % else:
  85. % if DicFormat.has_key(Field.name) 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 DicFormat.has_key(Field.name):
  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 DicFormat.has_key(Field.name) 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('/2015/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}" />
  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)"> \
  215. <!-- The file upload form used as target for the file upload widget -->
  216. <form class="fileupload" id="fileupload_${MediaType}" action="/uploader/${MediaType}/${UID}/proceed" method="POST" enctype="multipart/form-data">
  217. <!-- Redirect browsers with JavaScript disabled to the origin page -->
  218. <noscript><input type="hidden" name="redirect" value="/"></noscript>
  219. <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
  220. <div class="fileupload-buttonbar">
  221. <!-- The fileinput-button span is used to style the file input field as button -->
  222. <span class="btn btn-success fileinput-button">
  223. <i class="icon-plus icon-white"></i>
  224. % if desc:
  225. <span>Ajouter ${desc}</span>
  226. % else:
  227. <span>Ajouter</span>
  228. % endif:
  229. <input type="file" name="files[]" multiple>
  230. </span>
  231. <!-- The global file processing state -->
  232. <span class="fileupload-process"></span>
  233. <!-- The global progress state -->
  234. <div class="fileupload-progress fade" style="float:right;">
  235. <!-- The global progress bar -->
  236. <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
  237. <div class="bar progress-bar progress-bar-success" style="width:0%;"></div>
  238. </div>
  239. <!-- The extended global progress state -->
  240. <div class="progress-extended">&nbsp;</div>
  241. </div>
  242. </div>
  243. <!-- The table listing the files available for upload/download -->
  244. <table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
  245. </form>
  246. </%def> \
  247. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  248. ## Wrapper pour uploader - Partie JavaScript
  249. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  250. <%def name="uploader_js()"> \
  251. <!-- The template to display files available for upload -->
  252. <script id="template-upload" type="text/x-tmpl">
  253. {% for (var i=0, file; file=o.files[i]; i++) { %}
  254. <tr class="template-upload fade">
  255. <td style="width: 80px;">
  256. <span class="preview"></span>
  257. </td>
  258. <td>
  259. <p class="name">{%=file.name%}</p>
  260. <strong class="error text-danger"></strong>
  261. <p class="size">Processing...</p>
  262. <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>
  263. </td>
  264. <td style="width: 85px;">
  265. {% if (!i && !o.options.autoUpload) { %}
  266. <button class="btn-mini btn-primary start" disabled style="width: 80px;">
  267. <i class="icon-upload icon-white"></i>
  268. <span>Upload</span>
  269. </button>
  270. {% } %}
  271. {% if (!i) { %}
  272. <button class="btn-mini btn-warning cancel" style="width: 80px;">
  273. <i class="icon-ban-circle icon-white"></i>
  274. <span>Annuler</span>
  275. </button>
  276. {% } %}
  277. </td>
  278. </tr>
  279. {% } %}
  280. </script>
  281. <!-- The template to display files available for download -->
  282. <script id="template-download" type="text/x-tmpl">
  283. {% for (var i=0, file; file=o.files[i]; i++) { %}
  284. <tr class="template-download fade">
  285. <td style="width: 80px;">
  286. <span class="preview">
  287. {% if (file.thumbnailUrl) { %}
  288. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
  289. {% } %}
  290. </span>
  291. </td>
  292. <td>
  293. <p class="name">
  294. {% if (file.url) { %}
  295. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
  296. {% } else { %}
  297. <span>{%=file.name%}</span>
  298. {% } %}
  299. </p>
  300. <p><span class="size">{%=o.formatFileSize(file.size)%}</span></p>
  301. {% if (file.error) { %}
  302. <div><span class="label label-danger">Erreur</span> {%=file.error%}</div>
  303. {% } %}
  304. </td>
  305. <td style="width: 85px;">
  306. {% if (file.deleteUrl) { %}
  307. <button class="btn-mini btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
  308. <i class="icon-trash icon-white"></i>
  309. <span>Suppr.</span>
  310. </button>
  311. <input type="checkbox" name="delete" value="1" class="toggle">
  312. {% } else { %}
  313. <button class="btn-mini btn-warning cancel">
  314. <i class="icon-ban-circle icon-white"></i>
  315. <span>Annuler</span>
  316. </button>
  317. {% } %}
  318. </td>
  319. </tr>
  320. {% } %}
  321. </script>
  322. </%def> \
  323. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  324. ## Wrapper pour les intervention utilisateur
  325. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  326. <%def name="show_Interventions(ListEvent, HeadTitle=None, NotFoundTitle=None)"> \
  327. <table class="table table-striped table-bordered table-hover">
  328. <tr>
  329. <th style="width:6em;text-align:center;">Date</th>
  330. % if HeadTitle:
  331. <th style="text-align:center;">${HeadTitle}</th>
  332. % else:
  333. <th style="text-align:center;">L'historique des interventions</th>
  334. % endif
  335. </tr>
  336. % if len(ListEvent)==0:
  337. <tr>
  338. <td style="text-align:center;" colspan="2">
  339. % if NotFoundTitle:
  340. <i>${NotFoundTitle}</i>
  341. % else:
  342. <i>Désolé, Il n'y a rien dans l'historique.</i>
  343. % endif
  344. </td>
  345. </tr>
  346. % else:
  347. % for event in ListEvent:
  348. <tr>
  349. <td style="text-align:center;">
  350. <%
  351. start = event.start_time.time()
  352. end = event.end_time.time()
  353. vid = event.video.first()
  354. pres = event.presentation.first()
  355. %>
  356. ${event.start_time.strftime('%d %b %Y').decode('utf-8')}
  357. ${start.hour}:${"%.2d" % start.minute}-${end.hour}:${"%.2d" % end.minute}
  358. </td>
  359. <td style="position: relative;">${event.event_type}:
  360. <strong>
  361. <a href="/event/${event.for_year}/${event.slug}">${event.name}</a>
  362. </strong>
  363. <span style="float:right;">
  364. % if vid:
  365. <a href="${vid.get_path}">
  366. <i class="icon-film"></i>
  367. </a>
  368. % endif
  369. % if pres:
  370. <a href="${pres.get_path}">
  371. <i class="icon-list-alt"></i>
  372. </a>
  373. % endif
  374. </span>
  375. % if event.Salle:
  376. <div style="position: absolute; bottom: 2px; right: 5px;">
  377. ${event.Salle.name}
  378. </div>
  379. % endif
  380. <br/>
  381. % if event.intervenants.count()>1:
  382. avec
  383. % for num, inter in enumerate(event.intervenants.all()):
  384. <%
  385. if inter==uprofil:
  386. continue
  387. %>
  388. <a href="/user/${inter.slug}">${inter.prenom} ${inter.nom}</a>,
  389. % endfor
  390. % endif
  391. </td>
  392. </tr>
  393. % endfor
  394. % endif
  395. </table>
  396. </%def>
  397. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  398. ## Wrapper pour les badges des entités utilisateur
  399. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  400. <%def name="show_SummaryEntities(ListEntities)"> \
  401. <ul class="thumbnails">
  402. % for tiers in ListEntities:
  403. <% Entity = tiers.get_entity_type %>
  404. <li class="span3 tiers">
  405. <div class="media">
  406. <a class="pull-left" href="/entity/${Entity.entity_type}/${tiers.slug}">
  407. % if tiers.ThumbLinks:
  408. <img class="media-object" src="${tiers.ThumbLinks.pop()}" />
  409. % else:
  410. <img class="media-object" src="/img/no-image-thumb.jpg" />
  411. % endif
  412. </a>
  413. <div class="media-body">
  414. %if Entity.entity_subtype!=Entity.entity_type:
  415. <h5 style="margin:0">${Entity.entity_type} ${Entity.entity_subtype}</h5>
  416. %else:
  417. <h5 style="margin:0">${Entity.entity_type}</h5>
  418. %endif
  419. <a href="/entity/${Entity.entity_type}/${tiers.slug}">
  420. <h4 class="media-heading">${tiers.name}</h4>
  421. </a>
  422. % if Entity.entity_role:
  423. <span><i>${Entity.entity_role}</i></span>
  424. % endif
  425. </div>
  426. </div>
  427. </li>
  428. % endfor
  429. </ul>
  430. </%def>
  431. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  432. ## Wrapper pour les photos
  433. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  434. <%def name="show_my_pictures(uprofil)"> \
  435. <div class="profile-icon">
  436. <% photos = uprofil.PhotosLinks %>
  437. <div style="text-align: center;line-height:20px;"><b>${request.user.slug}</b></div>
  438. <div style="text-align: center;line-height:20px;">
  439. <a data-target="#AjaxModal" Myhref="/2015/modal/Password/1" role="button" handle="modal">Changer mon mot de passe</a>
  440. </div>
  441. <div id="MyPictureCarousel" class="carousel slide">
  442. % if len(photos)>1:
  443. <!-- Carousel nav -->
  444. <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
  445. <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
  446. % endif
  447. <!-- Carousel items -->
  448. <div class="carousel-inner">
  449. % if len(photos):
  450. % for num, link in enumerate(photos):
  451. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  452. <div style="margin:auto;text-align:center;">
  453. <img src="${link}" class="img-polaroid" style="max-height:310px;" alt="Photo ${uprofil.slug}" />
  454. </div>
  455. </div>
  456. % endfor
  457. % else:
  458. <div class="active item" id="UserPic0">
  459. <div style="margin:auto;text-align:center;">
  460. <img src="/img/default-user.png" style="max-height:310px;" class="img-polaroid" alt="Photo ${uprofil.slug}" />
  461. </div>
  462. </div>
  463. % endif
  464. </div>
  465. </div>
  466. <div style="text-align: center;line-height:20px;">
  467. <a data-target="#AjaxModal" Myhref="/2015/modal/UserPicture/${uprofil.uid}" handle="modal">Changer ma photo</a>
  468. </div>
  469. </div>
  470. </%def> \
  471. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  472. <%def name="show_pictures(uprofil)"> \
  473. <div class="profile-icon pull-right">
  474. <% photos = uprofil.PhotosLinks %>
  475. <div id="MyPictureCarousel" class="carousel slide">
  476. % if len(photos)>1:
  477. <!-- Carousel nav -->
  478. <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
  479. <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
  480. % endif
  481. <!-- Carousel items -->
  482. <div class="carousel-inner" style="height: 220px;">
  483. % if len(photos):
  484. % for num, link in enumerate(photos):
  485. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  486. <div style="margin:auto;">
  487. <img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${uprofil.nom} ${uprofil.prenom}" />
  488. </div>
  489. </div>
  490. % endfor
  491. % else:
  492. <div class="active item" id="UserPic0">
  493. <div style="margin:auto;width:170px;">
  494. <img src="/img/default-user.png" class="img-polaroid" alt="Photo ${uprofil.nom} ${uprofil.prenom}" style="max-height:205px;" />
  495. </div>
  496. </div>
  497. % endif
  498. </div>
  499. </div>
  500. </div>
  501. </%def> \
  502. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  503. ## Wrapper pour les échanges utilisateurs
  504. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  505. <%def name="show_exchange(Exchange, Asker, Provider)"> \
  506. <div class="media">
  507. % if Asker:
  508. <a class="pull-left" href="/user/${Asker.slug}">
  509. % if Asker.PhotosThumb:
  510. <img class="media-object"
  511. src="${Asker.PhotosThumb.pop()}"
  512. alt="${Asker.prenom} ${Asker.nom}"/>
  513. % else:
  514. <img class="media-object"
  515. src="/img/no-image-thumb.jpg"
  516. alt="${Asker.prenom} ${Asker.nom}"/>
  517. % endif
  518. </a>
  519. % else:
  520. <a class="pull-left" href="#">
  521. <img class="media-object" src="/img/personne.jpg" alt="Personne"/>
  522. </a>
  523. % endif
  524. % if Provider:
  525. <a class="pull-right" href="/user/${Provider.slug}">
  526. % if Provider.PhotosThumb:
  527. <img class="media-object"
  528. src="${Provider.PhotosThumb.pop()}"
  529. alt="${Provider.prenom} ${Provider.nom}"/>
  530. % else:
  531. <img class="media-object"
  532. src="/img/no-image-thumb.jpg"
  533. alt="${Provider.prenom} ${Provider.nom}"/>
  534. % endif
  535. </a>
  536. % else:
  537. <a class="pull-right" href="#">
  538. <img class="media-object" src="/img/personne.jpg" alt="Personne"/>
  539. </a>
  540. %endif
  541. <div class="media-body">
  542. <table style="width:100%">
  543. <tr>
  544. <td style="text-align:left;vertical-align:middle;width:40%">
  545. % if Asker:
  546. Demande de<br>
  547. <a href="/user/${Asker.slug}">${Asker.prenom} ${Asker.nom}</a>
  548. % else:
  549. <i>Pas de réponse</i>
  550. % endif
  551. </td>
  552. <td>
  553. % if Exchange.exch_done:
  554. <img class="media-object" src="/img/echange.png" alt="Echange"/>
  555. % elif Exchange.exch_state=='Ask':
  556. <img class="media-object" src="/img/asker.png" alt="Cherche"/>
  557. % elif Exchange.exch_state=='Proposal':
  558. <img class="media-object" src="/img/provider.png" alt="Propose"/>
  559. % endif
  560. </td>
  561. <td style="text-align:right;vertical-align:middle;width:40%">
  562. %if Provider:
  563. Proposition de<br>
  564. <a href="/user/${Provider.slug}">${Provider.prenom} ${Provider.nom}</a>
  565. % else:
  566. <i>Pas de réponse</i>
  567. % endif
  568. </td>
  569. </tr>
  570. </table>
  571. </div>
  572. </div>
  573. </%def> \
  574. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  575. ## Wrapper pour les addresses pour les utilisateurs
  576. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  577. <%def name="show_address(Place)"> \
  578. <address>
  579. <strong>${Place.display_name}</strong> ( ${Place.place_type} )<br>
  580. ${Place.name}<br>
  581. % if Place.specific:
  582. ${Place.specific}<br>
  583. % endif
  584. ${Place.adresse}<br>
  585. ${Place.codePostal} ${Place.ville}<br>
  586. </address>
  587. </%def> \
  588. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  589. ## Wrapper pour la description des places
  590. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  591. <%def name="show_desc(Place)"> \
  592. % if Place.description:
  593. ${Place.description | n}
  594. % endif
  595. </%def> \
  596. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  597. ## Wrapper pour les sponsors
  598. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  599. <%def name="participants(Year)"> \
  600. <div id='right_panel'>
  601. <table class="ShowEntities table">
  602. <thead>
  603. <th colspan="3">Sponsors ${Year}</th>
  604. </thead>
  605. <tr>
  606. <% num = -1 %>
  607. % for entity in request.sponsors(Year):
  608. % for thumb in entity.ThumbLinks:
  609. <% num+=1 %>
  610. % if (num%3==0):
  611. </tr><tr>
  612. % endif
  613. <td>
  614. <a href="/entity/${entity.get_entity_type.entity_type}/${entity.slug}">
  615. <img src="${thumb}" alt="${entity.name}" />
  616. </a>
  617. </td>
  618. % endfor
  619. % endfor
  620. </tr>
  621. </table>
  622. <br />
  623. <table class="ShowEntities table">
  624. <thead>
  625. <th colspan="3">Exposants ${Year}</th>
  626. </thead>
  627. <tr>
  628. <% num = -1 %>
  629. % for entity in request.exposants(Year):
  630. % for thumb in entity.ThumbLinks:
  631. <% num+=1 %>
  632. % if (num%3==0):
  633. </tr><tr>
  634. % endif
  635. <td>
  636. <a href="/entity/${entity.get_entity_type.entity_type}/${entity.slug}">
  637. <img src="${thumb}" alt="${entity.name}" />
  638. </a>
  639. </td>
  640. % endfor
  641. % endfor
  642. </tr>
  643. </table>
  644. </div>
  645. </%def> \