fixed table width, no td in index if no voting options

This commit is contained in:
Stella 2014-03-02 10:36:22 +02:00
parent 0dbd513c8a
commit 68c119b443
3 changed files with 27 additions and 26 deletions

View file

@ -5,7 +5,6 @@
%br %br
%span.muted %span.muted
= @event.subtitle = @event.subtitle
.span2 .span2
= link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary" = link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary"
@ -13,7 +12,7 @@
.span12 .span12
%table.table %table.table
%tr %tr
%td{:style => "width:20%"} %td{:style => "width:15%"}
%b Type %b Type
%td %td
.dropdown .dropdown

View file

@ -1,12 +1,12 @@
%table.table#myrating %table.table#myrating
%tr %tr
%td{:style => "width:20%"} %td{:style => "width:15%"}
%b Rating %b Rating
%td %td
- if @event.average_rating.to_f > 0 - if @event.average_rating.to_f > 0
#{@event.average_rating}/#{@conference.call_for_papers.rating} #{@event.average_rating}/#{@conference.call_for_papers.rating}
- else - else
Rating: (0/#{@conference.call_for_papers.rating}) Rating: 0/#{@conference.call_for_papers.rating}
- @conference.call_for_papers.rating.times do |counter| - @conference.call_for_papers.rating.times do |counter|
- if @event.average_rating.to_f.round == counter+1 - if @event.average_rating.to_f.round == counter+1
@ -19,11 +19,13 @@
%b Voters %b Voters
%td %td
= @event.voters.length = @event.voters.length
- if @event.voters.length > 0
( (
= @ratings.map {|x| "#{x.first_name} #{x.last_name}"}.join ', ' = @ratings.map {|x| "#{x.first_name} #{x.last_name}"}.join ', '
) )
%tr %tr
%td Your vote %td
%b Your vote
%td %td
- @conference.call_for_papers.rating.times do |counter| - @conference.call_for_papers.rating.times do |counter|
- voted = @event.voted?(@event, current_user.person) - voted = @event.voted?(@event, current_user.person)

View file

@ -13,6 +13,7 @@
%b ID %b ID
%th %th
%b Title %b Title
- if @conference.call_for_papers.rating != 0
%th %th
%b Rating %b Rating
%th %th
@ -31,16 +32,14 @@
= event.id = event.id
%td %td
=link_to event.title, admin_conference_event_path(@conference.short_title, event) =link_to event.title, admin_conference_event_path(@conference.short_title, event)
%td{:style => "width:96px"}
- if @conference.call_for_papers.rating != 0
- if event.average_rating.to_f > 0
Rating: #{event.average_rating}/#{@conference.call_for_papers.rating}
%br
Voters: #{event.voters.length}
- else
Rating: 0/#{@conference.call_for_papers.rating}
%br
- if @conference.call_for_papers.rating != 0
%td{:style => "width:96px"}
- if event.average_rating.to_f > 0
%b #{event.average_rating}/#{@conference.call_for_papers.rating}
%br
#{pluralize(event.voters.length, 'voter')}
%br
- @conference.call_for_papers.rating.times do |counter| - @conference.call_for_papers.rating.times do |counter|
- if event.average_rating.to_f.round == counter+1 - if event.average_rating.to_f.round == counter+1
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true = label_tag "label_rating", "", :class => "avgrating", :avgrate => true
@ -48,7 +47,8 @@
- else - else
= label_tag "label_rating", "", :class => "avgrating" = label_tag "label_rating", "", :class => "avgrating"
- else - else
= link_to "(enable voting)", admin_conference_cfp_info_path(@conference.short_title) Rating: 0/#{@conference.call_for_papers.rating}
%br
- if event.submitter.registrations.count < 1 - if event.submitter.registrations.count < 1
- bgcolor="#F7819F" - bgcolor="#F7819F"