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.
 
 
 
 

112 lignes
3.0 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. %h2 Votes by party
  29. %table
  30. %tr.header
  31. %th
  32. %th
  33. %th
  34. %th.right.highlight seats won
  35. %th candidates
  36. %th.right votes
  37. %th.right % votes
  38. - count = 0
  39. - @results_by_party.each do |row|
  40. - count += 1
  41. %tr
  42. %td.right= count
  43. %td{ :style => "background-color: #{row['party_colour'] }" } &nbsp;
  44. %td= row['party_name']
  45. %td.right.highlight= row['num_seats']
  46. %td.right= row['num_candidates']
  47. %td.right= commify(row['total_votes'])
  48. %td.right= format_percent(row['total_votes'].to_f / @total_votes * 100)
  49. %tr.footer
  50. %td
  51. %td
  52. %td
  53. %td.right.highlight= @total_seats
  54. %td.right= @total_candidates
  55. %td.right= commify(@total_votes)
  56. %td
  57. %h2 Votes by candidate
  58. %table
  59. %tr.header
  60. %th
  61. %th
  62. %th
  63. %th.right votes
  64. %th.right % votes
  65. %th
  66. - count = 0
  67. - for candidacy in @candidacies
  68. - count += 1
  69. %tr.vcard
  70. %td= count
  71. %td{ :style => "background-color: #{candidacy.party.colour}" } &nbsp;
  72. %td
  73. %span.candidate_name.fn
  74. %a{ :href => "/candidates/#{candidacy.candidate.id}" }
  75. = candidacy.candidate.short_name
  76. %br
  77. %span.candidate_party.org
  78. = candidacy.party.name
  79. %td.right= commify(candidacy.votes)
  80. %td.right= format_percent(candidacy.votes.to_f / @total_votes * 100)
  81. %td
  82. - if candidacy.seats == 1
  83. .elected ELECTED
  84. %tr.footer
  85. %td
  86. %td
  87. %td
  88. %td.right= commify(@total_votes)
  89. %td
  90. %td
  91. %td