Le repo des sources pour le site web des JM2L
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

151 lines
6.1 KiB

  1. <%namespace name="dialogH" file="jm2l:templates/Logistique/Dialog_Heberg.mako"/>
  2. <%namespace name="dialogC" file="jm2l:templates/Logistique/Dialog_Covoit.mako"/>
  3. <%namespace name="dialogM" file="jm2l:templates/Logistique/Dialog_Matos.mako"/>
  4. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5. ## Faire une Proposition
  6. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7. <%def name="AddProposal(Type, form)"> \
  8. <%
  9. if Type=='H':
  10. CurTitle = u"un hébergement"
  11. CurIcon = "icon-home"
  12. elif Type=='C':
  13. CurTitle = "un co-voiturage"
  14. CurIcon = "icon-road"
  15. elif Type=='M':
  16. CurTitle = u"un prêt de matériel"
  17. CurIcon = "icon-shopping-cart"
  18. %> \
  19. <!-- Modal -->
  20. <div class="modal-header">
  21. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  22. <h3 id="AddProp${Type}ModalLabel"> Je propose ${CurTitle} !</h3>
  23. </div>
  24. <div class="modal-body">
  25. %if 'exch_id' in form._fields.keys():
  26. <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Prop${Type}/${form.exch_id.data}');">
  27. %else:
  28. <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Prop${Type}/0');">
  29. %endif
  30. <p>Je propose mes service pour ${CurTitle}</p>
  31. % if Type=='H':
  32. ${dialogH.Heberg_Proposal(form)}
  33. % elif Type=='C':
  34. ${dialogC.Covoit_Proposal(form)}
  35. % elif Type=='M':
  36. ${dialogM.Matos_Proposal(form)}
  37. % endif
  38. </form>
  39. </div>
  40. <div class="modal-footer">
  41. <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
  42. <button class="btn btn-primary" onclick="javascript:document.forms['ModalForm'].submit();">
  43. <i class="${CurIcon} icon-white"></i> Proposer !</button>
  44. </div>
  45. </%def> \
  46. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  47. ## Faire une Demande
  48. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  49. <%def name="AddAsk(Type, form)"> \
  50. <%
  51. if Type=='H':
  52. CurTitle = u"un hébergement"
  53. CurIcon = "icon-home"
  54. elif Type=='C':
  55. CurTitle = "un co-voiturage"
  56. CurIcon = "icon-road"
  57. elif Type=='M':
  58. CurTitle = u"un prêt de matériel"
  59. CurIcon = "icon-shopping-cart"
  60. %>
  61. <!-- Modal -->
  62. <div class="modal-header">
  63. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  64. <h3 id="AddAsk${Type}ModalLabel"> Je demande ${CurTitle} !</h3>
  65. </div>
  66. <div class="modal-body">
  67. % if 'exch_id' in form._fields.keys():
  68. <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Ask${Type}/${form.exch_id.data}');">
  69. % else:
  70. <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Ask${Type}/0');">
  71. %endif
  72. <p>Je demande ${CurTitle}</p>
  73. % if Type=='H':
  74. ${dialogH.Heberg_Ask(form)}
  75. % elif Type=='C':
  76. ${dialogC.Covoit_Ask(form)}
  77. % elif Type=='M':
  78. ${dialogM.Matos_Ask(form)}
  79. % endif
  80. </form>
  81. </div>
  82. <div class="modal-footer">
  83. <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
  84. <button class="btn btn-primary" onclick="javascript:document.forms['ModalForm'].submit();">
  85. <i class="${CurIcon} icon-white"></i> Demander !</button>
  86. </div>
  87. </%def> \
  88. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  89. ## Afficher les détails
  90. ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  91. <%def name="Show(Type, Exch)"> \
  92. <%
  93. if Exch.exch_type=='H':
  94. CurTitle = u"de l'hébergement"
  95. CurIcon = "icon-home"
  96. elif Exch.exch_type=='C':
  97. CurTitle = "du co-voiturage"
  98. CurIcon = "icon-road"
  99. elif Exch.exch_type=='M':
  100. CurTitle = u"du prêt de matériel"
  101. CurIcon = "icon-shopping-cart"
  102. %>
  103. <!-- Modal -->
  104. <div class="modal-header">
  105. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  106. <i class="${CurIcon}"></i> <strong>Détails ${CurTitle}</strong>
  107. </div>
  108. <div class="modal-body">
  109. % if Type=='H':
  110. ${dialogH.ShowH(Exch)}
  111. % elif Type=='C':
  112. ${dialogC.ShowC(Exch)}
  113. % elif Type=='M':
  114. ${dialogM.ShowM(Exch)}
  115. % endif
  116. % if Exch.exch_state=='Ask':
  117. <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/exchange/Ask${Type}/${Exch.exch_id}/deal');"></form>
  118. % elif Exch.exch_state=='Proposal':
  119. <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/exchange/Prop${Type}/${Exch.exch_id}/deal');"></form>
  120. % endif
  121. </div>
  122. <div class="modal-footer">
  123. % if not Exch.exch_done and (Exch.asker_id is None or Exch.provider_id is None):
  124. % if Exch.exch_state=='Proposal' and Exch.provider_id!=request.user.uid:
  125. <button class="btn btn-info" data-dismiss="modal" aria-hidden="true"
  126. onclick="javascript:document.forms['ModalForm'].submit();">
  127. % if Type=='H':
  128. Je lui demande pour dormir chez lui/elle !
  129. % elif Type=='C':
  130. Je lui demande de venir me chercher !
  131. % elif Type=='M':
  132. Je lui demande de me prêter son matériel !
  133. % endif
  134. </button>
  135. % elif Exch.exch_state=='Ask' and Exch.asker_id!=request.user.uid:
  136. <button class="btn btn-info" data-dismiss="modal" aria-hidden="true"
  137. onclick="javascript:document.forms['ModalForm'].submit();">
  138. % if Type=='H':
  139. Je propose de l'héberger !
  140. % elif Type=='C':
  141. Je propose de venir le/la chercher !
  142. % elif Type=='M':
  143. Je lui propose mon matériel !
  144. % endif
  145. </button>
  146. % endif
  147. % endif
  148. <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
  149. </div>
  150. </%def> \