Pārlūkot izejas kodu

Tweaks

tags/last-sinatra-version
Adrian Short pirms 14 gadiem
vecāks
revīzija
170fe79f5c
3 mainītis faili ar 22 papildinājumiem un 7 dzēšanām
  1. +3
    -3
      app.rb
  2. +16
    -1
      views/home.haml
  3. +3
    -3
      views/resultsukparliament.haml

+ 3
- 3
app.rb Parādīt failu

@@ -48,9 +48,9 @@ get '/results/uk-parliament/2010-05-06/:constituency' do
else
const = 2
end
@constituency = Constituency.get(const)
@candidates = Parliamentcandidate.all(:constituency_id => const, :order => [ :votes_2010.desc ])
@total_2010 = Parliamentcandidate.sum(:votes_2010, :constituency_id => const)
@constituency = Constituency.get(const)
@candidates = Parliamentcandidate.all(:constituency_id => const, :order => [ :votes_2010.desc ])
@total_2010 = Parliamentcandidate.sum(:votes_2010, :constituency_id => const)
haml :resultsukparliament
end



+ 16
- 1
views/home.haml Parādīt failu

@@ -1,4 +1,19 @@
.grid_9
.grid_12
%h1 Sutton Elections 6 May 2010
%h2 UK Parliament Election Results
-#
%p
%a{ :href => '/results/uk-parliament/2010-05-06/carshalton-and-wallington' } Carshalton and Wallington Constituency
%p
%a{ :href => '/results/uk-parliament/2010-05-06/sutton-and-cheam' } Sutton and Cheam Constituency
%h2 Sutton Council Election Results
%p
Votes for the Sutton Council election will be counted during the day on Friday 7 May. Results will appear here as soon as they are available.
-#
%h1
Vote for your MP and
%br


+ 3
- 3
views/resultsukparliament.haml Parādīt failu

@@ -12,9 +12,9 @@
%tr
%th
%th
%th Votes
%th %
%th Change
%th.right Votes
%th.right %
%th.right Change
- for candidate in @candidates
- count += 1
%tr.vcard


Notiek ielāde…
Atcelt
Saglabāt