diff --git a/.gems b/.gems index 7fdbafe..3ff70d8 100644 --- a/.gems +++ b/.gems @@ -1,2 +1,3 @@ pat --source gemcutter.org +sbfaulkner-sinatra-helpers -s http://gems.github.com diff --git a/app.rb b/app.rb index 297b50f..316fcaa 100644 --- a/app.rb +++ b/app.rb @@ -1,5 +1,6 @@ require 'rubygems' require 'sinatra' +require 'sinatra-helpers/haml/partials' require 'haml' require 'pat' require 'dm-core' @@ -39,6 +40,10 @@ get '/how-the-council-election-works' do haml :election end +get '/how-the-parliament-election-works' do + haml :parliament +end + # get '/voting' do # haml :voting # end diff --git a/public/print.css b/public/print.css new file mode 100644 index 0000000..b38d335 --- /dev/null +++ b/public/print.css @@ -0,0 +1,9 @@ +.noprint, #footer +{ + display: none; +} + +body +{ + margin: 0 auto; +} \ No newline at end of file diff --git a/public/style.css b/public/style.css index c3be318..bbd040b 100644 --- a/public/style.css +++ b/public/style.css @@ -41,7 +41,7 @@ input.postcode font-size: 100%; background-color: #fff; text-align: left; - margin: 40px 0; + margin: 40px 0 0 0; } .credit @@ -54,7 +54,7 @@ input.postcode a, a:visited { background-color: #d9ec96; - padding: 2px 5px; + padding: 1px 4px; color: #111; text-decoration: none; } @@ -62,7 +62,7 @@ a, a:visited a:hover { background-color: #4f4f4f; - color: #86a11d; + color: #fff; } a.date @@ -82,7 +82,7 @@ a.date h1 { margin-top: 20px; - line-height: 1.5em; + line-height: 1.4em; font-weight: bold; color: #86a11d; } diff --git a/views/_register-to-vote.haml b/views/_register-to-vote.haml new file mode 100644 index 0000000..5cdf0a0 --- /dev/null +++ b/views/_register-to-vote.haml @@ -0,0 +1,12 @@ +%h2 Register to vote + +%p + If you're not already registered to vote you must do so by + %strong 20 April + otherwise you won't be able to take part. + +%p + You can get a registration form at the + %a{ :href => "http://www.aboutmyvote.co.uk/" } About My Vote + website or by phoning Sutton Council on + %span{ :class => 'phone' } 020 8770 4888. \ No newline at end of file diff --git a/views/about.haml b/views/about.haml index 2dc17c5..908d058 100644 --- a/views/about.haml +++ b/views/about.haml @@ -3,12 +3,12 @@ %p This website was designed and written by - %a{ :href => 'http://adrianshort.co.uk' }> Adrian Short + %a{ :href => 'http://adrianshort.co.uk' } Adrian Short \. You can contact me by email at - %a{ :href => "mailto:adrian.short@gmail.com" }< adrian.short@gmail.com + %a{ :href => "mailto:adrian.short@gmail.com" } adrian.short@gmail.com and - %a{ :href => "http://twitter.com/adrianshort" } "http://twitter.com/adrianshort" } follow me on Twitter \. %p.highlight This site is independent of Sutton Council, all political parties and candidates. diff --git a/views/election.haml b/views/election.haml index de0c2ef..e3f4991 100644 --- a/views/election.haml +++ b/views/election.haml @@ -13,16 +13,4 @@ %p If a political party gets 28 or more councillors they get to run Sutton Council and decide its policies and services until the next election in four years time. - - %h2 Register to vote - - %p - If you're not already registered to vote you must do so by - %strong 20 April - otherwise you won't be able to take part. - - %p - You can get a registration form at the - %a{ :href => "http://www.aboutmyvote.co.uk/" } About My Vote - website or by phoning Sutton Council on - %span{ :class => 'phone' } 020 8770 4888. \ No newline at end of file + = haml_partial('register-to-vote') diff --git a/views/layout.haml b/views/layout.haml index b13b097..981613c 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -4,6 +4,7 @@ %head %title Sutton Elections 6 May 2010 %link{ :rel => 'stylesheet', :type => 'text/css', :href => '/style.css' } + %link{ :rel => 'stylesheet', :type => 'text/css', :href => '/print.css', :media => 'print' } %link{ :rel => 'stylesheet', :type => 'text/css', :href => '/grid.css' } @@ -20,6 +21,8 @@ .grid_12 %p %a{ :href => '/' } Home + %p + %a{ :href => '/how-the-parliament-election-works' } How the parliament election works %p %a{ :href => '/how-the-council-election-works' } How the council election works -# diff --git a/views/parliament.haml b/views/parliament.haml new file mode 100644 index 0000000..40ce590 --- /dev/null +++ b/views/parliament.haml @@ -0,0 +1,6 @@ +.grid_9 + %h1 How the parliament election works + + %p Text to follow… + + = haml_partial('register-to-vote') \ No newline at end of file diff --git a/views/wards.haml b/views/wards.haml index 317e399..afac922 100644 --- a/views/wards.haml +++ b/views/wards.haml @@ -7,7 +7,7 @@ .grid_6 %h1 = @ward.constituency.name - member of parliament + MP candidates .grid_6 %h1 @@ -21,8 +21,8 @@ You can vote for %strong ONE - of these people to become your next MP. - %p + of these people to become your member of parliament. + %p.noprint Find out more about %a{ :href => '/how-the-parliament-election-works' } how the parliament election works. @@ -32,7 +32,7 @@ %strong THREE of these people to become your local councillors. - %p + %p.noprint Find out more about %a{ :href => '/how-the-council-election-works' } how the council election works.