Browse Source

Show results rather than candidate pages

tags/last-sinatra-version
Adrian Short 10 years ago
parent
commit
52c6cd8a46
4 changed files with 9 additions and 10 deletions
  1. +1
    -1
      app.rb
  2. +1
    -1
      public/style.css
  3. +2
    -2
      views/index.haml
  4. +5
    -6
      views/layout.haml

+ 1
- 1
app.rb View File

@@ -81,7 +81,7 @@ get '/' do
@p.polling_station.address, @p.polling_station.postcode]
end

redirect "/bodies/sutton-council/wards/#{@ward.slug}"
redirect "/bodies/sutton-council/elections/2014-05-22/wards/#{@ward.slug}"
else
flash.now[:error] = "<strong>#{@postcode}</strong> is not a postcode in Sutton"
end


+ 1
- 1
public/style.css View File

@@ -294,4 +294,4 @@ tr
background-color: beige;
border: 1px solid green;
padding: 20px 20px;
}
}

+ 2
- 2
views/index.haml View File

@@ -2,11 +2,11 @@

#lookup
%h2
Vote for your local councillors in Sutton on 22 May 2014
Sutton Council local election results 22 May 2014
%form{ :method => 'get', :action => '/' }
%label{ :for => "postcode" } My postcode is
%input{ :type => 'text', :name => 'postcode', :value => @default_pc, :size => 8, :maxlength => 8 }
%input{ :type => 'submit', :value => "Find my candidates" }
%input{ :type => 'submit', :value => "Find my results" }

- if @future_elections.size > 0



+ 5
- 6
views/layout.haml View File

@@ -14,12 +14,11 @@
- if flash[:error]
#error
%p= flash[:error]
.warning
%h1 Local and European Elections 22 May 2014
%p Polling closed today at 10PM. If you haven't already voted you cannot vote in this election.
%p Results in the Sutton Council election are expected at around 4AM Friday 23 May.
%p Results in the European Parliament election are expected on Sunday 25 May late afternoon/evening.
%p Check back here soon for the local election results.
-#
.warning
%h1 Local and European Elections 22 May 2014
%p Results in the Sutton Council election are now available on this website.
%p Results in the European Parliament election are expected on Sunday 25 May late afternoon/evening.
= yield
#footer
#footer_inner


Loading…
Cancel
Save