Election results in the London Borough of Sutton.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

144 lignes
3.9 KiB

  1. - @page_title = "#{@district.name} #{@district.body.district_name} results, #{@body.name} election #{short_date(@election.d)}"
  2. %p
  3. %a{ :href => "/bodies/#{@district.body.slug}/elections/#{@election.d}" }<
  4. = @body.name
  5. election
  6. &nbsp;
  7. = long_date(@election.d)
  8. .nav
  9. - if @districts_in_this_election.size > 1
  10. - @district_index = @districts_in_this_election.index(@district)
  11. - unless @district_index == 0 # Don't show the previous link if this is the first district for this election
  12. - @previous_district = @districts_in_this_election[@district_index - 1]
  13. %a{ :href => "/bodies/#{@election.body.slug}/elections/#{@election.d}/#{@election.body.districts_name}/#{@previous_district.slug}" }<
  14. &laquo;&nbsp;
  15. = @previous_district.name
  16. &nbsp;&nbsp;&nbsp;
  17. - unless @district_index == @districts_in_this_election.size - 1 # Don't show the next link if this is the last district for this election
  18. - @next_district = @districts_in_this_election[@district_index + 1]
  19. %a{ :href => "/bodies/#{@election.body.slug}/elections/#{@election.d}/#{@election.body.districts_name}/#{@next_district.slug}" }<
  20. = @next_district.name
  21. &raquo;
  22. %p
  23. %a{ :href => "/bodies/#{@district.body.slug}/#{@district.body.district_name.pluralize(2)}/#{@district.slug}" }
  24. All elections in
  25. = @district.name
  26. &raquo;
  27. %h1= @district.name + " " + @district.body.district_name
  28. - @election_held = Candidacy.sum(:votes, :election => @election, :district => @district)
  29. - unless @election_held
  30. .warning
  31. We don't have the results for this election yet.
  32. - if @poll
  33. %table
  34. %tr
  35. %td Ballot papers issued
  36. %td.right= commify(@poll.ballot_papers_issued)
  37. %tr
  38. %td Electorate
  39. %td.right= commify(@poll.electorate)
  40. %tr
  41. %td Turnout
  42. %td.right= sprintf("%.0f%%", @poll.turnout_percent)
  43. %h2 Votes by party
  44. %table
  45. %tr.header
  46. %th &nbsp;
  47. %th &nbsp;
  48. %th &nbsp;
  49. %th.right.highlight seats won
  50. %th candidates
  51. %th.right votes
  52. %th.right % votes
  53. - count = 0
  54. - @results_by_party.each do |row|
  55. - count += 1
  56. %tr
  57. %td.right= count
  58. %td{ :style => "background-color: #{row['party_colour'] }" } &nbsp;
  59. %td= row['party_name']
  60. - if @election_held
  61. %td.right.highlight= row['num_seats']
  62. - else
  63. %td.right.highlight &mdash;
  64. %td.right= row['num_candidates']
  65. - if @election_held
  66. %td.right= commify(row['total_votes'])
  67. %td.right= format_percent(row['total_votes'].to_f / @total_votes * 100)
  68. - else
  69. %td.right &mdash;
  70. %td.right &mdash;
  71. %tr.footer
  72. %td &nbsp;
  73. %td &nbsp;
  74. %td &nbsp;
  75. - if @election_held
  76. %td.right.highlight= @total_seats
  77. - else
  78. %td.right.highlight &nbsp;
  79. %td.right= @total_candidates
  80. %td.right= commify(@total_votes)
  81. %td &nbsp;
  82. %h2 Votes by candidate
  83. %table
  84. %tr.header
  85. %th &nbsp;
  86. %th &nbsp;
  87. %th &nbsp;
  88. %th &nbsp;
  89. %th.right votes
  90. %th.right % votes
  91. %th &nbsp;
  92. - count = 0
  93. - @candidacies.each do |candidacy|
  94. - count += 1
  95. %tr.vcard
  96. %td= count
  97. %td{ :style => "background-color: #{candidacy.party.colour}" } &nbsp;
  98. %td.candidate_name.fn
  99. %a{ :href => "/candidates/#{candidacy.candidate.id}" }
  100. = candidacy.candidate.short_name
  101. %td.org
  102. = party_name(candidacy.labcoop, candidacy.party.name)
  103. - if @election_held
  104. %td.right= commify(candidacy.votes)
  105. %td.right= format_percent(candidacy.votes.to_f / @total_votes * 100)
  106. - if candidacy.seats == 1
  107. %td.elected="Elected"
  108. - else
  109. %td &nbsp;
  110. - else
  111. %td.right &mdash;
  112. %td.right &mdash;
  113. %td
  114. %tr.footer
  115. %td &nbsp;
  116. %td &nbsp;
  117. %td &nbsp;
  118. %td &nbsp;
  119. %td.right= commify(@total_votes)
  120. %td &nbsp;
  121. %td &nbsp;