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.
 
 
 
 
 

559 lines
24 KiB

  1. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. ## Afficher un form
  3. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4. <%def name="DisplayForm(form, DicFormat)">
  5. <%
  6. TabJs = {'select':[], 'desc':[]}
  7. %>
  8. % for FieldName, Field in form._fields.items():
  9. % if DicFormat.has_key(Field.name) and DicFormat[Field.name].get("Ignore"):
  10. <% continue %>
  11. % endif
  12. % if Field.type in ['HiddenField', 'CSRFTokenField']:
  13. ${Field}
  14. <% continue %>
  15. % elif Field.type=="SelectField":
  16. <% TabJs['select'].append(Field.label.field_id) %>
  17. % endif
  18. % if DicFormat.has_key(Field.name) and DicFormat[Field.name].get("fieldset"):
  19. <fieldset>
  20. <legend>${Field.label.text}</legend>
  21. % else:
  22. % if DicFormat.has_key(Field.name) and DicFormat[Field.name].get("ContainerStyle"):
  23. <div style="padding-right:5px;${DicFormat[Field.name].get("ContainerStyle")}">
  24. % else:
  25. <div style="padding-right:5px;">
  26. % endif
  27. <label for="${Field.label.field_id}">${Field.label.text}
  28. % if Field.description:
  29. <% TabJs['desc'].append(Field.label.field_id) %>
  30. <a id="${Field.label.field_id}-help" data-toggle="popover"
  31. data-original-title="${Field.label.text}"
  32. data-content="${Field.description}">
  33. <i class="icon-me" style="background-image: url('/img/Help.png');background-position:1px 2px;"></i>
  34. </a>
  35. % endif
  36. </label>
  37. % endif
  38. % if DicFormat.has_key(Field.name):
  39. <%
  40. PlaceHolder = DicFormat[Field.name].get("PlaceHolder")
  41. FieldStyle = DicFormat[Field.name].get("FieldStyle")
  42. Class = [None,"ckeditor"][ DicFormat[Field.name].has_key("ckeditor") ]
  43. %>
  44. ${Field(placeholder=PlaceHolder, style=FieldStyle, class_=Class)}
  45. % else:
  46. ${Field()}
  47. % endif
  48. % for error in Field.errors:
  49. <div class="alert alert-error">
  50. <button type="button" class="close" data-dismiss="alert">&times;</button>
  51. <h4>Erreur!</h4>
  52. ${ error }
  53. </div>
  54. % endfor
  55. % if DicFormat.has_key(Field.name) and DicFormat[Field.name].get("fieldset"):
  56. </fieldset>
  57. % else:
  58. </div>
  59. % endif
  60. % endfor
  61. <%
  62. for jsitem in TabJs['select']:
  63. context._kwargs['postpone_js'].append( "$('#%s').select2({});" % jsitem )
  64. for jsitem in TabJs['desc']:
  65. context._kwargs['postpone_js'].append( "$('#%s-help').popover();" % jsitem )
  66. %>
  67. </%def>
  68. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  69. ## Wrapper pour la form Sejour
  70. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  71. <%def name="sejour_wrapper(Places)">
  72. <div class="form-inline">
  73. Départ :
  74. <select style="width:12em;" id="Arrival:Place" name="Arrival:Place" title="Lieu">
  75. % for place in Places:
  76. <option value="${place.place_id}">${place.display_name}</option>
  77. % endfor
  78. </select>
  79. </div>
  80. <br />
  81. <div class="form-inline">
  82. Arrivée :
  83. <select style="width:12em;" id="Arrival:Place" name="Arrival:Place" title="Lieu">
  84. % for place in Places:
  85. <option value="${place.place_id}">${place.display_name}</option>
  86. % endfor
  87. </select>
  88. </div>
  89. </%def>
  90. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  91. ## Wrapper pour la form Itineraire
  92. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  93. <%def name="itin_wrapper(itin_form)">
  94. <div style="padding:5px;">
  95. <div style="float:left;padding-right:5px;">
  96. <label for="${itin_form.start_place.label.field_id}">
  97. ${itin_form.start_place.label}
  98. </label>
  99. % for error in itin_form.start_place.errors:
  100. <div class="alert error">Le Depart ${ error }</div>
  101. % endfor
  102. ${itin_form.start_place(style='width:17em;')},
  103. </div>
  104. <div>
  105. <label for="${itin_form.arrival_place.label.field_id}">
  106. ${itin_form.arrival_place.label}
  107. </label>
  108. % for error in itin_form.arrival_place.errors:
  109. <div class="alert error">Arrivee ${ error }</div>
  110. % endfor
  111. ${itin_form.arrival_place(style='width:17em;')}
  112. </div>
  113. <div style="padding:5px;">
  114. <small style="color:#999">Si je n´ai pas trouvé le lieu dont j´ai besoin dans ces listes...</small>
  115. <br />
  116. <small style="color:#999">Je peux </small>
  117. <a class="btn btn-mini btn-info" role="button" href="javascript:DoGetLieu('/2015/modal/Place/0');">
  118. <i class="icon-plus-sign icon-white"></i> Ajouter un lieu
  119. </a>
  120. </div>
  121. </div>
  122. <script>
  123. $("#${itin_form.start_place.label.field_id}").select2({});
  124. $("#${itin_form.arrival_place.label.field_id}").select2({});
  125. </script>
  126. </%def> \
  127. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  128. ## Wrapper pour afficher les fichiers
  129. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  130. <%def name="medias(MediaType, UID, desc=None)"> \
  131. </%def>
  132. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  133. ## Wrapper pour uploader
  134. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  135. <%def name="uploader(MediaType, UID, desc=None)"> \
  136. <!-- The file upload form used as target for the file upload widget -->
  137. <form class="fileupload" id="fileupload_${MediaType}" action="/uploader/${MediaType}/${UID}/proceed" method="POST" enctype="multipart/form-data">
  138. <!-- Redirect browsers with JavaScript disabled to the origin page -->
  139. <noscript><input type="hidden" name="redirect" value="/"></noscript>
  140. <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
  141. <div class="fileupload-buttonbar">
  142. <!-- The fileinput-button span is used to style the file input field as button -->
  143. <span class="btn btn-success fileinput-button">
  144. <i class="icon-plus icon-white"></i>
  145. % if desc:
  146. <span>Ajouter ${desc}</span>
  147. % else:
  148. <span>Ajouter</span>
  149. % endif:
  150. <input type="file" name="files[]" multiple>
  151. </span>
  152. <!-- The global file processing state -->
  153. <span class="fileupload-process"></span>
  154. <!-- The global progress state -->
  155. <div class="fileupload-progress fade" style="float:right;">
  156. <!-- The global progress bar -->
  157. <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
  158. <div class="bar progress-bar progress-bar-success" style="width:0%;"></div>
  159. </div>
  160. <!-- The extended global progress state -->
  161. <div class="progress-extended">&nbsp;</div>
  162. </div>
  163. </div>
  164. <!-- The table listing the files available for upload/download -->
  165. <table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
  166. </form>
  167. </%def> \
  168. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  169. ## Wrapper pour uploader - Partie JavaScript
  170. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  171. <%def name="uploader_js()"> \
  172. <!-- The template to display files available for upload -->
  173. <script id="template-upload" type="text/x-tmpl">
  174. {% for (var i=0, file; file=o.files[i]; i++) { %}
  175. <tr class="template-upload fade">
  176. <td style="width: 80px;">
  177. <span class="preview"></span>
  178. </td>
  179. <td>
  180. <p class="name">{%=file.name%}</p>
  181. <strong class="error text-danger"></strong>
  182. <p class="size">Processing...</p>
  183. <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>
  184. </td>
  185. <td style="width: 85px;">
  186. {% if (!i && !o.options.autoUpload) { %}
  187. <button class="btn-mini btn-primary start" disabled style="width: 80px;">
  188. <i class="icon-upload icon-white"></i>
  189. <span>Upload</span>
  190. </button>
  191. {% } %}
  192. {% if (!i) { %}
  193. <button class="btn-mini btn-warning cancel" style="width: 80px;">
  194. <i class="icon-ban-circle icon-white"></i>
  195. <span>Annuler</span>
  196. </button>
  197. {% } %}
  198. </td>
  199. </tr>
  200. {% } %}
  201. </script>
  202. <!-- The template to display files available for download -->
  203. <script id="template-download" type="text/x-tmpl">
  204. {% for (var i=0, file; file=o.files[i]; i++) { %}
  205. <tr class="template-download fade">
  206. <td style="width: 80px;">
  207. <span class="preview">
  208. {% if (file.thumbnailUrl) { %}
  209. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
  210. {% } %}
  211. </span>
  212. </td>
  213. <td>
  214. <p class="name">
  215. {% if (file.url) { %}
  216. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
  217. {% } else { %}
  218. <span>{%=file.name%}</span>
  219. {% } %}
  220. </p>
  221. <p><span class="size">{%=o.formatFileSize(file.size)%}</span></p>
  222. {% if (file.error) { %}
  223. <div><span class="label label-danger">Erreur</span> {%=file.error%}</div>
  224. {% } %}
  225. </td>
  226. <td style="width: 85px;">
  227. {% if (file.deleteUrl) { %}
  228. <button class="btn-mini btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
  229. <i class="icon-trash icon-white"></i>
  230. <span>Suppr.</span>
  231. </button>
  232. <input type="checkbox" name="delete" value="1" class="toggle">
  233. {% } else { %}
  234. <button class="btn-mini btn-warning cancel">
  235. <i class="icon-ban-circle icon-white"></i>
  236. <span>Annuler</span>
  237. </button>
  238. {% } %}
  239. </td>
  240. </tr>
  241. {% } %}
  242. </script>
  243. %if 1:
  244. ##<script src="/vendor/fileupload/js/jquery-uploader.min.js"></script>
  245. ##<script src="/js/main.js"></script>
  246. plop
  247. % else:
  248. <script src="/static/jquery.min.js"></script>
  249. <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
  250. <script src="/static/js/vendor/jquery.ui.widget.js"></script>
  251. <!-- The Templates plugin is included to render the upload/download listings -->
  252. <script src="/static/js/tmpl.min.js"></script>
  253. <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
  254. <script src="/static/js/load-image.all.min.js"></script>
  255. <!-- The Canvas to Blob plugin is included for image resizing functionality -->
  256. <script src="/static/js/canvas-to-blob.min.js"></script>
  257. <!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
  258. <script src="/static/bootstrap.min.js"></script>
  259. <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
  260. <script src="/static/js/jquery.iframe-transport.js"></script>
  261. <!-- The basic File Upload plugin -->
  262. <script src="/static/js/jquery.fileupload.js"></script>
  263. <!-- The File Upload processing plugin -->
  264. <script src="/static/js/jquery.fileupload-process.js"></script>
  265. <!-- The File Upload image preview & resize plugin -->
  266. <script src="/static/js/jquery.fileupload-image.js"></script>
  267. <!-- The File Upload audio preview plugin -->
  268. <script src="/static/js/jquery.fileupload-audio.js"></script>
  269. <!-- The File Upload video preview plugin -->
  270. <script src="/static/js/jquery.fileupload-video.js"></script>
  271. <!-- The File Upload validation plugin -->
  272. <script src="/static/js/jquery.fileupload-validate.js"></script>
  273. <!-- The File Upload user interface plugin -->
  274. <script src="/static/js/jquery.fileupload-ui.js"></script>
  275. <!-- The main application script -->
  276. <script src="/static/js/main.js"></script>
  277. <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
  278. <!--[if (gte IE 8)&(lt IE 10)]>
  279. <script src="/static/js/cors/jquery.xdr-transport.js"></script>
  280. <![endif]-->
  281. % endif
  282. </%def> \
  283. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  284. ## Wrapper pour les intervention utilisateur
  285. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  286. <%def name="show_Interventions(ListEvent, HeadTitle=None, NotFoundTitle=None)"> \
  287. <table width="100%" class="table table-striped table-bordered table-hover">
  288. <tr>
  289. <th style="width:6em;text-align:center;">Date</th>
  290. % if HeadTitle:
  291. <th style="text-align:center;">${HeadTitle}</th>
  292. % else:
  293. <th style="text-align:center;">L'historique des interventions</th>
  294. % endif
  295. </tr>
  296. % if len(ListEvent)==0:
  297. <tr>
  298. <td style="text-align:center;" colspan="2">
  299. % if NotFoundTitle:
  300. <i>${NotFoundTitle}</i>
  301. % else:
  302. <i>Désolé, Il n'y a rien dans l'historique.</i>
  303. % endif
  304. </td>
  305. </tr>
  306. % else:
  307. % for event in ListEvent:
  308. <tr>
  309. <td style="text-align:center;">
  310. <%
  311. start = event.start_time.time()
  312. end = event.end_time.time()
  313. vid = event.video.first()
  314. pres = event.presentation.first()
  315. %>
  316. ${event.start_time.strftime('%d %b %Y').decode('utf-8')}
  317. ${start.hour}:${"%.2d" % start.minute}-${end.hour}:${"%.2d" % end.minute}
  318. </td>
  319. <td style="position: relative;">${event.event_type}:
  320. <strong>
  321. <a href="/event/${event.for_year}/${event.slug}">${event.name}</a>
  322. </strong>
  323. <span style="float:right;">
  324. % if vid:
  325. <a href="${vid.get_path}">
  326. <i class="icon-film"></i>
  327. </a>
  328. % endif
  329. % if pres:
  330. <a href="${pres.get_path}">
  331. <i class="icon-list-alt"></i>
  332. </a>
  333. % endif
  334. </span>
  335. % if event.Salle:
  336. <div style="position: absolute; bottom: 2px; right: 5px;">
  337. ${event.Salle.name}
  338. </div>
  339. % endif
  340. <br/>
  341. % if event.intervenants.count()>1:
  342. avec
  343. % for num, inter in enumerate(event.intervenants.all()):
  344. <%
  345. if inter==uprofil:
  346. continue
  347. %>
  348. <a href="/user/${inter.slug}">${inter.prenom} ${inter.nom}</a>,
  349. % endfor
  350. % endif
  351. </td>
  352. </tr>
  353. % endfor
  354. % endif
  355. </table>
  356. </%def>
  357. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  358. ## Wrapper pour les badges des entités utilisateur
  359. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  360. <%def name="show_SummaryEntities(ListEntities)"> \
  361. <ul class="thumbnails">
  362. % for tiers in ListEntities:
  363. <% Entity = tiers.get_entity_type %>
  364. <li class="span3 tiers">
  365. <div class="media">
  366. <a class="pull-left" href="/entity/${Entity.entity_type}/${tiers.slug}">
  367. % if tiers.ThumbLinks:
  368. <img class="media-object" src="${tiers.ThumbLinks.pop()}" />
  369. % else:
  370. <img class="media-object" src="/img/no-image-thumb.jpg" />
  371. % endif
  372. </a>
  373. <div class="media-body">
  374. %if Entity.entity_subtype!=Entity.entity_type:
  375. <h5 style="margin:0">${Entity.entity_type} ${Entity.entity_subtype}</h5>
  376. %else:
  377. <h5 style="margin:0">${Entity.entity_type}</h5>
  378. %endif
  379. <a href="/entity/${Entity.entity_type}/${tiers.slug}">
  380. <h4 class="media-heading">${tiers.name}</h4>
  381. </a>
  382. % if Entity.entity_role:
  383. <span><i>${Entity.entity_role}</i></span>
  384. % endif
  385. </div>
  386. </div>
  387. </li>
  388. % endfor
  389. </ul>
  390. </%def>
  391. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  392. ## Wrapper pour les photos
  393. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  394. <%def name="show_my_pictures(uprofil)"> \
  395. <div class="profile-icon" style="float:right;height:250px;width:250px;">
  396. <% photos = uprofil.PhotosLinks %>
  397. <div style="text-align: center;line-height:20px;">
  398. <a data-target="#AjaxModal" Myhref="/2015/modal/Password/1" role="button" handle="modal">Changer mon mot de passe</a>
  399. </div>
  400. <div style="text-align: center;line-height:20px;">
  401. <a data-target="#AjaxModal" Myhref="/2015/modal/UserPicture/${uprofil.uid}" handle="modal">Changer ma photo</a>
  402. </div>
  403. <div id="MyPictureCarousel" class="carousel slide">
  404. % if len(photos)>1:
  405. <!-- Carousel nav -->
  406. <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
  407. <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
  408. % endif
  409. <!-- Carousel items -->
  410. <div class="carousel-inner" style="height: 220px;">
  411. % if len(photos):
  412. % for num, link in enumerate(photos):
  413. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  414. <div style="margin:auto;">
  415. <img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${uprofil.slug}" />
  416. </div>
  417. </div>
  418. % endfor
  419. % else:
  420. <div class="active item" id="UserPic0">
  421. <div style="margin:auto;width:170px;">
  422. <img src="/img/default-user.png" class="img-polaroid" alt="Photo ${uprofil.slug}" style="max-height:205px;" />
  423. </div>
  424. </div>
  425. % endif
  426. </div>
  427. </div>
  428. </div>
  429. </%def> \
  430. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  431. <%def name="show_pictures(uprofil)"> \
  432. <div class="profile-icon pull-right">
  433. <% photos = uprofil.PhotosLinks %>
  434. <div id="MyPictureCarousel" class="carousel slide">
  435. % if len(photos)>1:
  436. <!-- Carousel nav -->
  437. <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
  438. <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
  439. % endif
  440. <!-- Carousel items -->
  441. <div class="carousel-inner" style="height: 220px;">
  442. % if len(photos):
  443. % for num, link in enumerate(photos):
  444. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  445. <div style="margin:auto;">
  446. <img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${uprofil.nom} ${uprofil.prenom}" />
  447. </div>
  448. </div>
  449. % endfor
  450. % else:
  451. <div class="active item" id="UserPic0">
  452. <div style="margin:auto;width:170px;">
  453. <img src="/img/default-user.png" class="img-polaroid" alt="Photo ${uprofil.nom} ${uprofil.prenom}" style="max-height:205px;" />
  454. </div>
  455. </div>
  456. % endif
  457. </div>
  458. </div>
  459. </div>
  460. </%def> \
  461. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  462. ## Wrapper pour les échanges utilisateurs
  463. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  464. <%def name="show_exchange(Exchange, Asker, Provider)"> \
  465. <div class="media">
  466. % if Asker:
  467. <a class="pull-left" href="/user/${Asker.slug}">
  468. % if Asker.PhotosThumb:
  469. <img class="media-object"
  470. src="${Asker.PhotosThumb.pop()}"
  471. alt="${Asker.prenom} ${Asker.nom}"/>
  472. % else:
  473. <img class="media-object"
  474. src="/img/no-image-thumb.jpg"
  475. alt="${Asker.prenom} ${Asker.nom}"/>
  476. % endif
  477. </a>
  478. % else:
  479. <a class="pull-left" href="#">
  480. <img class="media-object" src="/img/personne.jpg" alt="Personne"/>
  481. </a>
  482. % endif
  483. % if Provider:
  484. <a class="pull-right" href="/user/${Provider.slug}">
  485. % if Provider.PhotosThumb:
  486. <img class="media-object"
  487. src="${Provider.PhotosThumb.pop()}"
  488. alt="${Provider.prenom} ${Provider.nom}"/>
  489. % else:
  490. <img class="media-object"
  491. src="/img/no-image-thumb.jpg"
  492. alt="${Provider.prenom} ${Provider.nom}"/>
  493. % endif
  494. </a>
  495. % else:
  496. <a class="pull-right" href="#">
  497. <img class="media-object" src="/img/personne.jpg" alt="Personne"/>
  498. </a>
  499. %endif
  500. <div class="media-body">
  501. <table style="width:100%">
  502. <tr>
  503. <td style="text-align:left;vertical-align:middle;width:40%">
  504. % if Asker:
  505. Demande de<br>
  506. <a href="/user/${Asker.slug}">${Asker.prenom} ${Asker.nom}</a>
  507. % else:
  508. <i>Pas de réponse</i>
  509. % endif
  510. </td>
  511. <td>
  512. % if Exchange.exch_done:
  513. <img class="media-object" src="/img/echange.png" alt="Echange"/>
  514. % elif Exchange.exch_state=='Ask':
  515. <img class="media-object" src="/img/asker.png" alt="Cherche"/>
  516. % elif Exchange.exch_state=='Proposal':
  517. <img class="media-object" src="/img/provider.png" alt="Propose"/>
  518. % endif
  519. </td>
  520. <td style="text-align:right;vertical-align:middle;width:40%">
  521. %if Provider:
  522. Proposition de<br>
  523. <a href="/user/${Provider.slug}">${Provider.prenom} ${Provider.nom}</a>
  524. % else:
  525. <i>Pas de réponse</i>
  526. % endif
  527. </td>
  528. </tr>
  529. </table>
  530. </div>
  531. </div>
  532. </%def> \
  533. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  534. ## Wrapper pour les addresses pour les utilisateurs
  535. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  536. <%def name="show_address(Place)"> \
  537. <address>
  538. <strong>${Place.display_name}</strong> ( ${Place.place_type} )<br>
  539. ${Place.name}<br>
  540. % if Place.specific:
  541. ${Place.specific}<br>
  542. % endif
  543. ${Place.adresse}<br>
  544. ${Place.codePostal} ${Place.ville}<br>
  545. </address>
  546. </%def> \
  547. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  548. ## Wrapper pour la description des places
  549. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  550. <%def name="show_desc(Place)"> \
  551. % if Place.description:
  552. ${Place.description | n}
  553. % endif
  554. </%def> \