diff --git a/app/assets/stylesheets/osem-schedule-print.css b/app/assets/stylesheets/osem-schedule-print.css index 54fc3593..3cbbb129 100644 --- a/app/assets/stylesheets/osem-schedule-print.css +++ b/app/assets/stylesheets/osem-schedule-print.css @@ -46,14 +46,8 @@ .event img, .img-circle { display: none; } -h5 { - font-size: 10px; - line-height: 12px; - margin: 0px; -} .table th, .table td { line-height: 12px; - padding: 3px; } .schedule-speaker { diff --git a/app/assets/stylesheets/osem-schedule.css.scss b/app/assets/stylesheets/osem-schedule.css.scss index 80511f33..f7dd5afa 100644 --- a/app/assets/stylesheets/osem-schedule.css.scss +++ b/app/assets/stylesheets/osem-schedule.css.scss @@ -75,3 +75,50 @@ a.unstyled-link { background-image: linear-gradient(to top, #f7faf2 24%, #53ab4a 97%, #53ab4a 100%); } + +.schedule-dropdown{ + margin-left: 20%; + margin-right: 20%; + margin-top: 20px; + margin-bottom: 20px; +} + +.schedule-dropdown > button{ + width: 100%; +} + +.schedule-dropdown > .dropdown-menu{ + width: 100%; +} + +.event-elipsis{ + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; /* number of lines to show */ +} + +.room-elipsis{ + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 4; /* number of lines to show */ +} + +.break-words{ + /* These are technically the same, but use both */ + overflow-wrap: break-word; + word-wrap: break-word; + + /* Warning: Needed for oldIE support, but words are broken up letter-by-letter */ + -ms-word-break: break-all; + word-break: break-all; + + /* Non standard for webkit */ + word-break: break-word; + + -ms-hyphens: auto; + -moz-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} diff --git a/app/controllers/conference_controller.rb b/app/controllers/conference_controller.rb index 25d55175..894e912e 100644 --- a/app/controllers/conference_controller.rb +++ b/app/controllers/conference_controller.rb @@ -17,6 +17,14 @@ class ConferenceController < ApplicationController @events_xml = @events.scheduled.order(start_time: :asc).group_by{ |event| event.start_time.to_date } @dates = @conference.start_date..@conference.end_date + @number_columns = 1 + @conf_start = 9 + conf_end = 20 + @intervals = @number_columns * 60 / EventType::LENGTH_STEP + 1 + @width = 85 / @intervals + @step_minutes = EventType::LENGTH_STEP.minutes + @carousel_number = ((conf_end - @conf_start) / @number_columns.to_f).ceil + if @dates == Date.current @today = Date.current.strftime('%Y-%m-%d') else diff --git a/app/models/conference.rb b/app/models/conference.rb index f0b73047..c90a8ea2 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -81,6 +81,16 @@ class Conference < ActiveRecord::Base result end + ## + # Check if there is any event in the program scheduled. + # + # ====Returns + # * +false+ -> If there aren't schedules events + # * +true+ -> If there are schedules events + def scheduled? + self.program.events.where.not(start_time: nil).any? + end + ## # Checks if the user is registered to the conference # diff --git a/app/models/event.rb b/app/models/event.rb index 1e118095..b9c01089 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -223,6 +223,20 @@ class Event < ActiveRecord::Base (100 * result.values.count(true) / result.values.compact.count).to_s end + ## + # Returns the number of columns this event should span in the schedule + # + def span + self.event_type.length / EventType::LENGTH_STEP + end + + ## + # Returns end of the event + # + def end_time + self.start_time + self.event_type.length.minutes + end + private ## diff --git a/app/models/event_type.rb b/app/models/event_type.rb index 9a5c4c84..548d2006 100644 --- a/app/models/event_type.rb +++ b/app/models/event_type.rb @@ -10,6 +10,7 @@ class EventType < ActiveRecord::Base alias_attribute :name, :title + # If LENGTH_STEP > 60 the public schedule must be changed LENGTH_STEP = 15 private diff --git a/app/views/conference/_schedule.html.erb b/app/views/conference/_schedule.html.erb index 1d036378..b614f31f 100644 --- a/app/views/conference/_schedule.html.erb +++ b/app/views/conference/_schedule.html.erb @@ -1,72 +1,93 @@
-

Schedule for <%= @conference.title %>

-
+ <% end %> + + + + + + + + + + + + + <% end %> + <%= javascript_tag do %> $(function() { // add a hash to the URL when the user clicks on a tab $('a[data-toggle="tab"]').on('click', function(e) { + $('.li-dropdown-schedule').removeClass('active'); + $('.schedule-dropdown').find('button').text($(this).text()); history.pushState(null, null, $(this).attr('href')); }); // navigate to a tab when the history changes @@ -85,4 +106,21 @@ $(function() { hash && $('ul.nav a[href="' + hash + '"]').tab('show'); }); +$('.carousel').on('slid.bs.carousel', '', +function(){ + $(this).children('.left.carousel-control').show(); + $(this).children('.right.carousel-control').show(); + if($(this).find('.first').hasClass('active')) { + $(this).children('.left.carousel-control').hide(); + } else if($(this).find('.last').hasClass('active')) { + $(this).children('.right.carousel-control').hide(); + } +}); + + +$(document).ready(function(){ + $('.carousel').children('.left.carousel-control').hide(); +}); + + <% end %> diff --git a/app/views/conference/_schedule_item.html.haml b/app/views/conference/_schedule_item.html.haml index 743095ca..e52c9df4 100644 --- a/app/views/conference/_schedule_item.html.haml +++ b/app/views/conference/_schedule_item.html.haml @@ -1,24 +1,13 @@ -%td.event{ style: "width: #{95 / @rooms.length}%; cursor:pointer", | - rowspan: span[room.id], | +%td.event{ width: "#{ width * span }%" , | + height: "75px" , | + colspan: span, | + style: "cursor:pointer; padding:0px;" , | role: "button" } | - %a.unstyled-link{href: url_for(conference_program_proposal_path(@conference.short_title, event[0].id))} - - if speaker = event[0].speakers.first + %a.unstyled-link{href: url_for(conference_program_proposal_path(@conference.short_title, event.id))} + %div{ class:"event-elipsis break-words", style: "font-size: 11px; height:45px; line-height: 15px; overflow: hidden;"} + = event.title + - if speaker = event.speakers.first = image_tag speaker.gravatar_url, :class => "img-circle pull-right", | :alt => speaker.name, | :title => speaker.name, | - :style => "padding:8px;" | - %h5 - %span.fa.fa-comment - = event[0].title - - unless event[0].subtitle.blank? - %span.schedule-subtitle - = event[0].subtitle - %span.schedule-speaker - %span.fa.fa-user - = speaker.name - - if event[0].track - %span.schedule-track - %span.fa.fa-road - %span.label{ style: "background-color: #{event[0].track.color}" } - = event[0].track.name - + :style => "padding:5px 2px; width:25px" | diff --git a/app/views/conference/schedule.html.erb b/app/views/conference/schedule.html.erb index 9390cf5d..ceaf506d 100644 --- a/app/views/conference/schedule.html.erb +++ b/app/views/conference/schedule.html.erb @@ -1,5 +1,5 @@
- <% if @conference.program.events.scheduled.any? %> + <% if @conference.scheduled? %>