Browse Source

Add polling stations page

tags/last-sinatra-version
Adrian Short 10 years ago
parent
commit
ddfff973e5
3 changed files with 25 additions and 0 deletions
  1. +5
    -0
      app.rb
  2. +2
    -0
      views/layout.haml
  3. +18
    -0
      views/pollingstations.haml

+ 5
- 0
app.rb View File

@@ -307,6 +307,11 @@ end
# haml :aliens
# end

get '/polling-stations' do
@stations = PollingStation.all
haml :pollingstations
end

not_found do
haml :not_found
end

+ 2
- 0
views/layout.haml View File

@@ -24,6 +24,8 @@
%a{ :href => '/bodies' } Bodies
%p
%a{ :href => '/candidates' } Candidates
%p
%a{ :href => '/polling-stations' } Polling stations
%p
%a{ :href => '/how-the-parliament-election-works' } How parliamentary elections work
%p


+ 18
- 0
views/pollingstations.haml View File

@@ -0,0 +1,18 @@
%h1 Polling Stations

.warning
%p If you've got a postal vote but haven't posted it yet, you can take it to ANY polling station before 10PM tonight (Thursday 22 May 2014).
%p
If you've got an ordinary vote (not postal) you MUST vote at the right polling station for your address. Use the
%a{ :href => "/" }
postcode search box
on the home page to find your polling station and the candidates for your ward.

%table
- @stations.each do |s|
%tr
%td
%a{ :href => "http://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=16" % [ s.lat, s.lng ]}
= s.name
%td= s.address
%td= s.postcode

Loading…
Cancel
Save