Projet

Général

Profil

Télécharger (6,79 ko) Statistiques
| Branche: | Tag: | Révision:

calebasse / calebasse / agenda / templates / agenda / agendas-therapeutes.html @ 63bc684f

1
{% extends "agenda/base.html" %}
2

    
3
{% block body-class %}{{ block.super }} no-left-column{% endblock %}
4

    
5
{% block appbar %}
6
<h2>Tous les agendas des intervenants du {{ service_name }} - {{ date|date:"DATE_FORMAT"|title }}</h2>
7
<a href="..">Retourner à l'agenda</a>
8
{% endblock %}
9

    
10

    
11
{% block agenda-content %}
12
<div id="activity" class="screen-only">
13
  <span class="actions screen-only"><button id='print-button-therapeutes-activity' class="icon-print screen-only">Imprimer</button></span>
14
  <br class="clear" />
15
  <span class="header"><strong>{{ service_name }}:</strong> {{ date|date:"DATE_FORMAT"|title }}</span>
16
  <h3>Liste des présences</h4>
17
<table>
18
  <thead>
19
    <tr>
20
      <th>Nom</th><th>Arrivée</th><th>Premier rendez-vous</th>
21
      <th>Dernier rendez-vous</th><th>Départ</th><th>Absences</th>
22
    </tr>
23
  </thead>
24
  <tbody>
25
{% for worker_agenda in workers_agenda %}
26
<tr>
27
  <td>{{ worker_agenda.worker.first_name}} <span class="lastname">{{ worker_agenda.worker.last_name }}</span></td>
28
  <td>{{ worker_agenda.activity.arrival }}</td><td>{{ worker_agenda.activity.first_appointment }}</td>
29
  <td>{{ worker_agenda.activity.last_appointment }}</td><td>{{ worker_agenda.activity.departure }}</td>
30
  <td>{% for absence in worker_agenda.activity.absences %}
31
    {{ absence }}<br />
32
    {% endfor %}
33
  </td>
34
</tr>
35
{% endfor %}
36
  </tbody>
37
</table>
38
</div>
39
<br class="clear" />
40
<span class="actions screen-only">
41
  <button id="uncheck-all" type="button" class="icon-uncheck screen-only">Tout décocher</button>
42
  <button id="check-all" type="button" style="display: none" class="icon-check screen-only">Tout cocher</button>
43
  <button class="print-button-therapeutes icon-print screen-only">Imprimer</button>
44
</span>
45
{% for worker_agenda in workers_agenda %}
46
{% if worker_agenda.appointments %}
47
<div class="worker-agenda">
48
    <h2>
49
        <strong>{{ service_name }}</strong> - Planning de {{ worker_agenda.worker.first_name }} <span class="lastname">{{ worker_agenda.worker.last_name }}</span>
50
        <input type="checkbox" class="printable" {% if worker_agenda.has_events %}checked{% endif %}>
51
    </h2>
52
    <h3>{{ date|date:"DATE_FORMAT"|title }}</h3>
53

    
54
    <!--<span class="remarque">Remarque :</span>-->
55

    
56
    <table>
57
        <thead>
58
            <tr> <th>Heure</th> <th>Durée</th> <th></th> <th>Libellé</th><th>Présence</th>
59
                <th>Absence</th>
60
                <th>Type d'acte</th> <th>Commentaire</th> <th>Intervenants</th></tr>
61
        </thead>
62
        <tbody>
63
            {% for appointment in worker_agenda.appointments %}
64
            <tr data-event-id="{{ appointment.event_id }}">
65
                <td class="col-time">
66
                  {{ appointment.begin_hour }}
67
                </td>
68
                {% if not CURRENT_SERVICE_EVENTS_ONLY and not appointment.holiday and appointment.type != 'info' and appointment.services_names and service not in appointment.services_names %}
69
                <td colspan=8 class="col-record-id">
70
                  {% if appointment.event %}Evenement{% else %}Rendez-vous{% endif %}
71
                  {% with services=appointment.other_services_names|length %}
72
                  dans le{{ services|pluralize }} service{{ services|pluralize }}
73
                  {% endwith %}
74
                  {% for service in appointment.other_services_names %}
75
                  {{ service|upper }}{% if not forloop.last %}, {% endif %}
76
                  {% endfor %}
77
                </td>
78
                {% else %}
79
                <td class="col-duration">{% if appointment.length %}{{ appointment.length }}min{% endif %}</td>
80
                <td class="col-record-id">
81
                    {% if appointment.patient_record_id %}
82
                    {% if appointment.patient_record_paper_id %}
83
                    {{ appointment.patient_record_paper_id }}
84
                    {% else %}
85
                    Pas de numéro papier.
86
                    {% endif %}
87
                    {% endif %}
88
                </td>
89
                <td> {% if appointment.title %}{{ appointment.title }}{% endif %}</td>
90
                <td/>
91
                <td> {% if appointment.act_absence %}<strong>{{ appointment.act_absence }}</strong>{% endif %}</td>
92
                <td> {% if appointment.act_type %}{{ appointment.act_type }}{% endif %}</td>
93
                <td> {% if appointment.description %}{{ appointment.description }}{% endif %}</td>
94
                <td>
95
                    {% if appointment.workers and appointment.workers|length > 10 %}
96
                    {{ appointment.workers|length }} intervenants
97
                    {% else %}
98
                    {% for worker in appointment.workers %}
99
                    <span class="lastname">{{ worker.last_name }}</span> {{ worker.first_name }}<br/>
100
                    {% endfor %}
101
                    {% endif %}
102
                </td>
103
                {% endif %}
104
            </tr>
105
            {% endfor %}
106
        </tbody>
107
    </table>
108
</div> <!-- .worker-agenda -->
109

    
110
{% endif %}
111
{% endfor %}
112
    <script>
113
        $(function () {
114
            /* Control page break on last printed page */
115
            function update_page_break() {
116
                $('.pagebreak').css('page-break-after', 'always');
117
                $('.pagebreak').not('.screen-only').last().css('page-break-before', 'avoid');
118
            }
119
            update_page_break();
120

    
121
            $('button.print-button-therapeutes').click(function() {
122
              $('div#activity').addClass('screen-only');
123
              $.each($(".printable"), function(k, v) {
124
                if ($(v).is(':checked')) {
125
                    $(v).parents('.worker-agenda').removeClass('screen-only');
126
                } else {
127
                    $(v).parents('.worker-agenda').addClass('screen-only');
128
                }
129
                });
130
              update_page_break();
131
              window.print();
132
              });
133

    
134
            $('button#print-button-therapeutes-activity').click(function() {
135
                $('div#activity').removeClass('screen-only');
136
                $.each($('.content div:not(#activity)'), function(k, v) {
137
                  $(v).addClass('screen-only');
138
                });
139
              update_page_break();
140
              window.print();
141
              });
142

    
143
            $('#uncheck-all').on('click', function () {
144
                $('.printable').attr('checked', false);
145
                $('.printable').trigger('change');
146
                $('#uncheck-all').hide();
147
                $('#check-all').show();
148
                update_page_break();
149
            });
150
            $('#check-all').on('click', function () {
151
                $('.printable').attr('checked', true);
152
                $('.printable').trigger('change');
153
                $('#check-all').hide();
154
                $('#uncheck-all').show();
155
                update_page_break();
156
            });
157
        });
158
    </script>
159

    
160
    <button class="print-button-therapeutes icon-print screen-only">Imprimer</button>
161
{% endblock %}
(2-2/18)