Integrate the schedule in the admin interface
Integrate the schedule in the admin interface while adapting it to the new associations and models.
|
|
@ -13,6 +13,7 @@
|
||||||
//= require jquery
|
//= require jquery
|
||||||
//= require jquery_ujs
|
//= require jquery_ujs
|
||||||
//= require jquery.mobile.custom.min
|
//= require jquery.mobile.custom.min
|
||||||
|
//= require jquery-ui.min
|
||||||
//= require waypoints/jquery.waypoints
|
//= require waypoints/jquery.waypoints
|
||||||
//= require dataTables/jquery.dataTables
|
//= require dataTables/jquery.dataTables
|
||||||
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
|
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
|
||||||
|
|
|
||||||
13
app/assets/javascripts/jquery-ui.min.js
vendored
Normal file
|
|
@ -14,4 +14,5 @@
|
||||||
*= require bootstrap-datetimepicker
|
*= require bootstrap-datetimepicker
|
||||||
*= require leaflet
|
*= require leaflet
|
||||||
*= require bootstrap3-switch
|
*= require bootstrap3-switch
|
||||||
|
*= require jquery-ui.min
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
7
app/assets/stylesheets/jquery-ui.min.css
vendored
Normal file
|
|
@ -1,3 +1,52 @@
|
||||||
|
|
||||||
|
.room-name{
|
||||||
|
font-weight: bold;
|
||||||
|
padding:10px;
|
||||||
|
margin-top: 30px;
|
||||||
|
border: 1px solid #848484;
|
||||||
|
background-color: #E6E6E6;
|
||||||
|
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 1;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 25px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-room-slot{
|
||||||
|
padding: 2px 5px;
|
||||||
|
border: 1px solid #848484;
|
||||||
|
height: 58px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-event{
|
||||||
|
padding: 7px;
|
||||||
|
border: 2px solid #151515;
|
||||||
|
position:relative;
|
||||||
|
z-index:1;
|
||||||
|
cursor:move;
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-event-text{
|
||||||
|
display: -webkit-box;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
line-height: 23px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-event-delete-button {
|
||||||
|
font-weight:bold;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0px 3px;
|
||||||
|
border: 1px solid grey;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
#schedule td.event {
|
#schedule td.event {
|
||||||
background-image: linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%);
|
background-image: linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%);
|
||||||
background-image: -o-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%);
|
background-image: -o-linear-gradient(bottom, rgb(247,250,242) 24%, rgb(194,232,190) 97%, rgb(194,232,190) 100%);
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,11 @@ module Admin
|
||||||
load_resource :venue, through: :conference, singleton: true
|
load_resource :venue, through: :conference, singleton: true
|
||||||
|
|
||||||
skip_before_filter :verify_authenticity_token, only: [:update]
|
skip_before_filter :verify_authenticity_token, only: [:update]
|
||||||
layout 'schedule'
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
authorize! :update, @program.events.new
|
event = @program.events.new
|
||||||
|
authorize! :update, event
|
||||||
|
event.destroy
|
||||||
if @conference.nil?
|
if @conference.nil?
|
||||||
redirect_to admin_conference_index_path
|
redirect_to admin_conference_index_path
|
||||||
return
|
return
|
||||||
|
|
@ -21,6 +22,13 @@ module Admin
|
||||||
else
|
else
|
||||||
@rooms = [ Room.new(name: 'No Rooms!', size: 0) ]
|
@rooms = [ Room.new(name: 'No Rooms!', size: 0) ]
|
||||||
end
|
end
|
||||||
|
# if there is not selected schedule we create it
|
||||||
|
unless @program.selected_schedule.present?
|
||||||
|
schedule = @program.schedules.create
|
||||||
|
@program.selected_schedule = schedule.id
|
||||||
|
@program.save!
|
||||||
|
end
|
||||||
|
@schedule_id = @program.selected_schedule
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|
@ -31,14 +39,17 @@ module Admin
|
||||||
error_message = "Could not find event GUID: #{params[:event]}"
|
error_message = "Could not find event GUID: #{params[:event]}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
event_schedule = event.event_schedule(params[:schedule])
|
||||||
|
|
||||||
if params[:date] == 'none'
|
if params[:date] == 'none'
|
||||||
event.start_time = nil
|
event_schedule.destroy if event_schedule.present?
|
||||||
event.room = nil
|
|
||||||
event.save!
|
|
||||||
render json: { 'status' => 'ok' }
|
render json: { 'status' => 'ok' }
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
event_schedule = event.event_schedules.create(schedule_id: params[:schedule]) unless event_schedule.present?
|
||||||
room = Room.where(guid: room_params).first
|
room = Room.where(guid: room_params).first
|
||||||
|
|
||||||
if room.nil?
|
if room.nil?
|
||||||
error_message = "Could not find room GUID: #{params[:room]}"
|
error_message = "Could not find room GUID: #{params[:room]}"
|
||||||
end
|
end
|
||||||
|
|
@ -48,7 +59,7 @@ module Admin
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
event.room = room
|
event_schedule.room = room
|
||||||
time = "#{params[:date]} #{params[:time]}"
|
time = "#{params[:date]} #{params[:time]}"
|
||||||
|
|
||||||
Rails.logger.debug("Loading #{time}")
|
Rails.logger.debug("Loading #{time}")
|
||||||
|
|
@ -57,8 +68,8 @@ module Admin
|
||||||
# zone = ActiveSupport::TimeZone::new(@conference.timezone)
|
# zone = ActiveSupport::TimeZone::new(@conference.timezone)
|
||||||
# start_time = DateTime.strptime(time + zone.formatted_offset, "%Y-%m-%d %k:%M %Z")
|
# start_time = DateTime.strptime(time + zone.formatted_offset, "%Y-%m-%d %k:%M %Z")
|
||||||
start_time = DateTime.strptime(time, '%Y-%m-%d %k:%M')
|
start_time = DateTime.strptime(time, '%Y-%m-%d %k:%M')
|
||||||
event.start_time = start_time
|
event_schedule.start_time = start_time
|
||||||
event.save!
|
event_schedule.save!
|
||||||
render json: { 'status' => 'ok' }
|
render json: { 'status' => 'ok' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,11 +79,12 @@ class Event < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# Checkes if the event has a start_time and a room for the selected one if there is any.
|
# Checkes if the event has a start_time and a room for the given schedule
|
||||||
|
# (given by its id) or for the selected one if there is any.
|
||||||
# ====Returns
|
# ====Returns
|
||||||
# * +true+ or +false+
|
# * +true+ or +false+
|
||||||
def unscheduled?
|
def unscheduled?(schedule_id)
|
||||||
state == 'confirmed' && (!selected_event_schedule.try(:start_time).present? || !selected_event_schedule.try(:room).present?)
|
state == 'confirmed' && (!event_schedule(schedule_id).try(:start_time).present? || !event_schedule(schedule_id).try(:room).present?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def registration_possible?
|
def registration_possible?
|
||||||
|
|
@ -137,11 +138,10 @@ class Event < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json(options)
|
def as_json(options={})
|
||||||
json = super(options)
|
json = super({ include: { event_schedules: { methods: [:room_guid] } } }.merge(options))
|
||||||
|
|
||||||
json[:room_guid] = scheduled_room.try(:guid)
|
|
||||||
json[:track_color] = track.try(:color) || '#FFFFFF'
|
json[:track_color] = track.try(:color) || '#FFFFFF'
|
||||||
|
json[:track_text_color] = ApplicationController.helpers.contrast_color(json[:track_color])
|
||||||
json[:length] = event_type.try(:length) || EventType::LENGTH_STEP
|
json[:length] = event_type.try(:length) || EventType::LENGTH_STEP
|
||||||
|
|
||||||
json
|
json
|
||||||
|
|
@ -277,6 +277,11 @@ class Event < ActiveRecord::Base
|
||||||
room.events.where(start_time: start_time).where.not(id: id)
|
room.events.where(start_time: start_time).where.not(id: id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# returns the event_schedule for this event and the schedule given in case that it exists
|
||||||
|
def event_schedule(schedule_id)
|
||||||
|
event_schedules.find_by(schedule_id: schedule_id)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# returns the event_schedule for this event and for the selected_schedule
|
# returns the event_schedule for this event and for the selected_schedule
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,8 @@ class EventSchedule < ActiveRecord::Base
|
||||||
belongs_to :schedule
|
belongs_to :schedule
|
||||||
belongs_to :event
|
belongs_to :event
|
||||||
belongs_to :room
|
belongs_to :room
|
||||||
|
|
||||||
|
def room_guid
|
||||||
|
room.try(:guid)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ class Program < ActiveRecord::Base
|
||||||
joins(:event_schedules).where('event_schedules.schedule_id = ? AND event_schedules.start_time IS NOT NULL AND event_schedules.room_id IS NOT NULL', schedule_id)
|
joins(:event_schedules).where('event_schedules.schedule_id = ? AND event_schedules.start_time IS NOT NULL AND event_schedules.room_id IS NOT NULL', schedule_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def unscheduled
|
def unscheduled(schedule_id=nil)
|
||||||
select(&:unscheduled?)
|
select{ |e| e.unscheduled?(schedule_id) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def highlights
|
def highlights
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,13 @@
|
||||||
.schedule-time-column
|
.row
|
||||||
.schedule-time-column-header
|
- @rooms.each do |room|
|
||||||
= Time
|
.col-md-2.col-xs-6
|
||||||
- (9..18).each do |hour|
|
.room-name
|
||||||
.schedule-time-slot
|
= room.name
|
||||||
= "#{hour}:00"
|
- (9*4..18*4).each do |slot|
|
||||||
.schedule-time-slot
|
- hour = slot / 4
|
||||||
= "#{hour}:15"
|
- time = (15 * (slot % 4) == 0) ? '00' : 15 * (slot % 4)
|
||||||
.schedule-time-slot
|
.schedule-room-slot{ id: "schedule-room-#{room.guid}-#{hour}-#{time}", |
|
||||||
= "#{hour}:30"
|
"room-guid" => room.guid, |
|
||||||
.schedule-time-slot
|
hour: "#{hour}:#{time}", |
|
||||||
= "#{hour}:45"
|
date: date}
|
||||||
|
= "#{hour}:#{time}"
|
||||||
- @rooms.each do |room|
|
|
||||||
.schedule-room-column{:id => "schedule-room-#{room.guid}", "room-guid" => room.guid}
|
|
||||||
.schedule-room-column-header
|
|
||||||
= room.name
|
|
||||||
= "(#{room.size} people)"
|
|
||||||
- (9..18).each do |hour|
|
|
||||||
.schedule-room-slot{:id => "schedule-room-#{room.guid}-#{hour}-0", "room-guid" => room.guid, "hour" => "#{hour}:00"}
|
|
||||||
.schedule-room-slot{:id => "schedule-room-#{room.guid}-#{hour}-15", "room-guid" => room.guid, "hour" => "#{hour}:15"}
|
|
||||||
.schedule-room-slot{:id => "schedule-room-#{room.guid}-#{hour}-30", "room-guid" => room.guid, "hour" => "#{hour}:30"}
|
|
||||||
.schedule-room-slot{:id => "schedule-room-#{room.guid}-#{hour}-45", "room-guid" => room.guid, "hour" => "#{hour}:45"}
|
|
||||||
|
|
|
||||||
|
|
@ -1,48 +1,166 @@
|
||||||
.schedule-content
|
.row
|
||||||
%h2
|
.col-md-12
|
||||||
= "Schedule for #{@conference.title}"
|
.page-header
|
||||||
#unscheduled.unscheduled
|
%h1 Schedule
|
||||||
.unscheduled-header
|
%p.text-muted
|
||||||
Unscheduled Events
|
Create the schedules for the conference
|
||||||
#schedule.schedule
|
|
||||||
.schedule-dates-header
|
.row
|
||||||
%ul#date-tabs
|
.col-md-2
|
||||||
- @dates.each do |date|
|
.h4
|
||||||
%li.date-selector
|
Unscheduled events
|
||||||
= link_to "#{date}", "#", id: "#{date}-selector", onclick: "Schedule.changeDay('#{date}')"
|
.unscheduled-events
|
||||||
.schedule-rooms-container
|
.col-md-10
|
||||||
= render 'day_tab'
|
%ul.nav.nav-tabs
|
||||||
|
- @dates.each do |date|
|
||||||
|
%li{ class: "#{ (@dates.first == date) ? 'active' : '' }"}
|
||||||
|
%a{ href: "##{date}" }
|
||||||
|
= date
|
||||||
|
.tab-content
|
||||||
|
- @dates.each do |date|
|
||||||
|
.tab-pane{ class: "#{ (@dates.first == date) ? 'active' : '' }", id: "#{date}" }
|
||||||
|
= render partial: 'day_tab', locals: { date: date }
|
||||||
|
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready( function() {
|
|
||||||
//Schedule.loadDaysAndTracks("#{@conference.short_title}");
|
|
||||||
var conference = "#{@conference.short_title}"
|
|
||||||
Schedule.loadEvents("#{@conference.short_title}", "#{@dates.first}");
|
|
||||||
$('.schedule-room-slot').droppable({
|
|
||||||
accept: '.schedule-event',
|
|
||||||
tolerance: "pointer",
|
|
||||||
drop: function(event, ui) {
|
|
||||||
$(ui.draggable).appendTo(this);
|
|
||||||
var myId = $(ui.draggable).attr("guid");
|
|
||||||
var myRoom = $(this).attr("room-guid")
|
|
||||||
var myDate = $(this).attr("date");
|
|
||||||
var myTime = $(this).attr("hour");
|
|
||||||
var length = $(ui.draggable).attr("length");
|
|
||||||
$(ui.draggable).css("left", 0);
|
|
||||||
$(ui.draggable).css("top", 0);
|
|
||||||
$(this).css("background-color", "#ffffff");
|
|
||||||
|
|
||||||
// 15 minute slots on the schedule are 30px,
|
var conference = "#{@conference.short_title}"
|
||||||
// thus the magic multiplier here
|
var schedule_id = "#{@schedule_id}";
|
||||||
$(ui.draggable).height(length * 2 - 7);
|
|
||||||
$(ui.draggable).width($(this).width() - 10);
|
var Schedule = {
|
||||||
Schedule.save(conference, myId, myRoom, myDate, myTime);
|
loadEvents: function(conference_id, start_date) {
|
||||||
},
|
var url = '/admin/conference/' + conference_id + '/program/events';
|
||||||
over: function(event, ui) {
|
var callback = function(data) {
|
||||||
$(this).css("background-color", "#009ED8");
|
$.each(data, function(key, val) {
|
||||||
},
|
Schedule.newEvent(val, conference_id);
|
||||||
out: function(event, ui) {
|
});
|
||||||
$(this).css("background-color", "#ffffff");
|
};
|
||||||
}
|
$.getJSON(url, callback);
|
||||||
});
|
},
|
||||||
});
|
newEvent: function(vars, conference_id) {
|
||||||
|
var height = (vars["length"] / 15 * 58) - 23; // this height fits the room cells
|
||||||
|
var lines = Math.floor((height - 7) / 23); // subtracting the padding before calculate the number of lines
|
||||||
|
var newEvent = $('<div class="schedule-event">'
|
||||||
|
+ '<div class="schedule-event-text" style="-webkit-line-clamp: '+ lines + '; height: ' + (lines * 23) + 'px;">'
|
||||||
|
+ '<span onclick="Schedule.remove(\'event-' + vars["guid"] + '\', \'' + conference_id +'\');" class="schedule-event-delete-button">X</span>'
|
||||||
|
+ vars["title"] + '</div></div>');
|
||||||
|
newEvent.attr("id", "event-" + vars["guid"]);
|
||||||
|
newEvent.attr("guid", vars["guid"]);
|
||||||
|
newEvent.css("height", height);
|
||||||
|
newEvent.css('background-color',vars["track_color"]);
|
||||||
|
newEvent.css('color',vars["track_text_color"]);
|
||||||
|
var date = "none";
|
||||||
|
var room = "none"
|
||||||
|
var time = "none";
|
||||||
|
for (i = 0; i < vars["event_schedules"].length; i++) {
|
||||||
|
event_schedule = vars["event_schedules"][i];
|
||||||
|
if(event_schedule["schedule_id"] == schedule_id){
|
||||||
|
room = event_schedule["room_guid"];
|
||||||
|
var d = new Date(event_schedule["start_time"]);
|
||||||
|
date = d.getUTCFullYear() + "-"
|
||||||
|
+ ('0' + (d.getUTCMonth() +1)).slice(-2) + '-'
|
||||||
|
+ ('0' + d.getUTCDate()).slice(-2);
|
||||||
|
minutes = d.getUTCMinutes();
|
||||||
|
time = d.getUTCHours() + ':' + (minutes == 0 ? '00' : minutes);
|
||||||
|
console.log("date: " + d);
|
||||||
|
newEvent.attr("room", room);
|
||||||
|
newEvent.attr("date", date);
|
||||||
|
newEvent.attr("hour", time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
newEvent.draggable({
|
||||||
|
snap: '.schedule-room-slot',
|
||||||
|
revertDuration: 200,
|
||||||
|
revert: function (event, ui) {
|
||||||
|
console.log(event.attr);
|
||||||
|
return !event;
|
||||||
|
},
|
||||||
|
stop: function(event, ui) {
|
||||||
|
this._originalPosition = this._originalPosition || ui.originalPosition;
|
||||||
|
ui.helper.animate( this._originalPosition );
|
||||||
|
},
|
||||||
|
opacity: 0.7,
|
||||||
|
snapMode: "inner",
|
||||||
|
zIndex: 2
|
||||||
|
});
|
||||||
|
if (date == "none" || room == "none") {
|
||||||
|
newEvent.find(".schedule-event-delete-button").hide();
|
||||||
|
$('.unscheduled-events').append(newEvent);
|
||||||
|
} else {
|
||||||
|
var element = "[date='" + date +"'][hour='" + time + "'][room-guid='" + room + "']";
|
||||||
|
$(element).append(newEvent);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
remove: function(element, conference_id) {
|
||||||
|
var e = $("#" + element);
|
||||||
|
var unscheduled = $(".unscheduled-events");
|
||||||
|
|
||||||
|
var url = '/admin/conference/' + conference_id + '/schedule';
|
||||||
|
var params = {
|
||||||
|
event: e.attr("guid"),
|
||||||
|
room: "none",
|
||||||
|
date: "none",
|
||||||
|
time: "none",
|
||||||
|
schedule: schedule_id
|
||||||
|
};
|
||||||
|
var callback = function(data) {
|
||||||
|
console.log(data);
|
||||||
|
e.appendTo(unscheduled);
|
||||||
|
e.find(".schedule-event-delete-button").hide();
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: 'PUT',
|
||||||
|
data: params,
|
||||||
|
success: callback,
|
||||||
|
dataType : 'json'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
save: function (conference_id, event_id, room_id, date, time) {
|
||||||
|
var url = '/admin/conference/' + conference_id + '/schedule';
|
||||||
|
var params = {
|
||||||
|
event: event_id,
|
||||||
|
room: room_id,
|
||||||
|
date: date,
|
||||||
|
time: time,
|
||||||
|
schedule: schedule_id
|
||||||
|
};
|
||||||
|
var callback = function(data) {
|
||||||
|
console.log(data);
|
||||||
|
$("#event-" + event_id).find(".schedule-event-delete-button").show();
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: 'PUT',
|
||||||
|
data: params,
|
||||||
|
success: callback,
|
||||||
|
dataType : 'json'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Schedule.loadEvents("#{@conference.short_title}", "#{@dates.first}");
|
||||||
|
|
||||||
|
$(document).ready( function() {
|
||||||
|
$('.schedule-room-slot').droppable({
|
||||||
|
accept: '.schedule-event',
|
||||||
|
tolerance: "pointer",
|
||||||
|
drop: function(event, ui) {
|
||||||
|
$(ui.draggable).appendTo(this);
|
||||||
|
var myId = $(ui.draggable).attr("guid");
|
||||||
|
var myRoom = $(this).attr("room-guid")
|
||||||
|
var myDate = $(this).attr("date");
|
||||||
|
var myTime = $(this).attr("hour");
|
||||||
|
$(ui.draggable).css("left", 0);
|
||||||
|
$(ui.draggable).css("top", 0);
|
||||||
|
$(this).css("background-color", "#ffffff");
|
||||||
|
Schedule.save(conference, myId, myRoom, myDate, myTime);
|
||||||
|
},
|
||||||
|
over: function(event, ui) {
|
||||||
|
$(this).css("background-color", "#009ED8");
|
||||||
|
},
|
||||||
|
out: function(event, ui) {
|
||||||
|
$(this).css("background-color", "#ffffff");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
= link_to 'Difficulty Levels', admin_conference_program_difficulty_levels_path(@conference.short_title)
|
= link_to 'Difficulty Levels', admin_conference_program_difficulty_levels_path(@conference.short_title)
|
||||||
- if can? :update, @conference.program.events.build
|
- if can? :update, @conference.program.events.build
|
||||||
%li{class: active_nav_li(admin_conference_schedule_path(@conference.short_title))}
|
%li{class: active_nav_li(admin_conference_schedule_path(@conference.short_title))}
|
||||||
= link_to 'Schedule', admin_conference_schedule_path(@conference.short_title), target: '_blank'
|
= link_to 'Schedule', admin_conference_schedule_path(@conference.short_title)
|
||||||
|
|
||||||
- if can? :update, Registration.new(conference_id: @conference.id)
|
- if can? :update, Registration.new(conference_id: @conference.id)
|
||||||
%li{:class=> active_nav_li(admin_conference_registrations_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_registrations_path(@conference.short_title))}
|
||||||
|
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
/*
|
|
||||||
* Date Format 1.2.3
|
|
||||||
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
|
||||||
* MIT license
|
|
||||||
*
|
|
||||||
* Includes enhancements by Scott Trenda <scott.trenda.net>
|
|
||||||
* and Kris Kowal <cixar.com/~kris.kowal/>
|
|
||||||
*
|
|
||||||
* Accepts a date, a mask, or a date and a mask.
|
|
||||||
* Returns a formatted version of the given date.
|
|
||||||
* The date defaults to the current date/time.
|
|
||||||
* The mask defaults to dateFormat.masks.default.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var dateFormat = function () {
|
|
||||||
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
|
|
||||||
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
|
|
||||||
timezoneClip = /[^-+\dA-Z]/g,
|
|
||||||
pad = function (val, len) {
|
|
||||||
val = String(val);
|
|
||||||
len = len || 2;
|
|
||||||
while (val.length < len) val = "0" + val;
|
|
||||||
return val;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Regexes and supporting functions are cached through closure
|
|
||||||
return function (date, mask, utc) {
|
|
||||||
var dF = dateFormat;
|
|
||||||
|
|
||||||
// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
|
|
||||||
if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
|
|
||||||
mask = date;
|
|
||||||
date = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Passing date through Date applies Date.parse, if necessary
|
|
||||||
date = date ? new Date(date) : new Date;
|
|
||||||
if (isNaN(date)) throw SyntaxError("invalid date");
|
|
||||||
|
|
||||||
mask = String(dF.masks[mask] || mask || dF.masks["default"]);
|
|
||||||
|
|
||||||
// Allow setting the utc argument via the mask
|
|
||||||
if (mask.slice(0, 4) == "UTC:") {
|
|
||||||
mask = mask.slice(4);
|
|
||||||
utc = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ = utc ? "getUTC" : "get",
|
|
||||||
d = date[_ + "Date"](),
|
|
||||||
D = date[_ + "Day"](),
|
|
||||||
m = date[_ + "Month"](),
|
|
||||||
y = date[_ + "FullYear"](),
|
|
||||||
H = date[_ + "Hours"](),
|
|
||||||
M = date[_ + "Minutes"](),
|
|
||||||
s = date[_ + "Seconds"](),
|
|
||||||
L = date[_ + "Milliseconds"](),
|
|
||||||
o = utc ? 0 : date.getTimezoneOffset(),
|
|
||||||
flags = {
|
|
||||||
d: d,
|
|
||||||
dd: pad(d),
|
|
||||||
ddd: dF.i18n.dayNames[D],
|
|
||||||
dddd: dF.i18n.dayNames[D + 7],
|
|
||||||
m: m + 1,
|
|
||||||
mm: pad(m + 1),
|
|
||||||
mmm: dF.i18n.monthNames[m],
|
|
||||||
mmmm: dF.i18n.monthNames[m + 12],
|
|
||||||
yy: String(y).slice(2),
|
|
||||||
yyyy: y,
|
|
||||||
h: H % 12 || 12,
|
|
||||||
hh: pad(H % 12 || 12),
|
|
||||||
H: H,
|
|
||||||
HH: pad(H),
|
|
||||||
M: M,
|
|
||||||
MM: pad(M),
|
|
||||||
s: s,
|
|
||||||
ss: pad(s),
|
|
||||||
l: pad(L, 3),
|
|
||||||
L: pad(L > 99 ? Math.round(L / 10) : L),
|
|
||||||
t: H < 12 ? "a" : "p",
|
|
||||||
tt: H < 12 ? "am" : "pm",
|
|
||||||
T: H < 12 ? "A" : "P",
|
|
||||||
TT: H < 12 ? "AM" : "PM",
|
|
||||||
Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
|
|
||||||
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
|
|
||||||
S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
|
|
||||||
};
|
|
||||||
|
|
||||||
return mask.replace(token, function ($0) {
|
|
||||||
return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
// Some common format strings
|
|
||||||
dateFormat.masks = {
|
|
||||||
"default": "ddd mmm dd yyyy HH:MM:ss",
|
|
||||||
shortDate: "m/d/yy",
|
|
||||||
mediumDate: "mmm d, yyyy",
|
|
||||||
longDate: "mmmm d, yyyy",
|
|
||||||
fullDate: "dddd, mmmm d, yyyy",
|
|
||||||
shortTime: "h:MM TT",
|
|
||||||
mediumTime: "h:MM:ss TT",
|
|
||||||
longTime: "h:MM:ss TT Z",
|
|
||||||
isoDate: "yyyy-mm-dd",
|
|
||||||
isoTime: "HH:MM:ss",
|
|
||||||
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
|
|
||||||
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
|
|
||||||
};
|
|
||||||
|
|
||||||
// Internationalization strings
|
|
||||||
dateFormat.i18n = {
|
|
||||||
dayNames: [
|
|
||||||
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
|
|
||||||
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
|
||||||
],
|
|
||||||
monthNames: [
|
|
||||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
|
||||||
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
// For convenience...
|
|
||||||
Date.prototype.format = function (mask, utc) {
|
|
||||||
return dateFormat(this, mask, utc);
|
|
||||||
};
|
|
||||||
|
|
||||||
9472
public/javascripts/schedule/jquery-1.8.3.js
vendored
|
|
@ -1,178 +0,0 @@
|
||||||
Array.prototype.remove = function() {
|
|
||||||
var what, a = arguments, L = a.length, ax;
|
|
||||||
while (L && this.length) {
|
|
||||||
what = a[--L];
|
|
||||||
while ((ax = this.indexOf(what)) !== -1) {
|
|
||||||
this.splice(ax, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Date.prototype.addDays = function(days) {
|
|
||||||
var dat = new Date(this.valueOf())
|
|
||||||
dat.setDate(dat.getDate() + days);
|
|
||||||
return dat;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDates(startDate, stopDate) {
|
|
||||||
var dateArray = new Array();
|
|
||||||
var currentDate = startDate;
|
|
||||||
while (currentDate <= stopDate) {
|
|
||||||
dateArray.push(currentDate)
|
|
||||||
currentDate = currentDate.addDays(1);
|
|
||||||
}
|
|
||||||
return dateArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
var scheduleDayEvents = {};
|
|
||||||
|
|
||||||
var Schedule = {
|
|
||||||
loadEvents: function(conference_id, start_date) {
|
|
||||||
var eventDates = {};
|
|
||||||
var url = '/admin/conference/' + conference_id + '/program/events';
|
|
||||||
var params = { start: $('#start').text(), end: $('#end').text()};
|
|
||||||
var callback = function(data) {
|
|
||||||
$.each(data, function(key, val) {
|
|
||||||
Schedule.newEvent(val, conference_id);
|
|
||||||
});
|
|
||||||
Schedule.changeDay(start_date);
|
|
||||||
};
|
|
||||||
$.getJSON(url, params, callback);
|
|
||||||
},
|
|
||||||
newEvent: function(vars, conference_id) {
|
|
||||||
var newEvent = $('<div>'
|
|
||||||
+ '<div onclick="Schedule.remove(\'event-' + vars["guid"] + '\', \'' + conference_id +'\');" class="schedule-event-delete-button">X</div>'
|
|
||||||
+ '<div>' + vars["title"] + '</div></div>');
|
|
||||||
var date = "none";
|
|
||||||
var hour = "12";
|
|
||||||
var minute = "0";
|
|
||||||
console.log(vars);
|
|
||||||
if (vars["start_time"] != null) {
|
|
||||||
var d = new Date(vars["start_time"]);
|
|
||||||
date = d.getUTCFullYear() + "-"
|
|
||||||
+ ('0' + (d.getUTCMonth() +1)).slice(-2) + '-'
|
|
||||||
+ ('0' + d.getUTCDate()).slice(-2);
|
|
||||||
hour = d.getUTCHours();
|
|
||||||
minute = d.getUTCMinutes();
|
|
||||||
console.log("date: " + d);
|
|
||||||
}
|
|
||||||
newEvent.addClass("schedule-event");
|
|
||||||
newEvent.css('background-color',vars["track_color"]);
|
|
||||||
newEvent.attr("id", "event-" + vars["guid"]);
|
|
||||||
newEvent.attr("room", vars["room_guid"]);
|
|
||||||
newEvent.attr("guid", vars["guid"]);
|
|
||||||
newEvent.attr("length", vars["length"]);
|
|
||||||
newEvent.attr("date", date);
|
|
||||||
newEvent.attr("hour", hour);
|
|
||||||
newEvent.attr("minute", minute);
|
|
||||||
newEvent.draggable({
|
|
||||||
snap: '.schedule-track-slot',
|
|
||||||
revertDuration: 200,
|
|
||||||
revert: function (event, ui) {
|
|
||||||
// $(this).data("draggable").originalPosition = {
|
|
||||||
// top: 0,
|
|
||||||
// left: 0
|
|
||||||
// };
|
|
||||||
console.log(event.attr);
|
|
||||||
return !event;
|
|
||||||
},
|
|
||||||
stop: function(event, ui) {
|
|
||||||
this._originalPosition = this._originalPosition || ui.originalPosition;
|
|
||||||
ui.helper.animate( this._originalPosition );
|
|
||||||
},
|
|
||||||
start: function( event, ui ) {
|
|
||||||
$(ui.helper).height(ui.helper.attr("length") * 2 - 7);
|
|
||||||
|
|
||||||
},
|
|
||||||
opacity: 0.7,
|
|
||||||
snapMode: "inner",
|
|
||||||
zIndex: 2
|
|
||||||
});
|
|
||||||
if (date == "none" || vars["room_id"] == null) {
|
|
||||||
$('#unscheduled').append(newEvent);
|
|
||||||
} else {
|
|
||||||
if (!scheduleDayEvents.hasOwnProperty(date)) {
|
|
||||||
scheduleDayEvents[date] = new Array();
|
|
||||||
}
|
|
||||||
newEvent.height(newEvent.attr("length") * 2 - 7);
|
|
||||||
newEvent.width(200 - 10);
|
|
||||||
scheduleDayEvents[date].push(newEvent);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
remove: function(element, conference_id) {
|
|
||||||
var e = $("#" + element);
|
|
||||||
var unscheduled = $("#unscheduled");
|
|
||||||
|
|
||||||
var url = '/admin/conference/' + conference_id + '/schedule';
|
|
||||||
var params = {
|
|
||||||
event: e.attr("guid"),
|
|
||||||
room: "none",
|
|
||||||
date: "none",
|
|
||||||
time: "none"
|
|
||||||
};
|
|
||||||
var callback = function(data) {
|
|
||||||
console.log(data);
|
|
||||||
e.height(10);
|
|
||||||
e.width(unscheduled.width())
|
|
||||||
e.appendTo(unscheduled);
|
|
||||||
}
|
|
||||||
$.ajax({
|
|
||||||
url: url,
|
|
||||||
type: 'PUT',
|
|
||||||
data: params,
|
|
||||||
success: callback,
|
|
||||||
dataType : 'json'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
changeDay: function(date) {
|
|
||||||
$(".date-selector").removeClass("active");
|
|
||||||
$(".date-selector #" + date + "-selector").parent().addClass("active");
|
|
||||||
$(".schedule-room-slot").attr("date", date);
|
|
||||||
// Now clear all of the attached events
|
|
||||||
$(".schedule-rooms-container .schedule-event").remove();
|
|
||||||
if (scheduleDayEvents.hasOwnProperty(date)) {
|
|
||||||
var events = scheduleDayEvents[date];
|
|
||||||
for (var i = 0; i < events.length; i++) {
|
|
||||||
var elem = events[i];
|
|
||||||
elem.draggable({
|
|
||||||
grid: [200,31],
|
|
||||||
snap: '.schedule-track-slot',
|
|
||||||
revert: function (event, ui) {
|
|
||||||
$(this).data("draggable").originalPosition = {
|
|
||||||
top: 0,
|
|
||||||
left: 0
|
|
||||||
};
|
|
||||||
return !event;
|
|
||||||
},
|
|
||||||
opacity: 0.7,
|
|
||||||
snapMode: "inner",
|
|
||||||
zIndex: 2
|
|
||||||
});
|
|
||||||
|
|
||||||
var attachStr = "#schedule-room-" + elem.attr("room") + "-" + elem.attr("hour") + "-" + elem.attr("minute");
|
|
||||||
$(attachStr).append(elem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
save: function (conference_id, event_id, room_id, date, time) {
|
|
||||||
var url = '/admin/conference/' + conference_id + '/schedule';
|
|
||||||
var params = {
|
|
||||||
event: event_id,
|
|
||||||
room: room_id,
|
|
||||||
date: date,
|
|
||||||
time: time
|
|
||||||
};
|
|
||||||
var callback = function(data) {
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
$.ajax({
|
|
||||||
url: url,
|
|
||||||
type: 'PUT',
|
|
||||||
data: params,
|
|
||||||
success: callback,
|
|
||||||
dataType : 'json'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
|
Before Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 178 B |
|
Before Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 111 B |
|
Before Width: | Height: | Size: 110 B |
|
Before Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 101 B |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
|
@ -1,195 +0,0 @@
|
||||||
html, body {
|
|
||||||
height: 100%;
|
|
||||||
overflow:hidden;
|
|
||||||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 20px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.schedule-content {
|
|
||||||
width:100%;
|
|
||||||
height:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
list-style: none;
|
|
||||||
font-family:Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
width: 125px;
|
|
||||||
display : inline-block;
|
|
||||||
background: #009ed8;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
li:hover ul {
|
|
||||||
display:block;
|
|
||||||
}
|
|
||||||
|
|
||||||
li a {
|
|
||||||
display: block;
|
|
||||||
padding: 5px 10px 5px 10px;
|
|
||||||
text-decoration: none;
|
|
||||||
border-right: 0px solid black;
|
|
||||||
width: auto;
|
|
||||||
color: #fff;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
li a:hover {
|
|
||||||
background: #80dcff;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.active {
|
|
||||||
background: #1A6907;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
li ul {
|
|
||||||
margin-left: 85px;
|
|
||||||
margin-top: -25px;
|
|
||||||
position: absolute;
|
|
||||||
display: none;
|
|
||||||
z-index: 99;
|
|
||||||
display : inline-block;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
li:hover ul {
|
|
||||||
visibility: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
li ul li {
|
|
||||||
float: none;
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
li ul li a {
|
|
||||||
width: auto;
|
|
||||||
background: #009ed8;
|
|
||||||
}
|
|
||||||
|
|
||||||
li ul li a:hover {
|
|
||||||
background: #80dcff;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.schedule-dates-header {
|
|
||||||
position:absolute;
|
|
||||||
top:50px;
|
|
||||||
left: 180px;
|
|
||||||
right:0px;
|
|
||||||
|
|
||||||
}
|
|
||||||
.unscheduled {
|
|
||||||
border:1px solid #bbb;
|
|
||||||
margin-right: 10px;
|
|
||||||
top:100px;
|
|
||||||
left:10px;
|
|
||||||
width:200px;
|
|
||||||
bottom:50px;
|
|
||||||
position:absolute;
|
|
||||||
overflow-x: auto;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-content {
|
|
||||||
float: left;
|
|
||||||
width: 100%;
|
|
||||||
height: 700px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule-rooms-container {
|
|
||||||
position:absolute;
|
|
||||||
top:100px;
|
|
||||||
left:220px;
|
|
||||||
right:0px;
|
|
||||||
bottom:50px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule {
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule-room-column-header {
|
|
||||||
float:left;
|
|
||||||
padding-top:4px;
|
|
||||||
text-align:center;
|
|
||||||
width: 200px;
|
|
||||||
position: relative;
|
|
||||||
background: #C4E2E2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.unscheduled-header {
|
|
||||||
text-align:center;
|
|
||||||
padding-top:4px;
|
|
||||||
width: 200px;
|
|
||||||
position: relative;
|
|
||||||
background: #111953;
|
|
||||||
color: white;
|
|
||||||
overflow:hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.schedule-time-column-header {
|
|
||||||
float:left;
|
|
||||||
padding-top:4px;
|
|
||||||
width: 200px;
|
|
||||||
position: relative;
|
|
||||||
background: #C4E2E2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule-time-column {
|
|
||||||
border:1px solid #bbb;
|
|
||||||
float:left;
|
|
||||||
position:relative;
|
|
||||||
width:100px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule-room-column {
|
|
||||||
border:1px solid #bbb;
|
|
||||||
float:left;
|
|
||||||
position:relative;
|
|
||||||
width:200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule-time-slot {
|
|
||||||
border-bottom: 1px solid #bbb;
|
|
||||||
float:left;
|
|
||||||
position:relative;
|
|
||||||
width:100px;
|
|
||||||
height:30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule-room-slot {
|
|
||||||
border-bottom: 1px solid #bbb;
|
|
||||||
float:left;
|
|
||||||
position:relative;
|
|
||||||
width:200px;
|
|
||||||
height:30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule-event {
|
|
||||||
overflow:hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
position:relative;
|
|
||||||
border: 1px solid #000000;
|
|
||||||
left: 0;
|
|
||||||
width:200px;
|
|
||||||
min-height:32px;
|
|
||||||
background: #6af;
|
|
||||||
color: #000;
|
|
||||||
z-index:1;
|
|
||||||
cursor:move;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.schedule-event-delete-button {
|
|
||||||
position:absolute;
|
|
||||||
top:3px;
|
|
||||||
right:4px;
|
|
||||||
font-weight:bold;
|
|
||||||
cursor:pointer
|
|
||||||
}
|
|
||||||
|
|
@ -260,22 +260,22 @@ describe Event do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#as_json' do
|
describe '#as_json' do
|
||||||
it 'adds the event\'s room_guid, track_color and length' do
|
it 'adds the event\'s track_color, track_text_color and length' do
|
||||||
create(:event_schedule, event: event)
|
create(:event_schedule, event: event)
|
||||||
event.track = create(:track, color: '#efefef')
|
event.track = create(:track, color: '#efefef')
|
||||||
json_hash = event.as_json(nil)
|
json_hash = event.as_json
|
||||||
|
|
||||||
expect(json_hash[:room_guid]).to eq(event.scheduled_room.guid)
|
|
||||||
expect(json_hash[:track_color]).to eq('#EFEFEF')
|
expect(json_hash[:track_color]).to eq('#EFEFEF')
|
||||||
|
expect(json_hash[:track_text_color]).to eq('black')
|
||||||
expect(json_hash[:length]).to eq(30)
|
expect(json_hash[:length]).to eq(30)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'uses correct default values for room_guid, track_color and length' do
|
it 'uses correct default values for track_color, track_text_color and length' do
|
||||||
event.event_type = nil
|
event.event_type = nil
|
||||||
json_hash = event.as_json(nil)
|
json_hash = event.as_json
|
||||||
|
|
||||||
expect(json_hash[:room_guid]).to be_nil
|
|
||||||
expect(json_hash[:track_color]).to eq('#FFFFFF')
|
expect(json_hash[:track_color]).to eq('#FFFFFF')
|
||||||
|
expect(json_hash[:track_text_color]).to eq('black')
|
||||||
expect(json_hash[:length]).to eq(15)
|
expect(json_hash[:length]).to eq(15)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||