<%def name="DoTable(Type, Kind, Selection)"> <% if Kind=='Ask': What = "demande" Form = "Ask" Me = "asker_id" You = "provider_id" elif Kind=='Proposal': What = "offre" Form = "Prop" Me = "provider_id" You = "asker_id" 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" %>

${What}s ${CurTitle} Ajouter
% if len(Selection['Ask'])==0 and len(Selection['Proposal'])==0:
Vous n'avez fait aucune ${What}e ${CurTitle}
% else:
Etat | Détails
--- | ---
% for CurKind in ['Ask', 'Proposal']: % for item in Selection[CurKind]: <% if getattr(item, You)==request.user.uid: continue %>

% if item.exch_done:
Validé
% elif getattr(item, You) is None:
Publié
% elif getattr(item, Me)==request.user.uid and item.exch_state==CurKind: Je ${What}
Proposition
% elif getattr(item, Me)==request.user.uid: Je ${What}
Négociation
% endif

%if Type=='C': ${item.start_time.strftime('%A %d %b %Y').decode('utf-8')} vers ${item.start_time.strftime('%Hh%M')} de ${item.Itin.start.display_name} à ${item.Itin.arrival.display_name} %elif Type=='H': % if item.Category: ${item.Category.exch_subtype}, % endif La nuit du ${item.start_time.strftime('%A %d %b %Y').decode('utf-8')}
%elif Type=='M': de ${item.start_time.strftime('%A %d %b %Y').decode('utf-8')} vers ${item.start_time.strftime('%Hh%M')} à ${item.end_time.strftime('%A %d %b %Y').decode('utf-8')} vers ${item.end_time.strftime('%Hh%M')}
${item.Category.exch_subtype} %endif %if item.description: ${item.description} %endif

% endfor % endfor % endif