diff --git a/src/assets/css/backend.css b/src/assets/css/backend.css index a6115946..efa422c2 100644 --- a/src/assets/css/backend.css +++ b/src/assets/css/backend.css @@ -416,6 +416,53 @@ body .form-horizontal .controls { margin-left: 158px; } +#calendar .calendar-view { + overflow-x: scroll; +} + +#calendar .calendar-view > div { + width: 100%; + min-width: 1000%; + overflow: auto; +} + +#calendar .calendar-view .date-column { + overflow: auto; + float: left; + margin-right: 20px; +} + +#calendar .calendar-view .date-column .provider-column .not-working { + background: #eaeaea; + border-radius: 3px; + padding: 10px; + text-align: center; +} + +#calendar .calendar-view .date-column .provider-column { + overflow: auto; + float: left; + margin-right: 10px; +} + +#calendar .calendar-view .date-column .provider-column .event { + font-size: 10px; + border-radius: 3px; + padding: 2px 3px; + cursor: pointer; +} + +#calendar .calendar-view .date-column .provider-column .event.appointment { + background: #4790CA; + color: #fff; + +} + +#calendar .calendar-view .date-column .provider-column .event.unavailability { + background: #409482; + color: #fff; + +} /* BACKEND CUSTOMERS PAGE -------------------------------------------------------------------- */ diff --git a/src/assets/js/backend_calendar_table_view.js b/src/assets/js/backend_calendar_table_view.js index 24317250..741b8820 100644 --- a/src/assets/js/backend_calendar_table_view.js +++ b/src/assets/js/backend_calendar_table_view.js @@ -73,6 +73,8 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $('#select-service').val(serviceId).trigger('change'); $('#select-provider').val(providerId).trigger('change'); }); + + $(window).on('resize', _setCalendarSize); } function _createHeader() { @@ -107,7 +109,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; * @param {Date} endDate End date to be displayed. */ function _createView(startDate, endDate) { - $('#calendar .calendar-view').empty(); + $('#calendar .calendar-view').remove(); var $calendarView = $('
').appendTo('#calendar'); @@ -116,6 +118,8 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; endDate: endDate.toString('yyyy-MM-dd') }); + var $wrapper = $('').appendTo($calendarView); + _getCalendarEvents(startDate, endDate) .done(function(response) { if (!GeneralFunctions.handleAjaxExceptions(response)) { @@ -125,21 +129,21 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; var currentDate = startDate; while(currentDate <= endDate) { - _createDateColumn($calendarView, currentDate, response); + _createDateColumn($wrapper, currentDate, response); currentDate.add({days: 1}); } + + _setCalendarSize(); }) .fail(GeneralFunctions.ajaxFailureHandler); - - } - function _createDateColumn($calendarView, date, events) { - var $dateColumn = $('').appendTo($calendarView); + function _createDateColumn($wrapper, date, events) { + var $dateColumn = $('').appendTo($wrapper); $dateColumn .data('date', date.getTime()) - .append('