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 %b Description
%td= simple_format(@event.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" = render :partial => "voting"
- if @event.event_attachments.size > 0 - if @event.event_attachments.size > 0

View file

@ -40,8 +40,7 @@
- unless rate.user_id == current_user.id - unless rate.user_id == current_user.id
%tr %tr
%td %td
= rate.first_name = rate.name
= rate.last_name
%td %td
- @conference.call_for_papers.rating.times do |counter| - @conference.call_for_papers.rating.times do |counter|
- voted = @event.voted?(@event, rate.user) - voted = @event.voted?(@event, rate.user)

View file

@ -13,7 +13,7 @@
%b ID %b ID
%th %th
%b Title %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 %th
%b Rating %b Rating
%th %th
@ -35,7 +35,7 @@
%td %td
=link_to event.title, admin_conference_event_path(@conference.short_title, event) =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"} %td{:style => "width:96px"}
- if event.average_rating.to_f > 0 - if event.average_rating.to_f > 0
#{event.average_rating}/#{@conference.call_for_papers.rating} #{event.average_rating}/#{@conference.call_for_papers.rating}
@ -52,7 +52,7 @@
0/#{@conference.call_for_papers.rating} 0/#{@conference.call_for_papers.rating}
%br %br
- if event.submitter.registrations.count < 1 - if event.submitter && event.submitter.registrations && event.submitter.registrations.count < 1
- bgcolor="#F7819F" - bgcolor="#F7819F"
- else - else
- bgcolor="" - bgcolor=""