|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <%namespace name="dialogH" file="jm2l:templates/Logistique/Dialog_Heberg.mako"/>
- <%namespace name="dialogC" file="jm2l:templates/Logistique/Dialog_Covoit.mako"/>
- <%namespace name="dialogM" file="jm2l:templates/Logistique/Dialog_Matos.mako"/>
- ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- ## Faire une Proposition
- ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- <%def name="AddProposal(Type, form)"> \
- <%
- if Type=='H':
- CurTitle = u"un hébergement"
- CurIcon = "icon-home"
- elif Type=='C':
- CurTitle = "un co-voiturage"
- CurIcon = "icon-road"
- elif Type=='M':
- CurTitle = u"un prêt de matériel"
- CurIcon = "icon-shopping-cart"
- %> \
- <!-- Modal -->
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="AddProp${Type}ModalLabel"> Je propose ${CurTitle} !</h3>
- </div>
- <div class="modal-body">
- %if 'exch_id' in form._fields.keys():
- <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Prop${Type}/${form.exch_id.data}');">
- %else:
- <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Prop${Type}/0');">
- %endif
- <p>Je propose mes service pour ${CurTitle}</p>
- % if Type=='H':
- ${dialogH.Heberg_Proposal(form)}
- % elif Type=='C':
- ${dialogC.Covoit_Proposal(form)}
- % elif Type=='M':
- ${dialogM.Matos_Proposal(form)}
- % endif
- </form>
- </div>
- <div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
- <button class="btn btn-primary" onclick="javascript:document.forms['ModalForm'].submit();">
- <i class="${CurIcon} icon-white"></i> Proposer !</button>
- </div>
- </%def> \
- ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- ## Faire une Demande
- ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- <%def name="AddAsk(Type, form)"> \
- <%
- if Type=='H':
- CurTitle = u"un hébergement"
- CurIcon = "icon-home"
- elif Type=='C':
- CurTitle = "un co-voiturage"
- CurIcon = "icon-road"
- elif Type=='M':
- CurTitle = u"un prêt de matériel"
- CurIcon = "icon-shopping-cart"
- %>
- <!-- Modal -->
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="AddAsk${Type}ModalLabel"> Je demande ${CurTitle} !</h3>
- </div>
- <div class="modal-body">
- % if 'exch_id' in form._fields.keys():
- <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Ask${Type}/${form.exch_id.data}');">
- % else:
- <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/modal/Ask${Type}/0');">
- %endif
- <p>Je demande ${CurTitle}</p>
- % if Type=='H':
- ${dialogH.Heberg_Ask(form)}
- % elif Type=='C':
- ${dialogC.Covoit_Ask(form)}
- % elif Type=='M':
- ${dialogM.Matos_Ask(form)}
- % endif
- </form>
- </div>
- <div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
- <button class="btn btn-primary" onclick="javascript:document.forms['ModalForm'].submit();">
- <i class="${CurIcon} icon-white"></i> Demander !</button>
- </div>
- </%def> \
- ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- ## Afficher les détails
- ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- <%def name="Show(Type, Exch)"> \
- <%
- if Exch.exch_type=='H':
- CurTitle = u"de l'hébergement"
- CurIcon = "icon-home"
- elif Exch.exch_type=='C':
- CurTitle = "du co-voiturage"
- CurIcon = "icon-road"
- elif Exch.exch_type=='M':
- CurTitle = u"du prêt de matériel"
- CurIcon = "icon-shopping-cart"
- %>
- <!-- Modal -->
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <i class="${CurIcon}"></i> <strong>Détails ${CurTitle}</strong>
- </div>
- <div class="modal-body">
- % if Type=='H':
- ${dialogH.ShowH(Exch)}
- % elif Type=='C':
- ${dialogC.ShowC(Exch)}
- % elif Type=='M':
- ${dialogM.ShowM(Exch)}
- % endif
- % if Exch.exch_state=='Ask':
- <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/exchange/Ask${Type}/${Exch.exch_id}/deal');"></form>
- % elif Exch.exch_state=='Proposal':
- <form id="ModalForm" action="javascript:DoPost('/${CurrentYear}/exchange/Prop${Type}/${Exch.exch_id}/deal');"></form>
- % endif
- </div>
- <div class="modal-footer">
- % if not Exch.exch_done and (Exch.asker_id is None or Exch.provider_id is None):
- % if Exch.exch_state=='Proposal' and Exch.provider_id!=request.user.uid:
- <button class="btn btn-info" data-dismiss="modal" aria-hidden="true"
- onclick="javascript:document.forms['ModalForm'].submit();">
- % if Type=='H':
- Je lui demande pour dormir chez lui/elle !
- % elif Type=='C':
- Je lui demande de venir me chercher !
- % elif Type=='M':
- Je lui demande de me prêter son matériel !
- % endif
- </button>
- % elif Exch.exch_state=='Ask' and Exch.asker_id!=request.user.uid:
- <button class="btn btn-info" data-dismiss="modal" aria-hidden="true"
- onclick="javascript:document.forms['ModalForm'].submit();">
- % if Type=='H':
- Je propose de l'héberger !
- % elif Type=='C':
- Je propose de venir le/la chercher !
- % elif Type=='M':
- Je lui propose mon matériel !
- % endif
- </button>
- % endif
- % endif
- <button class="btn" data-dismiss="modal" aria-hidden="true">Fermer</button>
- </div>
- </%def> \
|