From 7f67e061f336ff2eddc9154a7d441a9dabdfd106 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Wed, 1 Mar 2017 12:45:45 +0100
Subject: [PATCH] all appointments are presented in calendar view

---
 smash/web/templates/appointments/index.html | 14 +++++++-------
 smash/web/views.py                          |  4 +++-
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/smash/web/templates/appointments/index.html b/smash/web/templates/appointments/index.html
index 23c2de5c..4d6116da 100644
--- a/smash/web/templates/appointments/index.html
+++ b/smash/web/templates/appointments/index.html
@@ -135,14 +135,14 @@
 				},
 				editable: false,
 				events: [
-        {% for approach in approaching_list %}
+        {% for appointment in full_list %}
           {
-            title: '{{ approach.title }}',
-            start: '{{ approach.datetime_when | date:"c" }}',
-            end: '{{ approach.datetime_until | date:"c" }}',
-            color: '{{ approach.color }}',
-            subject_id: '{{ approach.visit.subject.id }}',
-            id: '{{ approach.id }}'
+            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 %}
           ],
diff --git a/smash/web/views.py b/smash/web/views.py
index d48eade1..56792a16 100644
--- a/smash/web/views.py
+++ b/smash/web/views.py
@@ -302,6 +302,7 @@ def appointments(request):
 	futureDate = datetime.datetime.now()+datetime.timedelta(days=93)
 	planning_list = Appointment.objects.filter(datetime_when__isnull=True, visit__datetime_begin__lt = futureDate)
 	approaching_list = Appointment.objects.filter(datetime_when__gt = datetime.datetime.now())
+	full_list = Appointment.objects.all()
 
 
 	for plan in planning_list:
@@ -309,7 +310,8 @@ def appointments(request):
 
 	context = {
 		'planning_list': planning_list,
-		'approaching_list': approaching_list
+		'approaching_list': approaching_list,
+		'full_list': full_list
 	}
 
 	return wrap_response(request, "appointments/index.html",context)
-- 
GitLab