Basic fullcalendar integration

This commit is contained in:
2015-02-19 20:37:58 +01:00
parent c17442ad77
commit adeedb2f1b
34 changed files with 11018 additions and 8 deletions
@@ -1,4 +1,5 @@
@App.modals.BaseController = Ember.ObjectController.extend @App.modals.BaseController = Ember.ObjectController.extend
needs: ['application']
alert_message: "" alert_message: ""
title: (-> title: (->
# return title if directly set by options # return title if directly set by options
@@ -0,0 +1,21 @@
App.modals.EmployeeEditController = App.modals.BaseController.extend
isNotSelf: (->
@get('model.id') isnt @get('current_employee.id')
).property('model.id')
colors: (->
# taken from http://www.somacon.com/p142.php
[
'#458B74'
'#838B8B'
'#8B7D6B'
'#00008B'
'#8B2323'
'#8A2BE2'
'#458B00'
'#EEAD0E'
]
).property()
actions:
setColor: (color)->
@set 'model.color', color
@@ -0,0 +1,7 @@
App.modals.SelectEmployeeController = App.modals.BaseController.extend
employee: null
employees: (-> @store.all 'employee').property()
actions:
selectEmployee: (employee)->
@set 'employee', employee
@send 'ok'
@@ -0,0 +1,6 @@
App.ScheduleController = Ember.ArrayController.extend
event_changed: (event)->
@store.find('employee-shift', event.id).then (employee_shift)->
employee_shift.set 'start_on', event.start.toDate()
employee_shift.set 'end_on', event.end.toDate()
employee_shift.save()
@@ -0,0 +1,2 @@
Ember.Handlebars.helper 'colorbox', (color, options)->
"<span class='colorbox-container'><span style='background-color:#{color}'></span></span>".htmlSafe()
@@ -0,0 +1,12 @@
attr = DS.attr
App.EmployeeShift = DS.Model.extend
start_on: attr('date')
end_on: attr('date')
employee: DS.belongsTo 'employee'
calendar_event: (->
id: @id
title: @get('employee.name')
start: @get('start_on')
end: @get('end_on')
color: @get('employee.color')
).property('start_on', 'end_on')
@@ -4,6 +4,8 @@ App.Employee= DS.Model.extend Ember.Validations.Mixin,
email: attr 'string' email: attr 'string'
manager: attr 'boolean', defaultValue: false manager: attr 'boolean', defaultValue: false
active: attr 'boolean', defaultValue: true active: attr 'boolean', defaultValue: true
color: attr 'string', defaultValue: '#3a87ad'
employee_shifts: DS.hasMany('employee-shift')
validations: validations:
name: {presence: true} name: {presence: true}
@@ -17,5 +17,6 @@ App.Router.map ->
@route 'orders_display' # chromecast etc @route 'orders_display' # chromecast etc
@route 'menu' @route 'menu'
@route 'settings' @route 'settings'
@route 'schedule'
@route 'empty' @route 'empty'
#@resource 'lists', queryParams: ['state'] #@resource 'lists', queryParams: ['state']
@@ -1,2 +1,2 @@
App.EmployeesRoute = Ember.Route.extend App.EmployeesRoute = Ember.Route.extend
model: -> @store.find 'employee' model: -> @store.all 'employee'
@@ -0,0 +1,2 @@
App.ScheduleRoute = Ember.Route.extend
model: -> @store.find 'employee-shift'
@@ -6,6 +6,9 @@
tr tr
th.name=t 'attributes.employee.name' th.name=t 'attributes.employee.name'
th.email=t 'attributes.employee.email' th.email=t 'attributes.employee.email'
th.boolean= t 'attributes.employee.manager'
th.boolean= t 'attributes.employee.active'
th.colorbox= t 'attributes.employee.color'
th.actions=t 'helpers.actions.title' th.actions=t 'helpers.actions.title'
tbody tbody
each employee in employees each employee in employees
@@ -14,6 +17,9 @@
td.email td.email
= employee.email = employee.email
= errors employee.errors.email = errors employee.errors.email
td.boolean= boolean employee.manager
td.boolean= boolean employee.active
td.colorbox= colorbox employee.color
td.actions td.actions
can manage sections can manage sections
a.table-edit{ action 'editEmployee' employee }: span a.table-edit{ action 'editEmployee' employee }: span
@@ -15,6 +15,8 @@ header.top-menu
= t 'models.plural.list' = t 'models.plural.list'
= link-to "employees" class="top-menu-employees" = link-to "employees" class="top-menu-employees"
= t 'models.plural.employee' = t 'models.plural.employee'
= link-to "schedule" class="top-menu-schedule"
= t 'supplier.top_menu.schedule'
.extra-info{action "showSupplierStatusInfo"} .extra-info{action "showSupplierStatusInfo"}
.supplier-info-row .supplier-info-row
.counter.supplier-orders-placed-count .counter.supplier-orders-placed-count
@@ -9,6 +9,20 @@ p=t 'employee.modal.body_header'
.form-field .form-field
= input type="email" valueBinding="model.email" action="save" = input type="email" valueBinding="model.email" action="save"
= errors model.errors.email = errors model.errors.email
if isNotSelf
.form-row.active
.form-label= t 'attributes.employee.manager'
.form-field= view "boolean-switch" value=model.manager
.form-row.active
.form-label= t 'attributes.employee.active'
.form-field= view "boolean-switch" value=model.active
.form-row.active
.form-label= t 'attributes.employee.color'
.form-field.full
span.current-color= colorbox model.color
each color in colors
a{action "setColor" color}= colorbox color
hr hr
button.modal-close{action "close"}=t 'employee.modal.close_button' button.modal-close{action "close"}=t 'employee.modal.close_button'
button.modal-confirm.right{action "save"} disabled=model.isInvalid button.modal-confirm.right{action "save"} disabled=model.isInvalid
@@ -0,0 +1,7 @@
p Select employee
ul.select-employees
each employee in employees
li.select-employee
= employee.name
a.employee-selector{action "selectEmployee" employee}: span
button.modal-close{action "close"}=t 'employee.select_modal.close_button'
@@ -0,0 +1,2 @@
.row: .small-12.columns
#schedule-placeholder
@@ -0,0 +1,30 @@
App.ScheduleView = Ember.View.extend
classNames: ['schedule-view']
didInsertElement: ->
placeholder = @$('#schedule-placeholder')
controller = @get('controller')
events = controller.get('model').map (employee_shift)->employee_shift.get('calendar_event')
placeholder.fullCalendar
header:
left: 'prev,next,today'
center: 'title'
right: 'month,agendaWeek,agendaDay'
selectable: true
selectHelper: true
select: (start, end)=>
controller.modal 'select_employee',
ok: ->
# this context is SelectEmployeeController
if employee = @get('employee')
shift = controller.store.createRecord 'employee-shift', start_on: start.toDate(), end_on: end.toDate()
shift.set 'employee', employee
shift.save()
placeholder.fullCalendar('renderEvent', shift.get('calendar_event'), true)
editable: true
defaultView: 'agendaWeek'
events: events
timezone: 'UTC'
eventDrop: controller.event_changed.bind(controller)
eventResize: controller.event_changed.bind(controller)
@@ -6,6 +6,7 @@
// require foundation FOUNDATION 5 JAVASCRIPT IMPLEMENTATIONS AND EMBER ARE NOT COMPATIBLE, FOUNDATION IS TOO SIMPLISTIC AT THE MOMENT AND DESTROYS DOM EVENTS // require foundation FOUNDATION 5 JAVASCRIPT IMPLEMENTATIONS AND EMBER ARE NOT COMPATIBLE, FOUNDATION IS TOO SIMPLISTIC AT THE MOMENT AND DESTROYS DOM EVENTS
//= require js-routes //= require js-routes
//= require moment //= require moment
//= require fullcalendar
//= require translations //= require translations
// require qwaiter // require qwaiter
// require ./qsupplier // require ./qsupplier
@@ -1,5 +1,7 @@
td.boolean td.boolean
+table-fit +table-fit
.boolean-true
@extend .fa, .fa-check
&.needs_help &.needs_help
.boolean-true .boolean-true
@extend .fa @extend .fa
@@ -8,6 +10,8 @@ td.boolean
.boolean-true .boolean-true
@extend .fa @extend .fa
@extend .fa-money @extend .fa-money
td.colorbox
+table-fit
.list-orders-container .list-orders-container
.currency .currency
float: right float: right
@@ -1,6 +1,7 @@
//= require qtip //= require qtip
//= require_directory ../base1-shared //= require_directory ../base1-shared
//= require pickdate //= require pickdate
//= require fullcalendar
@import bourbon @import bourbon
@import ./qconstants @import ./qconstants
@import ./foundation_and_overrides @import ./foundation_and_overrides
@@ -0,0 +1,22 @@
.colorbox-container
line-height: 1px
display: inline-block
span
display: inline-block
.form-field
.current-color
.colorbox-container
padding: 4px
border: 2px solid #777
margin-right: 16px
span
width: 32px
height: 32px
.colorbox-container
margin-right: 8px
span
width: 32px
height: 32px
td .colorbox-container span
width: 16px
height: 16px
@@ -0,0 +1,11 @@
ul.select-employees
list-style: none
li
padding-bottom: 7px
border-bottom: 1px solid #ccc
margin-bottom: 7px
+clearfix
.employee-selector
float: right
span
@extend .fa, .fa-2x, .fa-user-plus
@@ -0,0 +1,24 @@
module Suppliers
class EmployeeShiftsController < Suppliers::ApplicationController
def index
render json: current_supplier.employee_shifts, each_serializer: Suppliers::EmployeeShiftSerializer
end
def create
@employee_shift.supplier = current_supplier
@employee_shift.save
render json: @employee_shift, serializer: Suppliers::EmployeeShiftSerializer
end
def update
@employee_shift.update employee_shift_params
render json: @employee_shift, serializer: Suppliers::EmployeeShiftSerializer
end
private
def employee_shift_params
params.require(:employee_shift).permit(:start_on, :end_on, :employee_id)
end
end
end
@@ -32,7 +32,8 @@ module Suppliers
# PUT /employees/1.json # PUT /employees/1.json
def update def update
@employee = Employee.find(params[:id]) @employee = Employee.find(params[:id])
render json: {}, status: 404 unless @employee.supplier_id == current_supplier.id render json: {}, status: 404 unless current_supplier.employee_ids.include?(@employee.id)
current_supplier.settings_for(@employee).update!(employee_params)
respond_to do |format| respond_to do |format|
if @employee.update_attributes(employee_params) if @employee.update_attributes(employee_params)
format.json { head :no_content } format.json { head :no_content }
@@ -57,7 +58,7 @@ module Suppliers
private private
def employee_params def employee_params
params.require(:employee).permit(:name, :email) params.require(:employee).permit(:name, :email, :active, :manager, :color)
end end
end end
end end
+3 -1
View File
@@ -3,7 +3,8 @@ class Employee
include ActiveModel::SerializerSupport include ActiveModel::SerializerSupport
DEFAULT_SETTINGS = { DEFAULT_SETTINGS = {
'manager' => false, 'manager' => false,
'active' => true 'active' => true,
'color' => '#3a87ad'
} }
attr_accessor *DEFAULT_SETTINGS.keys attr_accessor *DEFAULT_SETTINGS.keys
attr_reader :settings attr_reader :settings
@@ -15,6 +16,7 @@ class Employee
property :name property :name
#property :email #property :email
has_many :employee_shifts
view :by_email, key: :email view :by_email, key: :email
class << self class << self
+9
View File
@@ -0,0 +1,9 @@
class EmployeeShift
include SimplyStored::Couch
include ActiveModel::SerializerSupport
property :start_on, type: Time
property :end_on, type: Time
belongs_to :supplier
belongs_to :employee
end
+1
View File
@@ -41,6 +41,7 @@ class Supplier
has_many :orders, dependent: :destroy has_many :orders, dependent: :destroy
has_many :sections, dependent: :destroy has_many :sections, dependent: :destroy
has_and_belongs_to_many :employees, storing_keys: true has_and_belongs_to_many :employees, storing_keys: true
has_many :employee_shifts
alias_method :non_enriced_employees, :employees alias_method :non_enriced_employees, :employees
def employees def employees
+24 -3
View File
@@ -24,7 +24,7 @@ class SupplierEmployeesSettings
end end
end end
def persist def to_store!
supplier.employee_settings_storage = dictionary supplier.employee_settings_storage = dictionary
end end
@@ -42,7 +42,7 @@ class SupplierEmployeesSettings
alias_method :orig_setter, :[]= alias_method :orig_setter, :[]=
def []=(*args) def []=(*args)
orig_setter(*args) orig_setter(*args)
all_employees_settings.persist all_employees_settings.to_store!
end end
end end
@@ -74,7 +74,7 @@ class SupplierEmployeesSettings
if employee = all_employees_settings.supplier.employees.find{|e| e.id == id} if employee = all_employees_settings.supplier.employees.find{|e| e.id == id}
employee.public_send("#{attribute}=", value) employee.public_send("#{attribute}=", value)
end end
all_employees_settings.supplier.save if persist persist! if persist
self self
end end
@@ -86,6 +86,27 @@ class SupplierEmployeesSettings
set attribute, value, persist: true set attribute, value, persist: true
end end
def update(params)
Employee::DEFAULT_SETTINGS.keys.each do |attribute|
if params.has_key?(attribute)
new_value = params.delete(attribute)
set attribute, new_value
end
end
params
end
def update!(params)
update params
persist!
params
end
def persist!
all_employees_settings.supplier.is_dirty
all_employees_settings.supplier.save
end
# Parse a method name to its underlying operations # Parse a method name to its underlying operations
# settings.is_manager? # settings.is_manager?
# is a getter for the attribute manager # is a getter for the attribute manager
@@ -1,5 +1,5 @@
class Suppliers::EmployeeSerializer < Qwaiter::Serializer class Suppliers::EmployeeSerializer < Qwaiter::Serializer
self.root = :employee self.root = :employee
embed :ids, include: true embed :ids, include: true
attributes :name, :email, :manager, :active attributes :name, :email, :manager, :active, :color
end end
@@ -0,0 +1,5 @@
class Suppliers::EmployeeShiftSerializer < Qwaiter::Serializer
self.root = :employee_shift
#embed :ids, include: true
attributes :start_on, :end_on, :employee_id
end
@@ -9,4 +9,5 @@ class Suppliers::SupplierSerializer < Qwaiter::Serializer
end end
has_many :sections, serializer: Suppliers::ExtendedSectionSerializer has_many :sections, serializer: Suppliers::ExtendedSectionSerializer
has_many :product_categories has_many :product_categories
has_many :employees, serializer: Suppliers::EmployeeSerializer
end end
+1
View File
@@ -21,6 +21,7 @@ en:
no_orders: No active orders no_orders: No active orders
top_menu: top_menu:
menu: Menu menu: Menu
schedule: Schedule
active_lists: active_lists:
title: Active lists title: Active lists
price: Price price: Price
+1
View File
@@ -134,6 +134,7 @@ Qwaiter::Application.routes.draw do
end end
resources :employees resources :employees
resources :employee_shifts
resources :products do resources :products do
collection do collection do
get :preview_products get :preview_products
+977
View File
@@ -0,0 +1,977 @@
/*!
* FullCalendar v2.2.7 Stylesheet
* Docs & License: http://arshaw.com/fullcalendar/
* (c) 2013 Adam Shaw
*/
.fc {
direction: ltr;
text-align: left;
}
.fc-rtl {
text-align: right;
}
body .fc { /* extra precedence to overcome jqui */
font-size: 1em;
}
/* Colors
--------------------------------------------------------------------------------------------------*/
.fc-unthemed th,
.fc-unthemed td,
.fc-unthemed hr,
.fc-unthemed thead,
.fc-unthemed tbody,
.fc-unthemed .fc-row,
.fc-unthemed .fc-popover {
border-color: #ddd;
}
.fc-unthemed .fc-popover {
background-color: #fff;
}
.fc-unthemed hr,
.fc-unthemed .fc-popover .fc-header {
background: #eee;
}
.fc-unthemed .fc-popover .fc-header .fc-close {
color: #666;
}
.fc-unthemed .fc-today {
background: #fcf8e3;
}
.fc-highlight { /* when user is selecting cells */
background: #bce8f1;
opacity: .3;
filter: alpha(opacity=30); /* for IE */
}
.fc-bgevent { /* default look for background events */
background: rgb(143, 223, 130);
opacity: .3;
filter: alpha(opacity=30); /* for IE */
}
.fc-nonbusiness { /* default look for non-business-hours areas */
/* will inherit .fc-bgevent's styles */
background: #ccc;
}
/* Icons (inline elements with styled text that mock arrow icons)
--------------------------------------------------------------------------------------------------*/
.fc-icon {
display: inline-block;
font-size: 2em;
line-height: .5em;
height: .5em; /* will make the total height 1em */
font-family: "Courier New", Courier, monospace;
}
.fc-icon-left-single-arrow:after {
content: "\02039";
font-weight: bold;
}
.fc-icon-right-single-arrow:after {
content: "\0203A";
font-weight: bold;
}
.fc-icon-left-double-arrow:after {
content: "\000AB";
}
.fc-icon-right-double-arrow:after {
content: "\000BB";
}
.fc-icon-x:after {
content: "\000D7";
}
/* Buttons (styled <button> tags, normalized to work cross-browser)
--------------------------------------------------------------------------------------------------*/
.fc button {
/* force height to include the border and padding */
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
/* dimensions */
margin: 0;
height: 2.1em;
padding: 0 .6em;
/* text & cursor */
font-size: 1em; /* normalize */
white-space: nowrap;
cursor: pointer;
}
/* Firefox has an annoying inner border */
.fc button::-moz-focus-inner { margin: 0; padding: 0; }
.fc-state-default { /* non-theme */
border: 1px solid;
}
.fc-state-default.fc-corner-left { /* non-theme */
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.fc-state-default.fc-corner-right { /* non-theme */
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
/* icons in buttons */
.fc button .fc-icon { /* non-theme */
position: relative;
top: .05em; /* seems to be a good adjustment across browsers */
margin: 0 .1em;
}
/*
button states
borrowed from twitter bootstrap (http://twitter.github.com/bootstrap/)
*/
.fc-state-default {
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
color: #333;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.fc-state-hover,
.fc-state-down,
.fc-state-active,
.fc-state-disabled {
color: #333333;
background-color: #e6e6e6;
}
.fc-state-hover {
color: #333333;
text-decoration: none;
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
.fc-state-down,
.fc-state-active {
background-color: #cccccc;
background-image: none;
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.fc-state-disabled {
cursor: default;
background-image: none;
opacity: 0.65;
filter: alpha(opacity=65);
box-shadow: none;
}
/* Buttons Groups
--------------------------------------------------------------------------------------------------*/
.fc-button-group {
display: inline-block;
}
/*
every button that is not first in a button group should scootch over one pixel and cover the
previous button's border...
*/
.fc .fc-button-group > * { /* extra precedence b/c buttons have margin set to zero */
float: left;
margin: 0 0 0 -1px;
}
.fc .fc-button-group > :first-child { /* same */
margin-left: 0;
}
/* Popover
--------------------------------------------------------------------------------------------------*/
.fc-popover {
position: absolute;
box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.fc-popover .fc-header {
padding: 2px 4px;
}
.fc-popover .fc-header .fc-title {
margin: 0 2px;
}
.fc-popover .fc-header .fc-close {
cursor: pointer;
}
.fc-ltr .fc-popover .fc-header .fc-title,
.fc-rtl .fc-popover .fc-header .fc-close {
float: left;
}
.fc-rtl .fc-popover .fc-header .fc-title,
.fc-ltr .fc-popover .fc-header .fc-close {
float: right;
}
/* unthemed */
.fc-unthemed .fc-popover {
border-width: 1px;
border-style: solid;
}
.fc-unthemed .fc-popover .fc-header .fc-close {
font-size: 25px;
margin-top: 4px;
}
/* jqui themed */
.fc-popover > .ui-widget-header + .ui-widget-content {
border-top: 0; /* where they meet, let the header have the border */
}
/* Misc Reusable Components
--------------------------------------------------------------------------------------------------*/
.fc hr {
height: 0;
margin: 0;
padding: 0 0 2px; /* height is unreliable across browsers, so use padding */
border-style: solid;
border-width: 1px 0;
}
.fc-clear {
clear: both;
}
.fc-bg,
.fc-bgevent-skeleton,
.fc-highlight-skeleton,
.fc-helper-skeleton {
/* these element should always cling to top-left/right corners */
position: absolute;
top: 0;
left: 0;
right: 0;
}
.fc-bg {
bottom: 0; /* strech bg to bottom edge */
}
.fc-bg table {
height: 100%; /* strech bg to bottom edge */
}
/* Tables
--------------------------------------------------------------------------------------------------*/
.fc table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
border-spacing: 0;
font-size: 1em; /* normalize cross-browser */
}
.fc th {
text-align: center;
}
.fc th,
.fc td {
border-style: solid;
border-width: 1px;
padding: 0;
vertical-align: top;
}
.fc td.fc-today {
border-style: double; /* overcome neighboring borders */
}
/* Fake Table Rows
--------------------------------------------------------------------------------------------------*/
.fc .fc-row { /* extra precedence to overcome themes w/ .ui-widget-content forcing a 1px border */
/* no visible border by default. but make available if need be (scrollbar width compensation) */
border-style: solid;
border-width: 0;
}
.fc-row table {
/* don't put left/right border on anything within a fake row.
the outer tbody will worry about this */
border-left: 0 hidden transparent;
border-right: 0 hidden transparent;
/* no bottom borders on rows */
border-bottom: 0 hidden transparent;
}
.fc-row:first-child table {
border-top: 0 hidden transparent; /* no top border on first row */
}
/* Day Row (used within the header and the DayGrid)
--------------------------------------------------------------------------------------------------*/
.fc-row {
position: relative;
}
.fc-row .fc-bg {
z-index: 1;
}
/* highlighting cells & background event skeleton */
.fc-row .fc-bgevent-skeleton,
.fc-row .fc-highlight-skeleton {
bottom: 0; /* stretch skeleton to bottom of row */
}
.fc-row .fc-bgevent-skeleton table,
.fc-row .fc-highlight-skeleton table {
height: 100%; /* stretch skeleton to bottom of row */
}
.fc-row .fc-highlight-skeleton td,
.fc-row .fc-bgevent-skeleton td {
border-color: transparent;
}
.fc-row .fc-bgevent-skeleton {
z-index: 2;
}
.fc-row .fc-highlight-skeleton {
z-index: 3;
}
/*
row content (which contains day/week numbers and events) as well as "helper" (which contains
temporary rendered events).
*/
.fc-row .fc-content-skeleton {
position: relative;
z-index: 4;
padding-bottom: 2px; /* matches the space above the events */
}
.fc-row .fc-helper-skeleton {
z-index: 5;
}
.fc-row .fc-content-skeleton td,
.fc-row .fc-helper-skeleton td {
/* see-through to the background below */
background: none; /* in case <td>s are globally styled */
border-color: transparent;
/* don't put a border between events and/or the day number */
border-bottom: 0;
}
.fc-row .fc-content-skeleton tbody td, /* cells with events inside (so NOT the day number cell) */
.fc-row .fc-helper-skeleton tbody td {
/* don't put a border between event cells */
border-top: 0;
}
/* Scrolling Container
--------------------------------------------------------------------------------------------------*/
.fc-scroller { /* this class goes on elements for guaranteed vertical scrollbars */
overflow-y: scroll;
overflow-x: hidden;
}
.fc-scroller > * { /* we expect an immediate inner element */
position: relative; /* re-scope all positions */
width: 100%; /* hack to force re-sizing this inner element when scrollbars appear/disappear */
overflow: hidden; /* don't let negative margins or absolute positioning create further scroll */
}
/* Global Event Styles
--------------------------------------------------------------------------------------------------*/
.fc-event {
position: relative; /* for resize handle and other inner positioning */
display: block; /* make the <a> tag block */
font-size: .85em;
line-height: 1.3;
border-radius: 3px;
border: 1px solid #3a87ad; /* default BORDER color */
background-color: #3a87ad; /* default BACKGROUND color */
font-weight: normal; /* undo jqui's ui-widget-header bold */
}
/* overpower some of bootstrap's and jqui's styles on <a> tags */
.fc-event,
.fc-event:hover,
.ui-widget .fc-event {
color: #fff; /* default TEXT color */
text-decoration: none; /* if <a> has an href */
}
.fc-event[href],
.fc-event.fc-draggable {
cursor: pointer; /* give events with links and draggable events a hand mouse pointer */
}
.fc-not-allowed, /* causes a "warning" cursor. applied on body */
.fc-not-allowed .fc-event { /* to override an event's custom cursor */
cursor: not-allowed;
}
/* DayGrid events
----------------------------------------------------------------------------------------------------
We use the full "fc-day-grid-event" class instead of using descendants because the event won't
be a descendant of the grid when it is being dragged.
*/
.fc-day-grid-event {
margin: 1px 2px 0; /* spacing between events and edges */
padding: 0 1px;
}
/* events that are continuing to/from another week. kill rounded corners and butt up against edge */
.fc-ltr .fc-day-grid-event.fc-not-start,
.fc-rtl .fc-day-grid-event.fc-not-end {
margin-left: 0;
border-left-width: 0;
padding-left: 1px; /* replace the border with padding */
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.fc-ltr .fc-day-grid-event.fc-not-end,
.fc-rtl .fc-day-grid-event.fc-not-start {
margin-right: 0;
border-right-width: 0;
padding-right: 1px; /* replace the border with padding */
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.fc-day-grid-event > .fc-content { /* force events to be one-line tall */
white-space: nowrap;
overflow: hidden;
}
.fc-day-grid-event .fc-time {
font-weight: bold;
}
/* resize handle (outside of fc-content, so can go outside of bounds) */
.fc-day-grid-event .fc-resizer {
position: absolute;
top: 0;
bottom: 0;
width: 7px;
}
.fc-ltr .fc-day-grid-event .fc-resizer {
right: -3px;
cursor: e-resize;
}
.fc-rtl .fc-day-grid-event .fc-resizer {
left: -3px;
cursor: w-resize;
}
/* Event Limiting
--------------------------------------------------------------------------------------------------*/
/* "more" link that represents hidden events */
a.fc-more {
margin: 1px 3px;
font-size: .85em;
cursor: pointer;
text-decoration: none;
}
a.fc-more:hover {
text-decoration: underline;
}
.fc-limited { /* rows and cells that are hidden because of a "more" link */
display: none;
}
/* popover that appears when "more" link is clicked */
.fc-day-grid .fc-row {
z-index: 1; /* make the "more" popover one higher than this */
}
.fc-more-popover {
z-index: 2;
width: 220px;
}
.fc-more-popover .fc-event-container {
padding: 10px;
}
/* Toolbar
--------------------------------------------------------------------------------------------------*/
.fc-toolbar {
text-align: center;
margin-bottom: 1em;
}
.fc-toolbar .fc-left {
float: left;
}
.fc-toolbar .fc-right {
float: right;
}
.fc-toolbar .fc-center {
display: inline-block;
}
/* the things within each left/right/center section */
.fc .fc-toolbar > * > * { /* extra precedence to override button border margins */
float: left;
margin-left: .75em;
}
/* the first thing within each left/center/right section */
.fc .fc-toolbar > * > :first-child { /* extra precedence to override button border margins */
margin-left: 0;
}
/* title text */
.fc-toolbar h2 {
margin: 0;
}
/* button layering (for border precedence) */
.fc-toolbar button {
position: relative;
}
.fc-toolbar .fc-state-hover,
.fc-toolbar .ui-state-hover {
z-index: 2;
}
.fc-toolbar .fc-state-down {
z-index: 3;
}
.fc-toolbar .fc-state-active,
.fc-toolbar .ui-state-active {
z-index: 4;
}
.fc-toolbar button:focus {
z-index: 5;
}
/* View Structure
--------------------------------------------------------------------------------------------------*/
/* undo twitter bootstrap's box-sizing rules. normalizes positioning techniques */
/* don't do this for the toolbar because we'll want bootstrap to style those buttons as some pt */
.fc-view-container *,
.fc-view-container *:before,
.fc-view-container *:after {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.fc-view, /* scope positioning and z-index's for everything within the view */
.fc-view > table { /* so dragged elements can be above the view's main element */
position: relative;
z-index: 1;
}
/* BasicView
--------------------------------------------------------------------------------------------------*/
/* day row structure */
.fc-basicWeek-view .fc-content-skeleton,
.fc-basicDay-view .fc-content-skeleton {
/* we are sure there are no day numbers in these views, so... */
padding-top: 1px; /* add a pixel to make sure there are 2px padding above events */
padding-bottom: 1em; /* ensure a space at bottom of cell for user selecting/clicking */
}
.fc-basic-view tbody .fc-row {
min-height: 4em; /* ensure that all rows are at least this tall */
}
/* a "rigid" row will take up a constant amount of height because content-skeleton is absolute */
.fc-row.fc-rigid {
overflow: hidden;
}
.fc-row.fc-rigid .fc-content-skeleton {
position: absolute;
top: 0;
left: 0;
right: 0;
}
/* week and day number styling */
.fc-basic-view .fc-week-number,
.fc-basic-view .fc-day-number {
padding: 0 2px;
}
.fc-basic-view td.fc-week-number span,
.fc-basic-view td.fc-day-number {
padding-top: 2px;
padding-bottom: 2px;
}
.fc-basic-view .fc-week-number {
text-align: center;
}
.fc-basic-view .fc-week-number span {
/* work around the way we do column resizing and ensure a minimum width */
display: inline-block;
min-width: 1.25em;
}
.fc-ltr .fc-basic-view .fc-day-number {
text-align: right;
}
.fc-rtl .fc-basic-view .fc-day-number {
text-align: left;
}
.fc-day-number.fc-other-month {
opacity: 0.3;
filter: alpha(opacity=30); /* for IE */
/* opacity with small font can sometimes look too faded
might want to set the 'color' property instead
making day-numbers bold also fixes the problem */
}
/* AgendaView all-day area
--------------------------------------------------------------------------------------------------*/
.fc-agenda-view .fc-day-grid {
position: relative;
z-index: 2; /* so the "more.." popover will be over the time grid */
}
.fc-agenda-view .fc-day-grid .fc-row {
min-height: 3em; /* all-day section will never get shorter than this */
}
.fc-agenda-view .fc-day-grid .fc-row .fc-content-skeleton {
padding-top: 1px; /* add a pixel to make sure there are 2px padding above events */
padding-bottom: 1em; /* give space underneath events for clicking/selecting days */
}
/* TimeGrid axis running down the side (for both the all-day area and the slot area)
--------------------------------------------------------------------------------------------------*/
.fc .fc-axis { /* .fc to overcome default cell styles */
vertical-align: middle;
padding: 0 4px;
white-space: nowrap;
}
.fc-ltr .fc-axis {
text-align: right;
}
.fc-rtl .fc-axis {
text-align: left;
}
.ui-widget td.fc-axis {
font-weight: normal; /* overcome jqui theme making it bold */
}
/* TimeGrid Structure
--------------------------------------------------------------------------------------------------*/
.fc-time-grid-container, /* so scroll container's z-index is below all-day */
.fc-time-grid { /* so slats/bg/content/etc positions get scoped within here */
position: relative;
z-index: 1;
}
.fc-time-grid {
min-height: 100%; /* so if height setting is 'auto', .fc-bg stretches to fill height */
}
.fc-time-grid table { /* don't put outer borders on slats/bg/content/etc */
border: 0 hidden transparent;
}
.fc-time-grid > .fc-bg {
z-index: 1;
}
.fc-time-grid .fc-slats,
.fc-time-grid > hr { /* the <hr> AgendaView injects when grid is shorter than scroller */
position: relative;
z-index: 2;
}
.fc-time-grid .fc-bgevent-skeleton,
.fc-time-grid .fc-content-skeleton {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.fc-time-grid .fc-bgevent-skeleton {
z-index: 3;
}
.fc-time-grid .fc-highlight-skeleton {
z-index: 4;
}
.fc-time-grid .fc-content-skeleton {
z-index: 5;
}
.fc-time-grid .fc-helper-skeleton {
z-index: 6;
}
/* TimeGrid Slats (lines that run horizontally)
--------------------------------------------------------------------------------------------------*/
.fc-slats td {
height: 1.5em;
border-bottom: 0; /* each cell is responsible for its top border */
}
.fc-slats .fc-minor td {
border-top-style: dotted;
}
.fc-slats .ui-widget-content { /* for jqui theme */
background: none; /* see through to fc-bg */
}
/* TimeGrid Highlighting Slots
--------------------------------------------------------------------------------------------------*/
.fc-time-grid .fc-highlight-container { /* a div within a cell within the fc-highlight-skeleton */
position: relative; /* scopes the left/right of the fc-highlight to be in the column */
}
.fc-time-grid .fc-highlight {
position: absolute;
left: 0;
right: 0;
/* top and bottom will be in by JS */
}
/* TimeGrid Event Containment
--------------------------------------------------------------------------------------------------*/
.fc-time-grid .fc-event-container, /* a div within a cell within the fc-content-skeleton */
.fc-time-grid .fc-bgevent-container { /* a div within a cell within the fc-bgevent-skeleton */
position: relative;
}
.fc-ltr .fc-time-grid .fc-event-container { /* space on the sides of events for LTR (default) */
margin: 0 2.5% 0 2px;
}
.fc-rtl .fc-time-grid .fc-event-container { /* space on the sides of events for RTL */
margin: 0 2px 0 2.5%;
}
.fc-time-grid .fc-event,
.fc-time-grid .fc-bgevent {
position: absolute;
z-index: 1; /* scope inner z-index's */
}
.fc-time-grid .fc-bgevent {
/* background events always span full width */
left: 0;
right: 0;
}
/* TimeGrid Event Styling
----------------------------------------------------------------------------------------------------
We use the full "fc-time-grid-event" class instead of using descendants because the event won't
be a descendant of the grid when it is being dragged.
*/
.fc-time-grid-event.fc-not-start { /* events that are continuing from another day */
/* replace space made by the top border with padding */
border-top-width: 0;
padding-top: 1px;
/* remove top rounded corners */
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.fc-time-grid-event.fc-not-end {
/* replace space made by the top border with padding */
border-bottom-width: 0;
padding-bottom: 1px;
/* remove bottom rounded corners */
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.fc-time-grid-event {
overflow: hidden; /* don't let the bg flow over rounded corners */
}
.fc-time-grid-event > .fc-content { /* contains the time and title, but no bg and resizer */
position: relative;
z-index: 2; /* above the bg */
}
.fc-time-grid-event .fc-time,
.fc-time-grid-event .fc-title {
padding: 0 1px;
}
.fc-time-grid-event .fc-time {
font-size: .85em;
white-space: nowrap;
}
.fc-time-grid-event .fc-bg {
z-index: 1;
background: #fff;
opacity: .25;
filter: alpha(opacity=25); /* for IE */
}
/* short mode, where time and title are on the same line */
.fc-time-grid-event.fc-short .fc-content {
/* don't wrap to second line (now that contents will be inline) */
white-space: nowrap;
}
.fc-time-grid-event.fc-short .fc-time,
.fc-time-grid-event.fc-short .fc-title {
/* put the time and title on the same line */
display: inline-block;
vertical-align: top;
}
.fc-time-grid-event.fc-short .fc-time span {
display: none; /* don't display the full time text... */
}
.fc-time-grid-event.fc-short .fc-time:before {
content: attr(data-start); /* ...instead, display only the start time */
}
.fc-time-grid-event.fc-short .fc-time:after {
content: "\000A0-\000A0"; /* seperate with a dash, wrapped in nbsp's */
}
.fc-time-grid-event.fc-short .fc-title {
font-size: .85em; /* make the title text the same size as the time */
padding: 0; /* undo padding from above */
}
/* resizer */
.fc-time-grid-event .fc-resizer {
position: absolute;
z-index: 3; /* above content */
left: 0;
right: 0;
bottom: 0;
height: 8px;
overflow: hidden;
line-height: 8px;
font-size: 11px;
font-family: monospace;
text-align: center;
cursor: s-resize;
}
.fc-time-grid-event .fc-resizer:after {
content: "=";
}
File diff suppressed because it is too large Load Diff