From 68c119b4436ad183d6a994c7d5cc0338717f988f Mon Sep 17 00:00:00 2001 From: Stella Date: Sun, 2 Mar 2014 10:36:22 +0200 Subject: [PATCH] fixed table width, no td in index if no voting options --- app/views/admin/events/_proposal.html.haml | 9 +++---- app/views/admin/events/_voting.html.haml | 14 +++++----- app/views/admin/events/index.html.haml | 30 +++++++++++----------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 986450ba..35396a13 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -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 diff --git a/app/views/admin/events/_voting.html.haml b/app/views/admin/events/_voting.html.haml index 8353bbc4..b7af6aaf 100644 --- a/app/views/admin/events/_voting.html.haml +++ b/app/views/admin/events/_voting.html.haml @@ -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) diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index cba87136..33b2709d 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -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