Changeset 217 for trunk/root


Ignore:
Timestamp:
04/18/09 04:57:22 (15 years ago)
Author:
nanardon
Message:
  • make difference between settings and their raw value
  • simplify template
  • allow to have a different number of elected people than choice in ballot
Location:
trunk/root
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/root/latex/poll_report.tt

    r214 r217  
    88\section{Description du vote} 
    99 
    10 [%- poll.info.description -%] 
     10[%- poll.info('description') -%] 
    1111 
    1212 
    13 [% poll.info.choice_count %] choix étaient à retenir. 
     13[% poll.info('choice_count') %] choix étaient à retenir. 
    1414 
    1515Etait candidats: 
     
    4949[%- IF poll.ballot_count_nonull -%] 
    5050[%- FOREACH res = poll.results -%] 
    51 [%- IF res.count != loop.prev.count && loop.count > 0 -%] 
    52 [%- mycount = loop.count -%] 
    53 [%- END -%] 
    5451 
    55 [%- IF loop.count <= poll.info.choice_count -%] 
    56 [%- IF res.count >= poll.absolute_majority -%] 
    57 [%- comment = 'majorité absolue' -%] 
     52[% IF res.elected %] 
     53[% IF res.abs_maj %] 
     54[%- comment = 'Elu, majorité absolue' -%] 
    5855[%- ELSE -%] 
    5956[%- comment = 'Elu' -%] 
     
    7067\hline 
    7168[% END %] 
    72 [% mycount %]& [% res.value %]& [% res.count %]& [% res.count * 100 / poll.ballot_count_nonull | format('%.2f') %]& [% comment %]\\ 
     69[% res.order %]& [% res.value %]& [% res.count %]& [% res.count * 100 / poll.ballot_count_nonull | format('%.2f') %]& [% comment %]\\ 
    7370\hline 
    7471 
  • trunk/root/templates/admin/ballot.tt

    r207 r217  
    44[% poll = c.model('Vote').poll(voteid) %] 
    55 
    6 <div style="float: left; width: 35%" class="box"> 
    7 <form action="[% c.uri_for(voteid, 'ballot') %]"> 
    8 Nombre de choix possible: 
    9 <input type="text" name="choice_count" value="[% c.req.param('choice_count') || poll.info('choice_count') | html %]"> 
    10 <br> 
    11 Nombre de choix libres: 
    12 <input type="text" name="free_choice" value="[% c.req.param('free_choice') || poll.info('free_choice') || 0 | html %]"> 
    13 <br> 
     6<div style="float: left; width: 55%" class="box"> 
     7<form action="[% c.uri_for(voteid, 'ballot') %]" method="POST"> 
     8<table border=1> 
     9<tr> 
     10<td>Nombre de choix possible:</td> 
     11<td><input type="text" size="3" name="choice_count" value="[% c.req.param('choice_count') || poll.info('choice_count') | html %]"></td> 
     12</tr> 
     13 
     14<tr> 
     15<td>Nombre d'élu(s)<br>(si différent du nombre de choix)</td> 
     16<td><input type="text" size="3" name="elected_count" value="[% c.req.param('elected_count') || poll.raw_info('elected_count') | html %]"></td> 
     17</tr> 
     18 
     19<tr> 
     20<td>Nombre de choix libres:</td> 
     21<td><input type="text" size="3" name="free_choice" value="[% c.req.param('free_choice') || poll.info('free_choice') || 0 | html %]"></td> 
     22</tr> 
     23 
     24</table> 
    1425<input type="submit" name="pollparam" value="Enregistrer"> 
    1526</form> 
  • trunk/root/templates/admin/includes/poll_settings.tt

    r206 r217  
    3636</form> 
    3737</div> 
     38 
     39<!-- Crypt settings --> 
    3840<div class="box" style="float:right; width: 35%"> 
    3941[% IF poll.is_crypted %] 
  • trunk/root/templates/includes/poll_results.tt

    r214 r217  
    3939[% END %] 
    4040 
    41 [% IF res.count != loop.prev.count && loop.count > 0 %] 
    42     [% # If equality, we keep same color, even we are over resullts %] 
    43 [% mycount = loop.count %] 
    44 [% IF loop.count <= poll.info('choice_count') %] 
    45 [% IF res.count >= poll.absolute_majority %] 
     41[% IF res.elected %] 
     42[% IF res.abs_maj %] 
    4643[% class = 'majabs' %] 
    4744[% ELSE %] 
     
    5148[% class = 'notselected' %] 
    5249[% END %] 
    53 [% END %] 
    5450<tr class="[% class %]"> 
    55 <td>[% mycount %]</td> 
     51<td>[% res.order %]</td> 
    5652<td>[% loop.count %]</td> 
    5753<td>[% res.value | html %]</td> 
Note: See TracChangeset for help on using the changeset viewer.