<%namespace name="h" file="jm2l:templates/helpers.mako"/> <%namespace name="tables" file="jm2l:templates/Logistique/Tables.mako"/> ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <%def name="Main(Exchanges)"> <% DicExch = Exchanges.get_overview( request.user.uid ) %>
${Route_wrapper(DicExch)}
${Miam_wrapper()}
${Exchange_wrapper('C', DicExch['C'])}
${Exchange_wrapper('H', DicExch['H'])}
${Exchange_wrapper('M', DicExch['M'])}
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <%def name="Exchange_wrapper(Type, DicExch)"> ${tables.DoTable(Type, 'Ask', DicExch)} ${tables.DoTable(Type, 'Proposal', DicExch)}
Tous les échanges ${Missing(Type, DicExch['Missing'])}
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <%def name="Miam_wrapper()">
Qu'est ce qu'on mange ?
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <%def name="Missing(Type, Selection)"> <% if Type=='H': CurTitle = u"d'hébergement" CurIcon = "icon-home" elif Type=='C': CurTitle = "de co-voiturage" CurIcon = "icon-road" elif Type=='M': CurTitle = u"de prêt de matériel" CurIcon = "icon-shopping-cart" %> % if len(Selection)==0: % else: % for item in Selection: <% if (item.provider_id and item.asker_id): continue %> % if item.exch_state=='Ask': % elif item.exch_state=='Proposal': % endif % endfor % endif
Les échanges ${CurTitle} % if 0: % endif
Détails
Il n'y a aucun échange ${CurTitle} proposé actuellement...

%if item.asker and item.exch_state=='Ask': ${item.asker.prenom} ${item.asker.nom} demande %elif item.provider and item.exch_state=='Proposal': ${item.provider.prenom} ${item.provider.nom} offre % endif % if item.exch_type=="C": un co-voiturage le ${item.start_time.strftime('%a %d %b vers %Hh%M').decode('utf-8')} de ${item.Itin.start.display_name} à ${item.Itin.arrival.display_name} % elif item.exch_type=="M": % if item.Category: ${item.Category.exch_subtype} % endif % if item.description: ${item.description[:30]} % endif de ${item.start_time.strftime('%a %d %b %Hh%M').decode('utf-8')} à ${item.end_time.strftime('%a %d %b %Hh%M').decode('utf-8')} % else: % if item.Category: ${item.Category.exch_subtype} % endif % if item.description: ${item.description[:30]} % endif ${item.start_time.strftime('%a %d %b').decode('utf-8')} soir % endif

% if item.provider_id==request.user.uid or item.asker_id==request.user.uid: % elif (item.provider_id and item.asker_id):

## ## ## ## % else:

## ## ## % endif
<% context._kwargs['postpone_js'].append( "$('#%s_Props').tooltip();" % Type ) context._kwargs['postpone_js'].append( "$('#%s_Demande').tooltip();" % Type ) %> ## ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <%def name="Route_wrapper(DicExch)"> <% AskSelection = Exchanges.get_my_counters( int(request.user.uid) ) AllSelection = Exchanges.get_counters() ListWrap = ["Co-voiturage",u"Hébergement","Matos"] %>
% for Wrap in ListWrap: % endfor
Section Mes demandes Mes offres Accords
Miam ? - ?
${Wrap | h} ${len(DicExch[Wrap[0]]['Ask'])} ${len(DicExch[Wrap[0]]['Proposal'])} ${len(DicExch[Wrap[0]]['Agree'])}
% for Wrap in ListWrap: % endfor
Section Les demandes Les propositions Les Accords
Miam ? - ?
${Wrap | h} ${DicExch[Wrap[0]]['Counters']['AllAsk']} ${DicExch[Wrap[0]]['Counters']['AllProp']} ${DicExch[Wrap[0]]['Counters']['AllAgree']}
Mon Badge
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ## Handle the Javascript Refresh to live update Current Page ## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= % if reload: <% DicExch = Exchanges.get_overview( request.user.uid ) context._kwargs['postpone_js'] = [] %> ${Route_wrapper(DicExch)} ${Exchange_wrapper(Type, DicExch[Type])} %endif