From 8ca2e534305e5d1b0d5bc990cf7fc7a2daf8088f Mon Sep 17 00:00:00 2001 From: Stella Date: Sat, 28 Dec 2013 16:20:00 +0200 Subject: [PATCH] show voting options only if rating is enabled (>0) --- app/views/admin/events/_proposal.html.haml | 2 +- app/views/admin/events/index.html.haml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 0248ec3c..1e931836 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -142,7 +142,7 @@ %td = link_to "Delete", conference_proposal_event_attachment_path(@conference.short_title, @event.id, a.id), :method => :delete, :confirm => "Are you sure you want to delete this attachment? It's permanant!" -- if @conference.call_for_papers.rating +- if @conference.call_for_papers.rating > 0 .row-fluid = link_to "Votes (#{@event.voters.length})", "#", :id => "votes-link" #votes-div diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 58ec1b5f..e5fd2047 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -32,7 +32,7 @@ %td =link_to event.title, admin_conference_event_path(@conference.short_title, event) %td - - if @conference.call_for_papers.rating + - if @conference.call_for_papers.rating != 0 - if event.average_rating.to_f > 0 Rating: (#{event.average_rating}/#{@conference.call_for_papers.rating}) - else @@ -45,6 +45,8 @@ = 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"