Election results in the London Borough of Sutton.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

69 lines
2.1 KiB

  1. - page_title = "#{district.name} #{district.body.district_name}, #{district.body.name}"
  2. %nav
  3. %a{ :href => "/bodies/#{district.body.slug}" }
  4. « 
  5. = district.body.name
  6. %h1= "#{district.name} #{district.body.district_name}"
  7. -#
  8. - election = Election.get(9) # FIXME magic number
  9. %h2
  10. = district.name
  11. ward candidates for the
  12. %a{ :href => "/bodies/#{election.body.slug}/elections/#{election.d}"}
  13. = election.body.name
  14. election on
  15. = long_date(election.d)
  16. %table
  17. - Candidacy.all(:election => election, :district => district, :order => [:party_id]).each do |c|
  18. - campaign = Campaign.first(:party => c.party, :election => election)
  19. %tr.vcard
  20. %td{ :style => "background-color: #{c.party.colour}" }  
  21. %td.candidate_name.fn
  22. %a{ :href => "/candidates/#{c.candidate.id}" }
  23. = c.candidate.short_name
  24. %td.org
  25. - if campaign && campaign.party_url
  26. %a{ :href => campaign.party_url }
  27. = party_name(c.labcoop, c.party.name)
  28. - else
  29. = party_name(c.labcoop, c.party.name)
  30. %td
  31. - if campaign && campaign.manifesto_html_url
  32. %a{ :href => campaign.manifesto_html_url }
  33. manifesto
  34. - else
  35.  
  36. %h2 Candidates elected
  37. - Election.all(:body => district.body, :order => [:d.desc]).each do |election|
  38. - ccys = Candidacy.all(:election_id => election.id, :district_id => district.id, :seats => 1, :order => [:votes.desc])
  39. - unless ccys == []
  40. %h3
  41. %a{ :href => "/bodies/#{district.body.slug}/elections/#{election.d}/#{election.body.districts_name}/#{district.slug}"}
  42. = long_date election.d
  43. = election.kind
  44. %table
  45. %tr
  46. %th
  47. %th
  48. %th
  49. %th
  50. - ccys.each do |ccy|
  51. %tr
  52. %td= ccy.position
  53. %td{ :style => "background-color: #{ccy.party.colour}" }  
  54. %td
  55. %a{ :href => "/candidates/#{ccy.candidate.id}" }
  56. = ccy.candidate.short_name
  57. %td= ccy.party.name