Added nil checks for call for papers in event index

Changed first / lastname to name

close #342
close #344
This commit is contained in:
Chrisbr
2014-07-21 12:36:15 +02:00
parent 609f2fd564
commit 9d54d0db93
3 changed files with 5 additions and 6 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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=""