1
|
{% load widget_tweaks %}
|
2
|
|
3
|
{% if form.errors %}
|
4
|
<pre style="display: none">
|
5
|
errors:
|
6
|
{% for field in form %}
|
7
|
{% if field.errors %}- {{field.name}} {{ field.errors|striptags }}{% endif %}
|
8
|
{% endfor %}
|
9
|
</pre>
|
10
|
{% endif %}
|
11
|
|
12
|
<form action="{{ request.get_full_path }}" method="post">
|
13
|
{% csrf_token %}
|
14
|
|
15
|
Modèle : {{ form.template_filename }}
|
16
|
|
17
|
<h3>Patient</h3>
|
18
|
|
19
|
<input type="hidden" name="first_name" value="{{ object.first_name }}" />
|
20
|
<input type="hidden" name="last_name" value="{{ object.last_name }}" />
|
21
|
<input type="hidden" name="birthdate" value="{{ object.birthdate|date:"d/m/Y" }}" />
|
22
|
|
23
|
<ul>
|
24
|
<li>{{ object.first_name }} <span class="lastname">{{ object.last_name }}</span></li>
|
25
|
{% if object.birthdate %}
|
26
|
<li>Date de naissance : {{ object.birthdate|date:"d/m/Y" }}</li>
|
27
|
{% endif %}
|
28
|
</ul>
|
29
|
|
30
|
<h3>Adresse</h3>
|
31
|
|
32
|
<ul class="addresses">
|
33
|
{% for address in object.addresses.all %}
|
34
|
{% if address.place_of_life %}<li>{{ address.display_name }}
|
35
|
<ul>
|
36
|
{% for contact in address.patientcontact_set.all %}
|
37
|
<li><input type="radio" name="contact" id="contact_{{ address.id }}_{{ contact.id }}"
|
38
|
data-address-street="{{ address.street }}"
|
39
|
data-address-number="{{ address.number }}"
|
40
|
data-address-zip-code="{{ address.zip_code }}"
|
41
|
data-address-city="{{ address.city }}"
|
42
|
data-contact-first-name="{{ contact.first_name }}"
|
43
|
data-contact-last-name="{{ contact.last_name }}"
|
44
|
><label for="contact_{{ address.id }}_{{ contact.id }}">{{ contact.first_name }} <span class="lastname">{{ contact.last_name }}</span> {% if contact.id == object.id %} (PATIENT){% endif %}</label></input></li>
|
45
|
{% endfor %}
|
46
|
</ul>
|
47
|
</li>{% endif %}
|
48
|
{% endfor %}
|
49
|
</ul>
|
50
|
|
51
|
{{ form.address }}
|
52
|
|
53
|
{% if appointment %}
|
54
|
<h3>Rendez-vous</h3>
|
55
|
|
56
|
<input type="hidden" name="appointment_date" value="{{ appointment.date }}" />
|
57
|
<input type="hidden" name="appointment_begin_hour" value="{{ appointment.begin_hour }}" />
|
58
|
<input type="hidden" name="appointment_intervenants" value="{% for worker in appointment.workers %}{{ worker.first_name }} {{ worker.last_name }}{% if forloop.last %}{% else %}, {% endif %}{% endfor %}" />
|
59
|
|
60
|
<ul>
|
61
|
<li>Date : {{ appointment.date }}</li>
|
62
|
<li>Heure : {{ appointment.begin_hour }}</li>
|
63
|
{% if appointment.workers %}
|
64
|
<li>Intervenant(s) :
|
65
|
{% for worker in appointment.workers %}
|
66
|
{{ worker.first_name }} <span class="lastname">{{ worker.last_name }}</span>{% if forloop.last %}.{% else %}, {% endif %}
|
67
|
{% endfor %}
|
68
|
</li>
|
69
|
{% endif %}
|
70
|
</ul>
|
71
|
|
72
|
{% endif %}
|
73
|
|
74
|
</form>
|