Bläddra i källkod

Add people role during event in ListParticipant

master
tr4ck3ur des JM2L 7 år sedan
förälder
incheckning
78fb23e858
2 ändrade filer med 96 tillägg och 79 borttagningar
  1. +1
    -3
      jm2l/static/index.html
  2. +95
    -76
      jm2l/templates/Participant/list_users.mako

+ 1
- 3
jm2l/static/index.html Visa fil

@@ -79,9 +79,7 @@
<footer>
<p>&copy; Company 2015</p>
</footer>
</div> <!-- /container --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>

</div>
<script src="js/vendor/bootstrap.min.js"></script>

<script src="js/plugins.js"></script>


+ 95
- 76
jm2l/templates/Participant/list_users.mako Visa fil

@@ -8,10 +8,11 @@ now = datetime.datetime.now()
%>

<form class="filterform" action="#">
<table class="table table-bordered table-hover">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th style="width:7em;text-align:center;"></th>
<th style="text-align:center;">en ${for_year}</th>
<th style="width:5em;text-align:center;">Visite</th>
<th style="width:7em;text-align:center;">Activité</th>
<th style="text-align:center;">Arrivée prévue</th>
@@ -23,118 +24,136 @@ now = datetime.datetime.now()
</tr>
</thead>
<tbody id="list">
% for u, s in Users:
% if u.is_IntervenantOnYear(for_year):
<tr>
% else:
% for u, s in Users:
% if u.is_IntervenantOnYear(for_year):
<tr style="color:blue">
% elif s or u.Staff:
<tr>
% else:
<tr style="color:lightgray">
% endif
% endif
<td style="text-align:center;">
<span class="data">${u.slug}</span>
<a href="/MesJM2L?user=${u.uid}">${u.nom} ${u.prenom}</a><br />
<span class="data">${u.slug}</span>
<a href="/MesJM2L?user=${u.uid}">${u.nom} ${u.prenom}</a><br />
<span style="align:center">
${u.vote_logo}
${u.vote_logo}
<a href="mailto:${u.mail}">
<i class="icon-envelope"></i>
</a>
% if u.Staff==1:
<a href="javascript:alert('${u.nom}, ${u.prenom}\nStaff JM2L');">
<i class="icon-star"></i>
</a>
% endif
% if u.is_IntervenantOnYear(for_year):
<a href="javascript:alert('${u.nom}, ${u.prenom}\nIntervenant');">
<i class="icon-user"></i>
</a>
% endif
% if u.active==0:
% if u.Staff==1:
<a href="javascript:alert('${u.nom}, ${u.prenom}\nStaff JM2L');">
<i class="icon-star"></i>
</a>
% endif
% if u.is_IntervenantOnYear(for_year):
<a href="javascript:alert('${u.nom}, ${u.prenom}\nIntervenant');">
<i class="icon-user"></i>
</a>
% endif
% if u.active==0:
<a href="javascript:alert('${u.nom}, ${u.prenom}\nInactive');">
<i class="icon-ban-circle"></i>
</a>
% endif
% if u.phone:
% endif
% if u.phone:
<a href="javascript:alert('${u.nom}, ${u.prenom}\n${u.phone}');">
<i class="icon-headphones"></i>
</a>
% endif
<a href="/user/${u.slug}/badge">
% endif
<a href="/user/${u.slug}/badge">
<i class="icon-qrcode"></i>
</a>
</span>
</td>
<td style="text-align:center;">
<span class="data">${(now - u.last_logged).days}</span>${(now - u.last_logged).days} j
% if u.is_IntervenantOnYear(for_year):
<span class="data">1</span>Intervenant
% elif s and s.orga_part:
% if u.Staff:
<span class="data">2</span>Staff
% else:
<span class="data">3</span>Bénévole
% endif
% elif u.Staff:
<span class="data">2</span>Staff
% elif s:
<span class="data">4</span>Visiteur
% else:
<span class="data"></span><i>Pas d'informations</i>
% endif
</td>
<td style="text-align:center;">
<span class="data">${(now - u.last_logged).days}</span>${(now - u.last_logged).days} j
</td>
<td style="text-align:center;">
% if u.events:
<span class="data">${len(u.events)}</span>
<select style="width:7em;">
<option><strong>${len(u.events)} Intérv.</strong></option>
% for y, g in itertools.groupby(sorted(u.events, key=lambda k:k.for_year, reverse=True), key=lambda k:k.for_year):
<OPTGROUP LABEL="${y}">
% for event in g:
${event.for_year}
<OPTION onclick="location='/event/${event.for_year}/${event.slug}';">${event.event_type} - ${event.name}</OPTION>
% endfor
</OPTGROUP>
% endfor
</select>
<span class="data">${len(u.events)}</span>
<select style="width:7em;">
<option><strong>${len(u.events)} Intérv.</strong></option>
% for y, g in itertools.groupby(sorted(u.events, key=lambda k:k.for_year, reverse=True), key=lambda k:k.for_year):
<OPTGROUP LABEL="${y}">
% for event in g:
${event.for_year}
<OPTION onclick="location='/event/${event.for_year}/${event.slug}';">${event.event_type} - ${event.name}</OPTION>
% endfor
</OPTGROUP>
% endfor
</select>
%else:
<span class="data"></span>
<i> - </i>
<span class="data">0</span>
<i> - </i>
% endif
</td>
<td style="text-align:center;">
% if s and s.arrival_time:
<span class="data">${s.arrival_time.strftime('%m/%d/%Y %H:%M:%S')}</span>
${s.arrival_time.strftime('%a %d <strong>%H:%M</strong>') | n}<br/>
${s.arrival_place}
% if s.arrival_text:
- NB: <strong>${s.arrival_text}</strong>
% endif
<span class="data">${s.arrival_time.strftime('%m/%d/%Y %H:%M:%S')}</span>
${s.arrival_time.strftime('%a %d <strong>%H:%M</strong>') | n}<br/>
${s.arrival_place}
% if s.arrival_text:
- NB: <strong>${s.arrival_text}</strong>
% endif
%else:
<span class="data"></span>
<i>Pas d'informations</i>
<span class="data"></span><i>Pas d'informations</i>
% endif
</td>
% if s and s.repas:
% for i, d in enumerate(['Ven Soir', 'Sam midi', 'Sam soir']):
<td style="text-align:center">
% if (s.repas & 2**i):
<span class="data">Oui</span>Oui
% else:
<span class="data">Non</span>Non
% endif
</td>
% endfor
% if s and s.repas:
% for i, d in enumerate(['Ven Soir', 'Sam midi', 'Sam soir']):
<td style="text-align:center">
% if (s.repas & 2**i):
<span class="data">Oui</span>Oui
% else:
<span class="data">Non</span>Non
% endif
</td>
% endfor
%else:
<td style="text-align:center;" colspan="3">
<i>Pas d'informations</i>
</td>
<td style="text-align:center;" colspan="3">
<span class="data"></span><i>Pas d'informations</i>
</td>
% endif
</td>
<td style="text-align:center;">
% if s and s.depart_time:
<span class="data">${s.depart_time.strftime('%m/%d/%Y %H:%M:%S')}</span>
${s.depart_time.strftime('%a %d <strong>%H:%M</strong>') | n}<br/>
${s.depart_place}
% if s.depart_text:
- NB: <strong>${s.arrival_text}</strong>
% endif
<span class="data">${s.depart_time.strftime('%m/%d/%Y %H:%M:%S')}</span>
${s.depart_time.strftime('%a %d <strong>%H:%M</strong>') | n}<br/>
${s.depart_place}
% if s.depart_text:
- NB: <strong>${s.arrival_text}</strong>
% endif
%else:
<span class="data"></span>
<i>Pas d'informations</i>
<span class="data"></span>
<i>Pas d'informations</i>
% endif
</td>
<td>
% if s:
% if s.repas_allerg:
<u>Allergies</u> : ${s.repas_allerg}<br/>
% endif
% if s.repas_contr:
<u>Contraintes</u> : ${s.repas_contr}<br/>
% endif
% if s:
% if s.repas_allerg:
<u>Allergies</u> : ${s.repas_allerg}<br/>
% endif
% if s.repas_contr:
<u>Contraintes</u> : ${s.repas_contr}<br/>
% endif
% endif
<span class="data"></span>
</td>
</tr>
% endfor


Laddar…
Avbryt
Spara