From 6eef902282a4f08f0e771defe051e2134799a9f5 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Mon, 3 Apr 2017 17:51:20 +0200 Subject: [PATCH] edit appointment page dynamically loads appointment list --- smash/web/templates/appointments/add.html | 13 +------------ smash/web/templates/appointments/index.html | 2 +- smash/web/views/appointment.py | 3 +-- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/smash/web/templates/appointments/add.html b/smash/web/templates/appointments/add.html index 63c8d3b1..416d0a3e 100644 --- a/smash/web/templates/appointments/add.html +++ b/smash/web/templates/appointments/add.html @@ -136,18 +136,7 @@ document.getElementById("id_datetime_when").value = dateString; }, - events: [ - {% for appointment in full_appointment_list %} - { - title: '{{ appointment.title }}', - start: '{{ appointment.datetime_when | date:"c" }}', - end: '{{ appointment.datetime_until | date:"c" }}', - color: '{{ appointment.color }}', - subject_id: '{{ appointment.visit.subject.id }}', - id: '{{ appointment.id }}' - }, - {% endfor %} - ], + events: get_calendar_events_function("{% url 'web.api.appointments' full_list %}", false), }); }); diff --git a/smash/web/templates/appointments/index.html b/smash/web/templates/appointments/index.html index b06cb857..66aa9797 100644 --- a/smash/web/templates/appointments/index.html +++ b/smash/web/templates/appointments/index.html @@ -105,7 +105,7 @@ weekNumbers: true, startParam: "start_date", endParam: "end_date", - events: get_calendar_events_function("{% url 'web.api.appointments' full_list %}", true), + events: get_calendar_events_function("{% url 'web.api.appointments' full_list %}", false), }); }); </script> diff --git a/smash/web/views/appointment.py b/smash/web/views/appointment.py index 44861ab7..71ec5824 100644 --- a/smash/web/views/appointment.py +++ b/smash/web/views/appointment.py @@ -36,7 +36,6 @@ def appointment_details(request, id): def appointment_add(request, visit_id=None): - full_list = get_calendar_full_appointments(request.user) if request.method == 'POST': form = AppointmentAddForm(request.POST, request.FILES, user=request.user) if form.is_valid(): @@ -50,7 +49,7 @@ def appointment_add(request, visit_id=None): form = AppointmentAddForm(user=request.user) return wrap_response(request, 'appointments/add.html', - {'form': form, 'visitID': visit_id, 'full_appointment_list': full_list}) + {'form': form, 'visitID': visit_id, 'full_list': APPOINTMENT_LIST_GENERIC}) def appointment_edit(request, id): -- GitLab