diff --git a/smash/web/api_views/daily_planning.py b/smash/web/api_views/daily_planning.py index 3c338e5371efa7ef283b5c460cd0c60b00679796..5086686b96a7ff5d8cb78f8b9d0ba002e75e685f 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 5d201b60c19d1577eb76a3982c38aa1692c5b74e..3e8d99c733e69497c5ced378c970689cb6bd7f67 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) {