Projet

Général

Profil

Télécharger (5,11 ko) Statistiques
| Branche: | Tag: | Révision:

calebasse / calebasse / agenda / templates / agenda / agendas-therapeutes.html @ 5e2377b1

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
<button id='print-button-therapeutes'>Imprimer</button>
9
{% endblock %}
10

    
11

    
12
{% block agenda-content %}
13
<button id="uncheck-all" type="button">Tout décocher</button>
14
<button id="check-all" type="button" style="display: none">Tout cocher</button>
15

    
16
{% for worker_agenda in workers_agenda %}
17
{% if worker_agenda.appointments %}
18
<div class="worker-agenda">
19
    <h2>
20
        <strong>{{ service_name }}</strong> - Planning de {{ worker_agenda.worker.first_name }} <span class="lastname">{{ worker_agenda.worker.last_name }}</span>
21
        <input type="checkbox" class="printable" {% if worker_agenda.has_events %}checked{% endif %}>
22
    </h2>
23
    <h3>{{ date|date:"DATE_FORMAT"|title }}</h3>
24

    
25
    <!--<span class="remarque">Remarque :</span>-->
26

    
27
    <table>
28
        <thead>
29
            <tr> <th>Heure</th> <th>Durée</th> <th></th> <th>Libellé</th><th>Présence</th>
30
                <th>Absence</th>
31
                <th>Type d'acte</th> <th>Commentaire</th> <th>Intervenants</th></tr>
32
        </thead>
33
        <tbody>
34
            {% for appointment in worker_agenda.appointments %}
35
            <tr data-event-id="{{ appointment.event_id }}">
36
                <td class="col-time">{{ appointment.begin_hour }}</td>
37
                {% if not CURRENT_SERVICE_EVENTS_ONLY and not appointment.holiday and appointment.type != 'info' and appointment.other_services_names  %}
38
                <td colspan=8 class="col-record-id">
39
                  {% if appointment.event %}Evenement{% else %}Rendez-vous{% endif %}
40
                  {% with services=appointment.other_services_names|length %}
41
                  dans le{{ services|pluralize }} service{{ services|pluralize }}
42
                  {% endwith %}
43
                  {% for service in appointment.other_services_names %}
44
                  {{ service|upper }}{% if not forloop.last %}, {% endif %}
45
                  {% endfor %}
46
                </td>
47
                {% else %}
48
                <td class="col-duration">{% if appointment.length %}{{ appointment.length }}min{% endif %}</td>
49
                <td class="col-record-id">
50
                    {% if appointment.patient_record_id %}
51
                    {% if appointment.patient_record_paper_id %}
52
                    {{ appointment.patient_record_paper_id }}
53
                    {% else %}
54
                    Pas de numéro papier.
55
                    {% endif %}
56
                    {% endif %}
57
                </td>
58
                <td> {% if appointment.title %}{{ appointment.title }}{% endif %}</td>
59
                <td/>
60
                <td> {% if appointment.act_absence %}<strong>{{ appointment.act_absence }}</strong>{% endif %}</td>
61
                <td> {% if appointment.act_type %}{{ appointment.act_type }}{% endif %}</td>
62
                <td> {% if appointment.description %}{{ appointment.description }}{% endif %}</td>
63
                <td>
64
                    {% if appointment.workers and appointment.workers|length > 10 %}
65
                    {{ appointment.workers|length }} intervenants
66
                    {% else %}
67
                    {% for worker in appointment.workers %}
68
                    <span class="lastname">{{ worker.last_name }}</span> {{ worker.first_name }}<br/>
69
                    {% endfor %}
70
                    {% endif %}
71
                </td>
72
                {% endif %}
73
            </tr>
74
            {% endfor %}
75
        </tbody>
76
    </table>
77
</div> <!-- .worker-agenda -->
78

    
79
{% endif %}
80
{% endfor %}
81
    <script>
82
        $(function () {
83
            /* Control page break on last printed page */
84
            function update_page_break() {
85
                $('.pagebreak').css('page-break-after', 'always');
86
                $('.pagebreak').not('.screen-only').last().css('page-break-before', 'avoid');
87
            }
88
            update_page_break();
89

    
90
            $('button#print-button-therapeutes').click(function() {
91
              $.each($(".printable"), function(k, v) {
92
                if ($(v).is(':checked')) {
93
                    $(v).parents('.worker-agenda').removeClass('screen-only');
94
                } else {
95
                    $(v).parents('.worker-agenda').addClass('screen-only');
96
                }
97
                });
98
              update_page_break();
99
              window.print();
100
              });
101

    
102
            $('#uncheck-all').on('click', function () {
103
                $('.printable').attr('checked', false);
104
                $('.printable').trigger('change');
105
                $('#uncheck-all').hide();
106
                $('#check-all').show();
107
                update_page_break();
108
            });
109
            $('#check-all').on('click', function () {
110
                $('.printable').attr('checked', true);
111
                $('.printable').trigger('change');
112
                $('#check-all').hide();
113
                $('#uncheck-all').show();
114
                update_page_break();
115
            });
116
        });
117
    </script>
118

    
119
<button id='print-button' class='screen-only'>Imprimer</button>
120
{% endblock %}
(2-2/18)