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

all appointments are presented in calendar view

parent bc4d3af9
No related branches found
No related tags found
1 merge request!1Appointments dev
...@@ -135,14 +135,14 @@ ...@@ -135,14 +135,14 @@
}, },
editable: false, editable: false,
events: [ events: [
{% for approach in approaching_list %} {% for appointment in full_list %}
{ {
title: '{{ approach.title }}', title: '{{ appointment.title }}',
start: '{{ approach.datetime_when | date:"c" }}', start: '{{ appointment.datetime_when | date:"c" }}',
end: '{{ approach.datetime_until | date:"c" }}', end: '{{ appointment.datetime_until | date:"c" }}',
color: '{{ approach.color }}', color: '{{ appointment.color }}',
subject_id: '{{ approach.visit.subject.id }}', subject_id: '{{ appointment.visit.subject.id }}',
id: '{{ approach.id }}' id: '{{ appointment.id }}'
}, },
{% endfor %} {% endfor %}
], ],
......
...@@ -302,6 +302,7 @@ def appointments(request): ...@@ -302,6 +302,7 @@ def appointments(request):
futureDate = datetime.datetime.now()+datetime.timedelta(days=93) futureDate = datetime.datetime.now()+datetime.timedelta(days=93)
planning_list = Appointment.objects.filter(datetime_when__isnull=True, visit__datetime_begin__lt = futureDate) 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()) approaching_list = Appointment.objects.filter(datetime_when__gt = datetime.datetime.now())
full_list = Appointment.objects.all()
for plan in planning_list: for plan in planning_list:
...@@ -309,7 +310,8 @@ def appointments(request): ...@@ -309,7 +310,8 @@ def appointments(request):
context = { context = {
'planning_list': planning_list, 'planning_list': planning_list,
'approaching_list': approaching_list 'approaching_list': approaching_list,
'full_list': full_list
} }
return wrap_response(request, "appointments/index.html",context) return wrap_response(request, "appointments/index.html",context)
......
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