From e8583bf7783d0e0a84abf012fb0a3fa5205c1c82 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Thu, 12 Oct 2017 16:20:34 +0200 Subject: [PATCH] information about location in daily planning --- smash/web/api_views/daily_planning.py | 5 ++++- smash/web/static/js/daily_planning.js | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/smash/web/api_views/daily_planning.py b/smash/web/api_views/daily_planning.py index 3c338e53..5086686b 100644 --- a/smash/web/api_views/daily_planning.py +++ b/smash/web/api_views/daily_planning.py @@ -191,7 +191,10 @@ def events(request, date): 'name': unicode(appointment_subject), 'id': appointment_subject.id, 'color': RANDOM_COLORS[i], - 'start':appointment.datetime_when.replace(tzinfo=None).strftime("%H:%M:00"), + 'start': appointment.datetime_when.replace(tzinfo=None).strftime("%H:%M:00"), + # this indicates only location of the first appointment + # (there is small chance to have two appointments in two different places at the same day) + 'location': str(appointment.location), 'events': [] } subjects[appointment_subject.id] = subject diff --git a/smash/web/static/js/daily_planning.js b/smash/web/static/js/daily_planning.js index 5d201b60..3e8d99c7 100644 --- a/smash/web/static/js/daily_planning.js +++ b/smash/web/static/js/daily_planning.js @@ -29,7 +29,10 @@ var overlaps = (function () { var eventsCleared = []; function add_event(event, color, subjectId, boxBody) { - var eventElement = $('<div class="fc-event ui-draggable ui-draggable-handle hidden-print">' + event.title + '<span style="float:right;padding-right:5px;">' + event.duration + '</span></div>'); + var eventElement = $('<div class="fc-event ui-draggable ui-draggable-handle hidden-print">' + event.title + + '<span style="float:right;padding-right:5px;">' + event.duration + '</span></div>' + ) + ; eventElement.removeData(); var constraintStart = $.fullCalendar.moment(event.appointment_start); var borderColor; @@ -110,7 +113,7 @@ function get_subjects_events(day) { var boxSubject = $("<div class='box box-primary'/>").css('border-top-color', subject.color); var boxBody = $("<div class='box-body' id='subject_" + subject.id + "'>"); var boxHeader = $("<div class='box-header with-border'/>"); - var title_subject = $("<h4>" + subject.name + "( " + subject.start + ")" + "</h4>"); + var title_subject = $("<h4>" + subject.name + "( " + subject.start + ") <span style='float:right;padding-right:5px;'>" + subject.location + "</span></h4>"); boxHeader.append(title_subject); $.each(subject.events, function (index_event, event) { if (event.link_when) { -- GitLab