| @@ -92,53 +92,54 @@ | |||||
| %a{ :href => "?wiki=dokuwiki" } | %a{ :href => "?wiki=dokuwiki" } | ||||
| DokuWiki | DokuWiki | ||||
| %h2 Votes by party | |||||
| - if @total_seats > 1 | |||||
| %h2 Votes by party | |||||
| %table | |||||
| %tr.header | |||||
| %th | |||||
| %th | |||||
| %th | |||||
| %th.right.highlight seats won | |||||
| %th candidates | |||||
| %th.right votes | |||||
| %th.right % votes | |||||
| %th.right votes per candidate | |||||
| - count = 0 | |||||
| %table | |||||
| %tr.header | |||||
| %th | |||||
| %th | |||||
| %th | |||||
| %th.right.highlight seats won | |||||
| %th candidates | |||||
| %th.right votes | |||||
| %th.right % votes | |||||
| %th.right votes per candidate | |||||
| - count = 0 | |||||
| - @results_by_party.each do |row| | |||||
| - count += 1 | |||||
| %tr | |||||
| %td.right= count | |||||
| %td{ :style => "background-color: #{row['party_colour'] }" } | |||||
| %td= row['party_name'] | |||||
| - if @election_held | |||||
| %td.right.highlight= row['num_seats'] | |||||
| - else | |||||
| %td.right.highlight — | |||||
| %td.right= row['num_candidates'] | |||||
| - if @election_held | |||||
| %td.right= commify(row['total_votes']) | |||||
| %td.right= format_percent(row['total_votes'].to_f / @total_votes * 100) | |||||
| %td.right= commify(row['total_votes'] / row['num_candidates']) | |||||
| - else | |||||
| %td.right — | |||||
| %td.right — | |||||
| %td.right — | |||||
| - @results_by_party.each do |row| | |||||
| - count += 1 | |||||
| %tr | |||||
| %td.right= count | |||||
| %td{ :style => "background-color: #{row['party_colour'] }" } | |||||
| %td= row['party_name'] | |||||
| - if @election_held | |||||
| %td.right.highlight= row['num_seats'] | |||||
| - else | |||||
| %td.right.highlight — | |||||
| %td.right= row['num_candidates'] | |||||
| - if @election_held | |||||
| %td.right= commify(row['total_votes']) | |||||
| %td.right= format_percent(row['total_votes'].to_f / @total_votes * 100) | |||||
| %td.right= commify(row['total_votes'] / row['num_candidates']) | |||||
| - else | |||||
| %td.right — | |||||
| %td.right — | |||||
| %td.right — | |||||
| %tr.footer | |||||
| %td | |||||
| %td | |||||
| %td | |||||
| - if @election_held | |||||
| %td.right.highlight= @total_seats | |||||
| - else | |||||
| %td.right.highlight | |||||
| %td.right= @total_candidates | |||||
| %td.right= commify(@total_votes) | |||||
| %td | |||||
| %td | |||||
| %tr.footer | |||||
| %td | |||||
| %td | |||||
| %td | |||||
| - if @election_held | |||||
| %td.right.highlight= @total_seats | |||||
| - else | |||||
| %td.right.highlight | |||||
| %td.right= @total_candidates | |||||
| %td.right= commify(@total_votes) | |||||
| %td | |||||
| %td | |||||
| - if @poll | - if @poll | ||||
| %p | %p | ||||