Projet

Général

Profil

Télécharger (4,27 ko) Statistiques
| Branche: | Tag: | Révision:

calebasse / calebasse / agenda / templates / agenda / agendas-therapeutes.html @ 1f163e44

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'>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
                <td class="col-duration">{% if appointment.length %}{{ appointment.length }}min{% endif %}</td>
38
                <td class="col-record-id">
39
                    {% if appointment.patient_record_id %}
40
                    {% if appointment.patient_record_paper_id %}
41
                    {{ appointment.patient_record_paper_id }}
42
                    {% else %}
43
                    Pas de numéro papier.
44
                    {% endif %}
45
                    {% endif %}
46
                </td>
47
                <td> {% if appointment.title %}{{ appointment.title }}{% endif %}</td>
48
                <td/>
49
                <td> {% if appointment.act_absence %}<strong>{{ appointment.act_absence }}</strong>{% endif %}</td>
50
                <td> {% if appointment.act_type %}{{ appointment.act_type }}{% endif %}</td>
51
                <td> {% if appointment.description %}{{ appointment.description }}{% endif %}</td>
52
                <td>
53
                    {% if appointment.workers and appointment.workers|length > 10 %}
54
                    {{ appointment.workers|length }} intervenants
55
                    {% else %}
56
                    {% for worker in appointment.workers %}
57
                    <span class="lastname">{{ worker.last_name }}</span> {{ worker.first_name }}<br/>
58
                    {% endfor %}
59
                    {% endif %}
60
                </td>
61
            </tr>
62
            {% endfor %}
63
        </tbody>
64
    </table>
65
</div> <!-- .worker-agenda -->
66

    
67
{% endif %}
68
{% endfor %}
69
    <script>
70
        $(function () {
71
            /* Control page break on last printed page */
72
            function update_page_break() {
73
                $('.pagebreak').css('page-break-after', 'always');
74
                $('.pagebreak').not('.screen-only').last().css('page-break-before', 'avoid');
75
            }
76
            update_page_break();
77
            $('.printable').on('change', function () {
78
                if ($(this).is(':checked')) {
79
                    $(this).parents('.worker-agenda').removeClass('screen-only');
80
                    } else {
81
                    $(this).parents('.worker-agenda').addClass('screen-only');
82
                }
83
                update_page_break();
84
            });
85
            $('#uncheck-all').on('click', function () {
86
                $('.printable').attr('checked', false);
87
                $('.printable').trigger('change');
88
                $('#uncheck-all').hide();
89
                $('#check-all').show();
90
                update_page_break();
91
            });
92
            $('#check-all').on('click', function () {
93
                $('.printable').attr('checked', true);
94
                $('.printable').trigger('change');
95
                $('#check-all').hide();
96
                $('#uncheck-all').show();
97
                update_page_break();
98
            });
99
        });
100
    </script>
101

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