diff --git a/app.rb b/app.rb index 599a849..9759b31 100644 --- a/app.rb +++ b/app.rb @@ -6,11 +6,8 @@ require 'dm-validations' require 'dm-timestamps' require 'lib/models' -DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3") -DataMapper.auto_upgrade! - get '/' do - @wards = Ward.all( :order => ['name'] ) +# @wards = Ward.all( :order => ['name' ] ) haml :home end @@ -30,7 +27,7 @@ get '/wards' do haml :wards end -get '/how-the-election-works' do +get '/how-the-council-election-works' do haml :election end @@ -41,16 +38,18 @@ end get '/about' do @accounts = %w{ adrianshort + stef + pezholio + countculture + understood mashthestate openlylocal openelection lbsuttonnews - stef + suttongisteam stonecothill sutmoblib mysociety - pezholio - stonecotparking } haml :about end diff --git a/lib/models.rb b/lib/models.rb index 766f410..d837a74 100644 --- a/lib/models.rb +++ b/lib/models.rb @@ -55,4 +55,7 @@ class Constituency property :name, String, :required => true has n, :wards -end \ No newline at end of file +end + +DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3") +DataMapper.auto_upgrade! \ No newline at end of file diff --git a/public/style.css b/public/style.css index 84c08ee..34ea4bd 100644 --- a/public/style.css +++ b/public/style.css @@ -83,4 +83,9 @@ h1 .candidate_name { font-size: 150%; +} + +.highlight +{ + background-color: yellow; } \ No newline at end of file diff --git a/views/about.haml b/views/about.haml index df11176..dcddbe8 100644 --- a/views/about.haml +++ b/views/about.haml @@ -10,7 +10,7 @@ The code for this website is open source and managed on Github. It is hosted by Heroku. %p - The candidates' data comes from Sutton Council. + The candidates' data comes from Sutton Council who also provided information on council wards and parliamentary constituencies. %p The postcode lookup is done by UK Postcodes using open data from Ordnance Survey Code-Point Open enhanced by MySociety. I use the Ruby Pat gem to access the postcodes API. diff --git a/views/home.haml b/views/home.haml index c272e93..4c1407b 100644 --- a/views/home.haml +++ b/views/home.haml @@ -1,6 +1,18 @@ --# %h2 One day. Two elections in Sutton. +%h1 One day. Two elections in Sutton. -%h2 Who are my local candidates in the Sutton Council elections on 6 May? +%p + On 6 May you can vote to + %strong + choose your local MP + and help to decide the next government of the country. + +%p + And you can also + %strong + elect your local councillors + and help to decide who runs Sutton Council. + +%p Who you can vote for depends on where you live. You can find your local candidates and get more information on how the elections work here. %form{ :method => 'get', :action => '/wards' } %label{ :for => "postcode" } My postcode is @@ -8,7 +20,6 @@ %input{ :type => 'submit', :value => "Find it" } -# - %h2 Council Wards - for ward in @wards diff --git a/views/layout.haml b/views/layout.haml index bab10ef..7c02cec 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -1,7 +1,7 @@ !!! %html %head - %title Sutton Council Elections 2010 + %title Sutton Elections 6 May 2010 %link{ :rel => 'stylesheet', :type => 'text/css', :href => '/style.css' } %body #header @@ -10,7 +10,7 @@ = yield #footer %p - %a{ :href => '/how-the-election-works' } How the council election works + %a{ :href => '/how-the-council-election-works' } How the council election works -# %p %a{ :href => '/voting' } How to vote diff --git a/views/wards.haml b/views/wards.haml index d7a0c91..e2b94e2 100644 --- a/views/wards.haml +++ b/views/wards.haml @@ -10,18 +10,44 @@ Ward %h2 + Your candidates for = @ward.constituency.name - Constituency + member of parliament + +%p + You can vote for + %strong + ONE + of these people to become your next MP. + + +%p.highlight + This list of candidates may be incomplete as people have until + %strong + 20 April + to decide whether they want to stand for election as the + = @ward.constituency.name + MP. + +%h2 + Your council candidates in + = @ward.name + Ward -#candidates - %h2 - Council candidates in - = @ward.name - - - for candidate in @candidates - %p - %span.candidate_name - = candidate.forenames - = candidate.surname - %br - = candidate.party.name \ No newline at end of file +%p + You can vote for + %strong + THREE + of these people to become your local councillors. + +%p + Find out more about + %a{ :href => '/how-the-council-election-works' } how the council election works. + +- for candidate in @candidates + %p + %span.candidate_name + = candidate.forenames + = candidate.surname + %br + = candidate.party.name \ No newline at end of file