8 |
8 |
<button id='print-button'>Imprimer</button>
|
9 |
9 |
{% endblock %}
|
10 |
10 |
|
|
11 |
|
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 |
|
12 |
16 |
{% for worker_agenda in workers_agenda %}
|
13 |
17 |
{% if worker_agenda.appointments %}
|
14 |
18 |
<div class="worker-agenda">
|
15 |
|
<h2>{{service_name }} - Planning de {{ worker_agenda.worker.first_name }} <span class="lastname">{{ worker_agenda.worker.last_name }}</span></h2>
|
|
19 |
<h2>
|
|
20 |
{{service_name }} - Planning de {{ worker_agenda.worker.first_name }} <span class="lastname">{{ worker_agenda.worker.last_name }}</span>
|
|
21 |
<input type="checkbox" class="printable" checked>
|
|
22 |
</h2>
|
16 |
23 |
<h3>{{ date|date:"DATE_FORMAT" }}</h3>
|
17 |
24 |
|
18 |
25 |
<span class="remarque">Remarque :</span>
|
... | ... | |
58 |
65 |
|
59 |
66 |
{% endif %}
|
60 |
67 |
{% endfor %}
|
61 |
|
|
|
68 |
<script>
|
|
69 |
$(function () {
|
|
70 |
/* Control page break on last printed page */
|
|
71 |
function update_page_break() {
|
|
72 |
$('.worker-agenda').css('page-break-after', 'always');
|
|
73 |
$('.worker-agenda').not('.screen-only').last().css('page-break-after', 'avoid');
|
|
74 |
}
|
|
75 |
update_page_break();
|
|
76 |
$('.printable').on('change', function () {
|
|
77 |
if ($(this).is(':checked')) {
|
|
78 |
$(this).parents('.worker-agenda').removeClass('screen-only');
|
|
79 |
} else {
|
|
80 |
$(this).parents('.worker-agenda').addClass('screen-only');
|
|
81 |
}
|
|
82 |
update_page_break();
|
|
83 |
});
|
|
84 |
$('#uncheck-all').on('click', function () {
|
|
85 |
$('.printable').attr('checked', false);
|
|
86 |
$('.printable').trigger('change');
|
|
87 |
$('#uncheck-all').hide();
|
|
88 |
$('#check-all').show();
|
|
89 |
update_page_break();
|
|
90 |
});
|
|
91 |
$('#check-all').on('click', function () {
|
|
92 |
$('.printable').attr('checked', true);
|
|
93 |
$('.printable').trigger('change');
|
|
94 |
$('#check-all').hide();
|
|
95 |
$('#uncheck-all').show();
|
|
96 |
update_page_break();
|
|
97 |
});
|
|
98 |
});
|
|
99 |
</script>
|
62 |
100 |
{% endblock %}
|
agenda: allow to print only certain agendas (fixes #2306)
also fixes extra page break after the last printed agenda