소스 검색

Text improvements

tags/last-sinatra-version
Adrian Short 14 년 전
부모
커밋
afd45278bd
7개의 변경된 파일72개의 추가작업 그리고 28개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

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

.highlight
{
background-color: yellow;
}

+ 1
- 1
views/about.haml 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

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

불러오는 중...
취소
저장