| @@ -39,17 +39,50 @@ | |||
| .warning | |||
| We don't have the results for this election yet. | |||
| - if @poll | |||
| %table | |||
| %tr | |||
| %td Ballot papers issued | |||
| %td.right= commify(@poll.ballot_papers_issued) | |||
| %tr | |||
| %td Electorate | |||
| %td.right= commify(@poll.electorate) | |||
| %tr | |||
| %td Turnout | |||
| %td.right= sprintf("%.0f%%", @poll.turnout_percent) | |||
| %h2 Votes by candidate | |||
| %table | |||
| %tr.header | |||
| %th | |||
| %th | |||
| %th | |||
| %th | |||
| %th.right votes | |||
| %th.right % votes | |||
| %th | |||
| - count = 0 | |||
| - @candidacies.each do |candidacy| | |||
| - count += 1 | |||
| %tr.vcard | |||
| %td= count | |||
| %td{ :style => "background-color: #{candidacy.party.colour}" } | |||
| %td.candidate_name.fn | |||
| %a{ :href => "/candidates/#{candidacy.candidate.id}" } | |||
| = candidacy.candidate.short_name | |||
| %td.org | |||
| = party_name(candidacy.labcoop, candidacy.party.name) | |||
| - if @election_held | |||
| %td.right= commify(candidacy.votes) | |||
| %td.right= format_percent(candidacy.votes.to_f / @total_votes * 100) | |||
| - if candidacy.seats == 1 | |||
| %td.elected="Elected" | |||
| - else | |||
| %td | |||
| - else | |||
| %td.right — | |||
| %td.right — | |||
| %td | |||
| %tr.footer | |||
| %td | |||
| %td | |||
| %td | |||
| %td | |||
| %td.right= commify(@total_votes) | |||
| %td | |||
| %td | |||
| %h2 Votes by party | |||
| @@ -95,49 +128,16 @@ | |||
| %td.right= commify(@total_votes) | |||
| %td | |||
| %h2 Votes by candidate | |||
| %table | |||
| %tr.header | |||
| %th | |||
| %th | |||
| %th | |||
| %th | |||
| %th.right votes | |||
| %th.right % votes | |||
| %th | |||
| - count = 0 | |||
| - @candidacies.each do |candidacy| | |||
| - count += 1 | |||
| %tr.vcard | |||
| %td= count | |||
| %td{ :style => "background-color: #{candidacy.party.colour}" } | |||
| %td.candidate_name.fn | |||
| %a{ :href => "/candidates/#{candidacy.candidate.id}" } | |||
| = candidacy.candidate.short_name | |||
| %td.org | |||
| = party_name(candidacy.labcoop, candidacy.party.name) | |||
| - if @election_held | |||
| %td.right= commify(candidacy.votes) | |||
| %td.right= format_percent(candidacy.votes.to_f / @total_votes * 100) | |||
| - if candidacy.seats == 1 | |||
| %td.elected="Elected" | |||
| - else | |||
| %td | |||
| - else | |||
| %td.right — | |||
| %td.right — | |||
| %td | |||
| %tr.footer | |||
| %td | |||
| %td | |||
| %td | |||
| %td | |||
| %td.right= commify(@total_votes) | |||
| %td | |||
| %td | |||
| - if @poll | |||
| %p | |||
| %table | |||
| %tr | |||
| %td Ballot papers issued | |||
| %td.right= commify(@poll.ballot_papers_issued) | |||
| %tr | |||
| %td Electorate | |||
| %td.right= commify(@poll.electorate) | |||
| %tr | |||
| %td Turnout | |||
| %td.right= sprintf("%.0f%%", @poll.turnout_percent) | |||