From 9d54d0db93b2173b9ddebfa8e820d415da28bdf5 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 21 Jul 2014 12:36:15 +0200 Subject: [PATCH] Added nil checks for call for papers in event index Changed first / lastname to name close #342 close #344 --- app/views/admin/events/_proposal.html.haml | 2 +- app/views/admin/events/_voting.html.haml | 3 +-- app/views/admin/events/index.html.haml | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 77b24a52..2a1131ce 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -107,7 +107,7 @@ %b Description %td= simple_format(@event.description) - - if @conference.call_for_papers.rating > 0 + - if @conference.call_for_papers && @conference.call_for_papers.rating && @conference.call_for_papers.rating > 0 = render :partial => "voting" - if @event.event_attachments.size > 0 diff --git a/app/views/admin/events/_voting.html.haml b/app/views/admin/events/_voting.html.haml index 2b6d431b..c9277796 100644 --- a/app/views/admin/events/_voting.html.haml +++ b/app/views/admin/events/_voting.html.haml @@ -40,8 +40,7 @@ - unless rate.user_id == current_user.id %tr %td - = rate.first_name - = rate.last_name + = rate.name %td - @conference.call_for_papers.rating.times do |counter| - voted = @event.voted?(@event, rate.user) diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 88a7c108..1a979d7f 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -13,7 +13,7 @@ %b ID %th %b Title - - unless @conference.call_for_papers.blank? or !(@conference.call_for_papers.rating > 0) + - if @conference.call_for_papers && @conference.call_for_papers.rating && @conference.call_for_papers.rating > 0 %th %b Rating %th @@ -35,7 +35,7 @@ %td =link_to event.title, admin_conference_event_path(@conference.short_title, event) - - if @conference.call_for_papers.rating != 0 + - if @conference.call_for_papers && @conference.call_for_papers.rating && @conference.call_for_papers.rating > 0 %td{:style => "width:96px"} - if event.average_rating.to_f > 0 #{event.average_rating}/#{@conference.call_for_papers.rating} @@ -52,7 +52,7 @@ 0/#{@conference.call_for_papers.rating} %br - - if event.submitter.registrations.count < 1 + - if event.submitter && event.submitter.registrations && event.submitter.registrations.count < 1 - bgcolor="#F7819F" - else - bgcolor=""