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,15 +5,14 @@
%br
%span.muted
= @event.subtitle
.span2
= link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-primary"
.row-fluid
.span12
%table.table
%tr
%td{:style => "width:20%"}
%td{:style => "width:15%"}
%b Type
%td
.dropdown
@ -114,8 +113,8 @@
%b Description
%td= simple_format(@event.description)
- if @conference.call_for_papers.rating > 0
= render :partial => "voting"
- if @conference.call_for_papers.rating > 0
= render :partial => "voting"
- if @event.event_attachments.size > 0
%table.table

View file

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

View file

@ -13,8 +13,9 @@
%b ID
%th
%b Title
%th
%b Rating
- if @conference.call_for_papers.rating != 0
%th
%b Rating
%th
%b Submitter
%th
@ -31,25 +32,24 @@
= event.id
%td
=link_to event.title, admin_conference_event_path(@conference.short_title, event)
%td{:style => "width:96px"}
- if @conference.call_for_papers.rating != 0
- if @conference.call_for_papers.rating != 0
%td{:style => "width:96px"}
- if event.average_rating.to_f > 0
Rating: #{event.average_rating}/#{@conference.call_for_papers.rating}
%b #{event.average_rating}/#{@conference.call_for_papers.rating}
%br
Voters: #{event.voters.length}
#{pluralize(event.voters.length, 'voter')}
%br
- @conference.call_for_papers.rating.times do |counter|
- if event.average_rating.to_f.round == counter+1
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
- else
= label_tag "label_rating", "", :class => "avgrating"
- else
Rating: 0/#{@conference.call_for_papers.rating}
%br
- @conference.call_for_papers.rating.times do |counter|
- if event.average_rating.to_f.round == counter+1
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
- else
= label_tag "label_rating", "", :class => "avgrating"
- else
= link_to "(enable voting)", admin_conference_cfp_info_path(@conference.short_title)
- if event.submitter.registrations.count < 1
- bgcolor="#F7819F"
- else