Unscheduled events added to all events

Unscheduled events added to all events of the schedule
This commit is contained in:
Ana 2016-06-11 00:43:45 +02:00
parent 69043e1549
commit cc031b9f3a
4 changed files with 27 additions and 0 deletions

View file

@ -171,6 +171,9 @@ td.no-padding{
margin-top: 20px;
}
.unscheduled-event{
margin-top: 8px;
}
.all-speaker-pic{
padding: 20px 10px 20px 10px;

View file

@ -22,6 +22,7 @@ class ConferenceController < ApplicationController
@conf_period = conf_end - @conf_start
@scheduled_events = @conference.program.events.scheduled
@unscheduled_events = @conference.program.events.unscheduled
if @dates == Date.current
@today = Date.current.strftime('%Y-%m-%d')

View file

@ -30,6 +30,10 @@ class Program < ActiveRecord::Base
where.not(start_time: nil).where.not(room: nil).order(start_time: :asc)
end
def unscheduled
confirmed.where('start_time IS NULL OR room_id IS NULL')
end
def highlights
where(state: :confirmed, is_highlight: true)
end

View file

@ -1,5 +1,7 @@
<h1 class="text-center">Program for <%= @conference.title %></h1>
<div class="row">
<!-- scheduled events -->
<% date = nil %>
<% time = nil %>
<% @scheduled_events.each do |event| %>
@ -26,4 +28,21 @@
</div>
<% end %>
<% end %>
<!-- confirmed events that are not scheduled -->
<% if @unscheduled_events.any? %>
<div class='col-xs-12 col-md-12 all-events-title'>
<span class='date-title' id='program-unscheduled'>
Unscheduled events
</span>
<a title="Go up" class="pull-right" href="#program">
<i class="fa fa-angle-double-up fa-lg" aria-hidden="true"></i>
</a>
</div>
<% end %>
<% @unscheduled_events.each do |event| %>
<div class='col-xs-12 col-md-12 unscheduled-event'>
<%= render partial: 'event', locals: {event: event} %>
</div>
<% end %>
</div>