Parcourir la source

Add polling stations page

tags/last-sinatra-version
Adrian Short il y a 10 ans
Parent
révision
ddfff973e5
3 fichiers modifiés avec 25 ajouts et 0 suppressions
  1. +5
    -0
      app.rb
  2. +2
    -0
      views/layout.haml
  3. +18
    -0
      views/pollingstations.haml

+ 5
- 0
app.rb Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

@@ -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

Chargement…
Annuler
Enregistrer