From 03b1b1c7ddff07c967e6f17fe51ca80b56defed1 Mon Sep 17 00:00:00 2001 From: Carlos Vega <carlos.vega@uni.lu> Date: Wed, 3 Oct 2018 18:05:04 +0200 Subject: [PATCH] added extra availabilities in green --- smash/web/api_views/daily_planning.py | 1 + smash/web/static/js/daily_planning.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/smash/web/api_views/daily_planning.py b/smash/web/api_views/daily_planning.py index ec08fdcd..b3937a77 100644 --- a/smash/web/api_views/daily_planning.py +++ b/smash/web/api_views/daily_planning.py @@ -57,6 +57,7 @@ def get_holidays(worker, date): 'link_when': start_date, 'link_who': worker.id, 'link_end': end_date, + 'kind': holiday.kind } result.append(event) diff --git a/smash/web/static/js/daily_planning.js b/smash/web/static/js/daily_planning.js index 0febcc3c..ec0c0e57 100644 --- a/smash/web/static/js/daily_planning.js +++ b/smash/web/static/js/daily_planning.js @@ -106,7 +106,11 @@ function get_subjects_events(day) { }); var holidays = data.holidays; $.each(holidays, function (index, event) { - event.backgroundColor = '#FFAAAA !important'; + if(event.kind == 'H'){ + event.backgroundColor = '#FFAAAA !important'; + }else{ + event.backgroundColor = '#AAFFAA !important'; + } event.start = $.fullCalendar.moment(event.link_when); event.end = $.fullCalendar.moment(event.link_end); event.rendering = 'background'; @@ -287,7 +291,6 @@ $(document).ready(function () { appointmentsCleared.splice(index, 1); } } - } }); $.post({ @@ -383,7 +386,6 @@ $(document).ready(function () { html: true }); } else { - } }, selectAllow: function (selectInfo) { -- GitLab