Skip to content
Snippets Groups Projects
Commit 8dc5eea5 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '154-daily-planning' into 'master'

information about location in daily planning

Closes #154

See merge request !77
parents cd3e477e e8583bf7
No related branches found
No related tags found
1 merge request!77information about location in daily planning
Pipeline #
...@@ -191,7 +191,10 @@ def events(request, date): ...@@ -191,7 +191,10 @@ def events(request, date):
'name': unicode(appointment_subject), 'name': unicode(appointment_subject),
'id': appointment_subject.id, 'id': appointment_subject.id,
'color': RANDOM_COLORS[i], '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': [] 'events': []
} }
subjects[appointment_subject.id] = subject subjects[appointment_subject.id] = subject
......
...@@ -29,7 +29,10 @@ var overlaps = (function () { ...@@ -29,7 +29,10 @@ var overlaps = (function () {
var eventsCleared = []; var eventsCleared = [];
function add_event(event, color, subjectId, boxBody) { 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(); eventElement.removeData();
var constraintStart = $.fullCalendar.moment(event.appointment_start); var constraintStart = $.fullCalendar.moment(event.appointment_start);
var borderColor; var borderColor;
...@@ -110,7 +113,7 @@ function get_subjects_events(day) { ...@@ -110,7 +113,7 @@ function get_subjects_events(day) {
var boxSubject = $("<div class='box box-primary'/>").css('border-top-color', subject.color); var boxSubject = $("<div class='box box-primary'/>").css('border-top-color', subject.color);
var boxBody = $("<div class='box-body' id='subject_" + subject.id + "'>"); var boxBody = $("<div class='box-body' id='subject_" + subject.id + "'>");
var boxHeader = $("<div class='box-header with-border'/>"); 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); boxHeader.append(title_subject);
$.each(subject.events, function (index_event, event) { $.each(subject.events, function (index_event, event) {
if (event.link_when) { if (event.link_when) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment