Public schedule adapted to the new relations

Public schedule and all events adapted to the new relations and models to allow having several schedules in the admin shcedule.
This commit is contained in:
Ana 2016-07-20 23:20:47 +02:00
parent 8f3dcda2f7
commit 2aee0158f8
12 changed files with 70 additions and 60 deletions

View file

@ -17,7 +17,7 @@
- if @event.state == 'canceled' || @event.state == 'withdrawn'
%span.label.label-danger CANCELED
- elsif @event.state == 'confirmed' && (!@event.intersecting_events.canceled.empty? || !@event.intersecting_events.withdrawn.empty?)
- elsif @event.state == 'confirmed' && @event_schedule.present? && (!@event_schedule.intersecting_events.canceled.empty? || !@event_schedule.intersecting_events.withdrawn.empty?)
%span.label.label-info REPLACEMENT
.row
@ -40,15 +40,16 @@
.col-md-9
.row
.col-md-12
.lead
- if @event.state == 'confirmed' && !@event.intersecting_events.withdrawn.empty?
= "Please note that this talk replaces"
= link_to @event.intersecting_events.withdrawn.first.title,
conference_program_proposal_path(@conference.short_title, @event.intersecting_events.withdrawn.first.id)
- elsif @event.state == 'confirmed' && !@event.intersecting_events.canceled.empty?
= "Please note that this talk replaces"
= link_to @event.intersecting_events.canceled.first.title,
conference_program_proposal_path(@conference.short_title, @event.intersecting_events.canceled.first.id)
-if @event_schedule.present?
.lead
- if @event.state == 'confirmed' && !@event_schedule.intersecting_events.withdrawn.empty?
= "Please note that this talk replaces"
= link_to @event_schedule.intersecting_events.withdrawn.first.event.title,
conference_program_proposal_path(@conference.short_title, @event_schedule.intersecting_events.withdrawn.first.event.id)
- elsif @event.state == 'confirmed' && !@event_schedule.intersecting_events.canceled.empty?
= "Please note that this talk replaces"
= link_to @event_schedule.intersecting_events.canceled.first.title,
conference_program_proposal_path(@conference.short_title, @event_schedule.intersecting_events.canceled.first.event.id)
- if @event.commercials.empty?
%h5.text-warning
@ -67,7 +68,7 @@
%dl#proposal-info
.col-md-12
%dt Date:
%dd= @event.scheduled_start_time.strftime("%Y %B %e %H:%M") if @event.scheduled_start_time.present?
%dd= @event_schedule.start_time.strftime("%Y %B %e %H:%M") if @event_schedule.try(:start_time)
.col-md-12
%dt Duration:
%dd= show_time(@event.event_type.length)