Преглед изворни кода

Don't show results by party table if this poll only elects one candidate

tags/last-sinatra-version
Adrian Short пре 9 година
родитељ
комит
be94b22a3e
1 измењених фајлова са 46 додато и 45 уклоњено
  1. +46
    -45
      views/resultsdistrict.haml

+ 46
- 45
views/resultsdistrict.haml Прегледај датотеку

@@ -92,53 +92,54 @@
%a{ :href => "?wiki=dokuwiki" }
DokuWiki

%h2 Votes by party
- if @total_seats > 1
%h2 Votes by party

%table
%tr.header
%th  
%th  
%th  
%th.right.highlight seats won
%th candidates
%th.right votes
%th.right % votes
%th.right votes per candidate
- count = 0
%table
%tr.header
%th  
%th  
%th  
%th.right.highlight seats won
%th candidates
%th.right votes
%th.right % votes
%th.right votes per candidate
- count = 0
- @results_by_party.each do |row|
- count += 1
%tr
%td.right= count
%td{ :style => "background-color: #{row['party_colour'] }" }  
%td= row['party_name']
- if @election_held
%td.right.highlight= row['num_seats']
- else
%td.right.highlight —
%td.right= row['num_candidates']
- if @election_held
%td.right= commify(row['total_votes'])
%td.right= format_percent(row['total_votes'].to_f / @total_votes * 100)
%td.right= commify(row['total_votes'] / row['num_candidates'])
- else
%td.right —
%td.right —
%td.right —
- @results_by_party.each do |row|
- count += 1
%tr
%td.right= count
%td{ :style => "background-color: #{row['party_colour'] }" }  
%td= row['party_name']
- if @election_held
%td.right.highlight= row['num_seats']
- else
%td.right.highlight —
%td.right= row['num_candidates']
- if @election_held
%td.right= commify(row['total_votes'])
%td.right= format_percent(row['total_votes'].to_f / @total_votes * 100)
%td.right= commify(row['total_votes'] / row['num_candidates'])
- else
%td.right —
%td.right —
%td.right —
%tr.footer
%td  
%td  
%td  
- if @election_held
%td.right.highlight= @total_seats
- else
%td.right.highlight  
%td.right= @total_candidates
%td.right= commify(@total_votes)
%td  
%td  
%tr.footer
%td  
%td  
%td  
- if @election_held
%td.right.highlight= @total_seats
- else
%td.right.highlight  
%td.right= @total_candidates
%td.right= commify(@total_votes)
%td  
%td  

- if @poll
%p


Loading…
Откажи
Сачувај