Ver código fonte

Text improvements

tags/last-sinatra-version
Adrian Short 14 anos atrás
pai
commit
afd45278bd
7 arquivos alterados com 72 adições e 28 exclusões
  1. +7
    -8
      app.rb
  2. +4
    -1
      lib/models.rb
  3. +5
    -0
      public/style.css
  4. +1
    -1
      views/about.haml
  5. +14
    -3
      views/home.haml
  6. +2
    -2
      views/layout.haml
  7. +39
    -13
      views/wards.haml

+ 7
- 8
app.rb Ver arquivo

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

+ 4
- 1
lib/models.rb Ver arquivo

@@ -55,4 +55,7 @@ class Constituency
property :name, String, :required => true
has n, :wards
end
end

DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3")
DataMapper.auto_upgrade!

+ 5
- 0
public/style.css Ver arquivo

@@ -83,4 +83,9 @@ h1
.candidate_name
{
font-size: 150%;
}

.highlight
{
background-color: yellow;
}

+ 1
- 1
views/about.haml Ver arquivo

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


+ 14
- 3
views/home.haml Ver arquivo

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


+ 2
- 2
views/layout.haml Ver arquivo

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


+ 39
- 13
views/wards.haml Ver arquivo

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

Carregando…
Cancelar
Salvar