All events grouped by date and time

The events are ordered by date and time in the all events section of the schedule. The event schdule definition in program has been changed to order the events.
This commit is contained in:
Ana 2016-06-10 22:39:06 +02:00
parent 7a95c43a57
commit 69043e1549
6 changed files with 97 additions and 20 deletions

View file

@ -149,6 +149,38 @@ td.no-padding{
padding:0px !important;
}
.all-events-title{
margin-top: 40px;
border-bottom: 1px solid #848484;
}
.date-title{
font-size: 23px;
font-weight: bold;
padding-bottom: 2px;
display:inline-block;
}
.start-time{
font-size: 16px;
padding-left: 30px;
margin-top: 32px;
}
.new-time-event{
margin-top: 20px;
}
.all-speaker-pic{
padding: 20px 10px 20px 10px;
}
.track{
padding: 0px 5px 0px 5px;
display: inline-block;
}
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
.room, .event-title{

View file

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

View file

@ -73,7 +73,7 @@ class Event < ActiveRecord::Base
# ====Returns
# * +true+ or +false+
def scheduled?
room && start_time ? true : false
room.present? && start_time.present?
end
def registration_possible?

View file

@ -27,7 +27,7 @@ class Program < ActiveRecord::Base
end
def scheduled
where.not(start_time: nil).where.not(room: nil)
where.not(start_time: nil).where.not(room: nil).order(start_time: :asc)
end
def highlights

View file

@ -1,19 +1,29 @@
<h1 class="text-center">Program for <%= @conference.title %></h1>
<% @conference.program.events.confirmed.each do |event| %>
<div>
<h3>
<%= link_to event.title, conference_program_proposal_path(@conference.short_title, event.id) %>
<br>
<small>
<%= event.subtitle %>
</small>
</h3>
<h4>
presented by <%= event.speaker_names %>
</h4>
<p>
<%= truncate(event.abstract, :length => 400) -%>
<%= link_to 'more', conference_program_proposal_path(@conference.short_title, @conference.program.id, event.id) if event.abstract.length > 400 %>
</p>
</div>
<% end %>
<div class="row">
<% date = nil %>
<% time = nil %>
<% @scheduled_events.each do |event| %>
<% unless event.start_time.strftime('%Y-%m-%d').eql?(date) %>
<div class='col-xs-12 col-md-12 all-events-title'>
<span class='date-title' id='program-<%= event.start_time.strftime('%Y-%m-%d') %>'>
<%= date = event.start_time.strftime('%Y-%m-%d') %>
</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 %>
<% unless event.start_time.strftime('%H:%M').eql?(time) %>
<div class='col-xs-12 col-md-1 start-time'>
<%= time = event.start_time.strftime('%H:%M') %>
</div>
<div class='col-xs-12 col-md-11 new-time-event'>
<%= render partial: 'event', locals: {event: event} %>
</div>
<% else %>
<div class='col-xs-12 col-md-11 col-md-offset-1'>
<%= render partial: 'event', locals: {event: event} %>
</div>
<% end %>
<% end %>
</div>

View file

@ -0,0 +1,33 @@
%a.unstyled-link{href: url_for(conference_program_proposal_path(@conference.short_title, event.id))}
.panel.panel-default
.panel-body
- if speaker = event.speakers.first
= image_tag speaker.gravatar_url, :class => "img-circle pull-right all-speaker-pic", |
:alt => speaker.name, |
:title => speaker.name |
%span.h3
= event.title
%br
%small
= event.subtitle
%h4
presented by #{event.speaker_names}
%p
= truncate(event.abstract, :length => 400)
= link_to 'more', conference_program_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400
- if event.scheduled?
%span.track
%span.fa.fa-clock-o
%span.label{ style: "background-color: grey" }
= event.start_time.strftime('%H:%M')
\-
= event.end_time.strftime('%H:%M')
%span.track
%span.fa.fa-map-marker
%span.label{ style: "background-color: grey" }
= event.room.name
- if event.track
%span.track
%span.fa.fa-road
%span.label{ style: "background-color: #{event.track.color}" }
= event.track.name