All events takes you to the current day
This commit is contained in:
parent
6d9eabcc0e
commit
39c4261859
3 changed files with 14 additions and 0 deletions
|
|
@ -31,6 +31,9 @@ class ConferenceController < ApplicationController
|
||||||
|
|
||||||
@scheduled_events = @conference.program.events.scheduled
|
@scheduled_events = @conference.program.events.scheduled
|
||||||
@unscheduled_events = @conference.program.events.unscheduled
|
@unscheduled_events = @conference.program.events.unscheduled
|
||||||
|
|
||||||
|
day = @conference.current_conference_day
|
||||||
|
@tag = day.strftime('%Y-%m-%d') if day
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
||||||
|
|
@ -609,6 +609,12 @@ class Conference < ActiveRecord::Base
|
||||||
next_color(start_index[collection])
|
next_color(start_index[collection])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the current day if it is a day of the schedule or nil otherwise
|
||||||
|
def current_conference_day
|
||||||
|
day = Time.find_zone(timezone).today
|
||||||
|
day if (start_date..end_date).cover? day
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Returns a different html colour for every i and consecutive colors are
|
# Returns a different html colour for every i and consecutive colors are
|
||||||
|
|
|
||||||
|
|
@ -58,3 +58,8 @@
|
||||||
$('.program-selector').on('click', function(e) {
|
$('.program-selector').on('click', function(e) {
|
||||||
$('.li-dropdown-program').removeClass('active');
|
$('.li-dropdown-program').removeClass('active');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Go to current date and time
|
||||||
|
$(document).ready(function(){
|
||||||
|
document.getElementById("#{ @tag }").scrollIntoView();
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue