summaryrefslogtreecommitdiffstats
path: root/calebasse/dossiers/templates/dossiers/generate_rtf_form.html
blob: fcffb18e4d3a1f6abc471793bae29c4d665821d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{% load widget_tweaks %}

{% if form.errors %}
<pre style="display: none">
errors:
{% for field in form %}
{% if field.errors %}- {{field.name}} {{ field.errors|striptags }}{% endif %}
{% endfor %}
</pre>
{% endif %}

<form action="{{ request.get_full_path }}" method="post">
  {% csrf_token %}

  Modèle : {{ form.template_filename }}

<h3>Patient</h3>

<ul>
 <li>{{ object.first_name }} <span class="lastname">{{ object.last_name }}</span></li>
 {% if object.birthdate %}
 <li>Date de naissance : {{ object.birthdate|date:"d/m/Y" }}</li>
 {% endif %}
</ul>

<h3>Adresse</h3>

{% if object.addresses_contacts_comment %}<p>Commentaire : <strong>{{ object.addresses_contacts_comment }}</strong></p>{% endif %}

<ul class="addresses">
  {% for address in object.addresses.all %}
  <li>
  <span>{{ address.display_name }} {% if address.phone %}(Tél : {{ address.phone }}){% endif %}</span>
  {% if address.comment %}<p><em>Commentaire : {{ address.comment }}</em></p>{% endif %}
  <ul>
    {% if address.recipient %}
    <li><input type="radio" name="contact" id="contact_{{ address.id }}_{{ contact.id }}"
               {% if address.recipient %}data-address-recipient="{{ address.recipient }}"{% endif %}
               {% if address.street %}data-address-street="{{ address.street }}"{% endif %}
               {% if address.number %}data-address-number="{{ address.number }}"{% endif %}
               {% if address.address_complement %}data-address-address-complement="{{ address.address_complement }}"{% endif %}
               {% if address.zip_code %}data-address-zip-code="{{ address.zip_code }}"{% endif %}
               {% if address.city %}data-address-city="{{ address.city }}"{% endif %}
               {% if address.phone %}data-address-phone="{{ address.phone }}"{% endif %}
               {% if contact.gender %}data-contact-gender={% if contact.gender == 1 %}"Monsieur"{% elif contact.gender == 2 %}"Madame"{% endif %}{% endif %}
               {% if contact.first_name %}data-contact-first-name="{{ contact.first_name }}"{% endif %}
               {% if contact.last_name %}data-contact-last-name="{{ contact.last_name }}"{% endif %}
               ><label for="contact_{{ address.id }}_{{ contact.id }}">{{ address.recipient }} (DESTINATAIRE)</label></input></li>
    {% endif %}
    {% for contact in address.patientcontact_set.all  %}
    <li><input type="radio" name="contact" id="contact_{{ address.id }}_{{ contact.id }}"
               {% if address.street %}data-address-street="{{ address.street }}"{% endif %}
               {% if address.number %}data-address-number="{{ address.number }}"{% endif %}
               {% if address.address_complement %}data-address-address-complement="{{ address.address_complement }}"{% endif %}
               {% if address.zip_code %}data-address-zip-code="{{ address.zip_code }}"{% endif %}
               {% if address.city %}data-address-city="{{ address.city }}"{% endif %}
               {% if address.phone %}data-address-phone="{{ address.phone }}"{% endif %}
               {% if contact.gender %}data-contact-gender={% if contact.gender == 1 %}"Monsieur"{% elif contact.gender == 2 %}"Madame"{% endif %}{% endif %}
               {% if contact.first_name %}data-contact-first-name="{{ contact.first_name }}"{% endif %}
               {% if contact.last_name %}data-contact-last-name="{{ contact.last_name }}"{% endif %}
       ><label for="contact_{{ address.id }}_{{ contact.id }}">{% if contact.gender == 1 %}M. {% elif contact.gender == 2 %}Mme {% endif %}{% if contact.first_name %}{{ contact.first_name }} {% endif %}<span class="lastname">{{ contact.last_name }}</span>{% if contact.mobile %} (Perso : {{ contact.mobile }}){% endif %}{% if contact.phone %} (Pro : {{ contact.phone }}){% endif %}{% if contact.id == object.id %} (PATIENT){% endif %}{% if object.policyholder.id == contact.id %} (ASSURE){% endif %}</label></input></li>
    {% endfor %}
  </ul>
  </li>
  {% endfor %}
</ul>

{{ form.address }}

<p><label>Téléphone : </label><input id="id_phone_address" type="text" name="phone_address" value=""/></p>

{% if appointment %}
<h3>Rendez-vous</h3>

<ul>
 <li>Date : {{ appointment.date }}</li>
 <li>Heure : {{ appointment.begin_hour }}</li>
 {% if appointment.workers %}
 <li>Intervenant(s) :
      {% for worker in appointment.workers %}
        {{ worker.first_name }} <span class="lastname">{{ worker.last_name }}</span>{% if forloop.last %}.{% else %}, {% endif %}
      {% endfor %}
 </li>
 {% endif %}
</ul>

{% endif %}

</form>