source: trunk/root/latex/poll_report.tt @ 217

Last change on this file since 217 was 217, checked in by nanardon, 15 years ago
  • make difference between settings and their raw value
  • simplify template
  • allow to have a different number of elected people than choice in ballot
File size: 2.4 KB
Line 
1[% USE Mail %]
2[%- poll = c.model('Vote').results(voteid) %]
3
4\maketitle
5
6\tableofcontents{}
7
8\section{Description du vote}
9
10[%- poll.info('description') -%]
11
12
13[% poll.info('choice_count') %] choix étaient à retenir.
14
15Etait candidats:
16
17[%- FOREACH chk = poll.choices -%]
18[% ch = poll.choice(chk) -%]
19[%- IF loop.first -%]
20\begin{enumerate}[% END -%]
21\item [% ch.info.label %]
22
23[%- IF loop.last -%]
24
25\end{enumerate}
26[%- END -%]
27[%- END -%]
28
29Nombre d'électeurs: [% poll.voting_count %].
30
31\section{Résultats}
32
33\subsection{Participation}
34
35\begin{tabular}{|l|c|c|}
36\hline
37Nombre de bulltetins&[% poll.ballot_count %]&\\
38\hline
39Participation&[% poll.signing_count %]&[% poll.signing_count / poll.voting_count * 100 | format('%.2f \%%') IF poll.voting_count %]\\
40\hline
41Nombre de bulltetins&[% poll.ballot_count %]&\\
42\hline
43Nombre de voix exprimée&[% poll.ballot_count_nonull %]&[% poll.ballot_count_nonull / poll.ballot_count * 100 | format('%.2f \%%') IF poll.ballot_count %]\\
44\hline
45\end{tabular}
46
47\subsection{Scores}
48
49[%- IF poll.ballot_count_nonull -%]
50[%- FOREACH res = poll.results -%]
51
52[% IF res.elected %]
53[% IF res.abs_maj %]
54[%- comment = 'Elu, majorité absolue' -%]
55[%- ELSE -%]
56[%- comment = 'Elu' -%]
57[%- END -%]
58[%- ELSE -%]
59[%- comment = '' -%]
60[%- END -%]
61
62[%- IF loop.first -%]
63\begin{tabular}{|r|l|r|c|l|}
64\hline
65ordre&choix&nb de voix&\%&commentaire\\
66\hline
67\hline
68[% END %]
69[% res.order %]& [% res.value %]& [% res.count %]& [% res.count * 100 / poll.ballot_count_nonull | format('%.2f') %]& [% comment %]\\
70\hline
71
72[%- IF loop.last -%]
73\end{tabular}
74[%- END %]
75[%- END -%]
76[%- ELSE -%]
77[%- END -%]
78
79\section{Données du vote}
80
81\subsection{Liste d'émargement}
82
83[% FOREACH vkey = poll.voting_keys %]
84[% voting = poll.voting(vkey) %]
85[% '\begin{enumerate}' IF loop.first %]
86\item [% voting.info.id _ ' ' IF voting.info.id %]\verb+[% voting.info.mail | mail %]+
87[% "\nA voté\n" IF voting.info.date %]
88[% '\end{enumerate}' IF loop.last -%]
89[% END %]
90
91\subsection{Liste des bulletins}
92
93[% FOREACH id = poll.ballot_keys %]
94[%- ballot = poll.ballot(id) -%]
95[% invalid = '#' _ ballot.info.invalid %]
96[% IF loop.first %]
97\begin{enumerate}
98[% END %]
99\item \verb+[% id %]+ [% "\textbf{invalidé}" IF invalid == '#1' %]
100
101[%- FOREACH item = ballot.items -%]
102[% '\begin{enumerate}' IF loop.first %]
103\item [% item.v %] [% '(' _ item.corrected _ ')' IF item.corrected -%]
104
105[% '\end{enumerate}' IF loop.last -%]
106[% END %]
107[% IF loop.last %]
108\end{enumerate}
109[% END %]
110[% END %]
Note: See TracBrowser for help on using the repository browser.