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; 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) */ /* Small devices (tablets, 768px and up) */
@media (min-width: 768px) { @media (min-width: 768px) {
.room, .event-title{ .room, .event-title{

View file

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

View file

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

View file

@ -27,7 +27,7 @@ class Program < ActiveRecord::Base
end end
def scheduled 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 end
def highlights def highlights

View file

@ -1,19 +1,29 @@
<h1 class="text-center">Program for <%= @conference.title %></h1> <h1 class="text-center">Program for <%= @conference.title %></h1>
<% @conference.program.events.confirmed.each do |event| %> <div class="row">
<div> <% date = nil %>
<h3> <% time = nil %>
<%= link_to event.title, conference_program_proposal_path(@conference.short_title, event.id) %> <% @scheduled_events.each do |event| %>
<br> <% unless event.start_time.strftime('%Y-%m-%d').eql?(date) %>
<small> <div class='col-xs-12 col-md-12 all-events-title'>
<%= event.subtitle %> <span class='date-title' id='program-<%= event.start_time.strftime('%Y-%m-%d') %>'>
</small> <%= date = event.start_time.strftime('%Y-%m-%d') %>
</h3> </span>
<h4> <a title="Go up" class="pull-right" href="#program">
presented by <%= event.speaker_names %> <i class="fa fa-angle-double-up fa-lg" aria-hidden="true"></i>
</h4> </a>
<p> </div>
<%= truncate(event.abstract, :length => 400) -%> <% end %>
<%= link_to 'more', conference_program_proposal_path(@conference.short_title, @conference.program.id, event.id) if event.abstract.length > 400 %> <% unless event.start_time.strftime('%H:%M').eql?(time) %>
</p> <div class='col-xs-12 col-md-1 start-time'>
</div> <%= time = event.start_time.strftime('%H:%M') %>
<% end %> </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