Projet

Général

Profil

« Précédent | Suivant » 

Révision 97fbc132

Ajouté par Mikaël Ates il y a plus de 9 ans

dossiers: add state date on quotation page and a bit of refactoring (fixes #5977).

Voir les différences:

calebasse/dossiers/templates/dossiers/quotations.html
48 48
</div>
49 49
<div class="content">
50 50
  <table id="dossiers" class="main screen-only">
51
    <thead>
52
      <tr>
53
        <th colspan="2">N° dossier
54
        </th><th rowspan="2">Nom</th>
55
        <th rowspan="2">Prénom</th>
56
        <th rowspan="2">Date de naissance</th>
57
        <th rowspan="2">État du dossier</th>
58
        <th rowspan="2">Date du prochain rendez-vou</th>
59
        <th rowspan="2">Date du dernier rendez-vous</th>
60
        <th rowspan="2">Mises</th>
61
        <th rowspan="2">ANAP</th>
62
      </tr>
63
      <tr>
64
        <th>papier</th>
65
        <th>inform.</th>
66
      </tr>
67
    </thead>
68
    <tbody>
69

  
70
      {% for patient_record in patient_records %}
71
      <tr style="display: table-row;" class="pr-line {{ patient_record.state_class }}" data-link="{{ patient_record.object.id }}/view">
72
        <td>{{ patient_record.object.paper_id|default_if_none:"" }}</td>
73
        <td>{{ patient_record.object.id }}</td>
74
        <td><span class="lastname">{{ patient_record.object.last_name }}</span></td>
75
        <td>{{ patient_record.object.first_name }}</td>
76
        <td>{{ patient_record.object.birthdate|date:"d-m-Y" }}</td>
77
        <td class="{{ patient_record.state_class }}">{{ patient_record.state }}</td>
78
        <td>{% if patient_record.next_rdv_date %}
79
          {{ patient_record.next_rdv_date|date:"d-m-Y, H:i" }}
80
          {% endif %}
81
        </td>
82
        <td>{% if patient_record.last_rdv_date %}
83
          {{ patient_record.last_rdv_date|date:"d-m-Y, H:i" }}
84
          {% endif %}</td>
85
        <td>{% if patient_record.mises %}<span class="icon-ok"></span>{% endif %}</td>
86
        <td>{% if patient_record.anap %}<span class="icon-ok"></span>{% endif %}</td>
87
      </tr>
88
      {% endfor %}
89

  
90
    </tbody>
51
    {% include "dossiers/quotations_patients_table_content.html" %}
91 52
  </table>
92 53

  
93 54
  {% if request.GET %}
calebasse/dossiers/templates/dossiers/quotations_patients_table_content.html
1
<thead>
2
  <tr>
3
    <th colspan="2">N° dossier
4
    </th><th rowspan="2">Nom</th>
5
    <th rowspan="2">Prénom</th>
6
    <th rowspan="2">Date de naissance</th>
7
    <th rowspan="2">État du dossier</th>
8
    <th rowspan="2">Date du prochain rendez-vou</th>
9
    <th rowspan="2">Date du dernier rendez-vous</th>
10
    <th rowspan="2">Mises</th>
11
    <th rowspan="2">ANAP</th>
12
  </tr>
13
  <tr>
14
    <th>papier</th>
15
    <th>inform.</th>
16
  </tr>
17
</thead>
18
<tbody>
19
  {% for patient_record in patient_records %}
20
  <tr style="display: table-row;" class="pr-line {{ patient_record.state.status.type|lower }}" data-link="{{ patient_record.object.id }}/view">
21
    <td>{{ patient_record.object.paper_id|default_if_none:"" }}</td>
22
    <td>{{ patient_record.object.id }}</td>
23
    <td><span class="lastname">{{ patient_record.object.last_name }}</span></td>
24
    <td>{{ patient_record.object.first_name }}</td>
25
    <td>{{ patient_record.object.birthdate|date:"d-m-Y" }}</td>
26
    <td class="{{ patient_record.state.status.type|lower }}">{{ patient_record.state.status.name }} le {{ patient_record.state.date_selected|date:"d-m-Y" }}</td>
27
    <td>{% if patient_record.next_rdv_date %}
28
      {{ patient_record.next_rdv_date|date:"d-m-Y, H:i" }}
29
      {% endif %}
30
    </td>
31
    <td>{% if patient_record.last_rdv_date %}
32
      {{ patient_record.last_rdv_date|date:"d-m-Y, H:i" }}
33
      {% endif %}</td>
34
    <td>{% if patient_record.mises %}<span class="icon-ok"></span>{% endif %}</td>
35
    <td>{% if patient_record.anap %}<span class="icon-ok"></span>{% endif %}</td>
36
  </tr>
37
  {% endfor %}
38
</tbody>
calebasse/dossiers/templates/dossiers/quotations_print.html
1 1
<table class="main print-only">
2
  <thead>
3
    <tr>
4
      <th colspan="2">N° dossier
5
      </th><th rowspan="2">Nom</th>
6
      <th rowspan="2">Prénom</th>
7
      <th rowspan="2">Date de naissance</th>
8
      <th rowspan="2">État du dossier</th>
9
      <th rowspan="2">Date du prochain rendez-vou</th>
10
      <th rowspan="2">Date du dernier rendez-vous</th>
11
      <th rowspan="2">Mises</th>
12
      <th rowspan="2">ANAP</th>
13
    </tr>
14
    <tr>
15
      <th>papier</th>
16
      <th>inform.</th>
17
    </tr>
18
  </thead>
19
  <tbody>
20
    {% for patient_record in patient_records %}
21
    <tr style="display: table-row;" class="pr-line {{ patient_record.state_class }}">
22
      <td>{{ patient_record.object.paper_id|default_if_none:"" }}</td>
23
      <td>{{ patient_record.object.id }}</td>
24
      <td><span class="lastname">{{ patient_record.object.last_name }}</span></td>
25
      <td>{{ patient_record.object.first_name }}</td>
26
      <td>{{ patient_record.object.birthdate|date:"d-m-Y" }}</td>
27
      <td class="{{ patient_record.state_class }}">{{ patient_record.state }}</td>
28
      <td>{% if patient_record.next_rdv_date %}
29
        {{ patient_record.next_rdv_date|date:"d-m-Y, H:i" }}
30
        {% endif %}
31
      </td>
32
      <td>{% if patient_record.last_rdv_date %}
33
        {{ patient_record.last_rdv_date|date:"d-m-Y, H:i" }}
34
        {% endif %}</td>
35
      <td>{% if patient_record.mises %}<span class="icon-ok"></span>{% endif %}</td>
36
      <td>{% if patient_record.anap %}<span class="icon-ok"></span>{% endif %}</td>
37
    </tr>
38
    {% endfor %}
39
  </tbody>
2
  {% include "dossiers/quotations_patients_table_content.html" %}
40 3
</table>
calebasse/dossiers/views.py
863 863
        patient_records = []
864 864
        for patient_record in paginate_patient_records:
865 865
            current_state = patient_record.get_current_state() or patient_record.get_state()
866
            state = current_state.status.name
867
            state_class = current_state.status.type.lower()
868 866
            deficiencies = [getattr(patient_record, field) \
869 867
                            for field in self.model.DEFICIENCY_FIELDS]
870 868
            anap = any(deficiencies)
......
883 881
            patient_records.append(
884 882
                    {
885 883
                        'object': patient_record,
886
                        'state': state,
887
                        'state_class': state_class,
884
                        'state': current_state,
888 885
                        'anap': anap,
889 886
                        'mises': mises,
890 887
                        'next_rdv_date': next_rdv_datetime,

Formats disponibles : Unified diff