1 |
e46a1c3f
|
Benjamin Dauvergne
|
{% extends "agenda/base.html" %}
|
2 |
|
|
{% load widget_tweaks %}
|
3 |
|
|
{% load url from future %}
|
4 |
|
|
{% load apptags %}
|
5 |
|
|
|
6 |
37674910
|
Benjamin Dauvergne
|
{% block extrascripts %}
|
7 |
|
|
{{ block.super }}
|
8 |
e3ca6d54
|
Benjamin Dauvergne
|
<script type="text/javascript" src="{{ STATIC_URL }}/js/calebasse.reset-button.js">
|
9 |
|
|
</script>
|
10 |
37674910
|
Benjamin Dauvergne
|
<script>
|
11 |
1ea930b0
|
Mikaël Ates
|
function add_datepickers(that) {
|
12 |
|
|
$('input#id_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
13 |
|
|
$('input#id_recurrence_end_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
|
14 |
|
|
}
|
15 |
37674910
|
Benjamin Dauvergne
|
$(function () {
|
16 |
|
|
var update_periodic_event_url = "{% url 'update-periodic-event' service=service date=date pk=0 %}";
|
17 |
|
|
var update_periodic_appointment_url = "{% url 'update-periodic-rdv' service=service date=date pk=0 %}";
|
18 |
|
|
|
19 |
|
|
$('button.edit-periodic-appointment').on('click', function () {
|
20 |
|
|
var id = $(this).data('event-id');
|
21 |
|
|
var title = $(this).data('title');
|
22 |
|
|
generic_ajaxform_dialog(update_periodic_appointment_url + id,
|
23 |
|
|
title, '#event-dlg', 950, 'Modifier',
|
24 |
1ea930b0
|
Mikaël Ates
|
"{% url 'periodic-events' service=service date=date %}", add_datepickers);
|
25 |
37674910
|
Benjamin Dauvergne
|
});
|
26 |
|
|
$('button.edit-periodic-event').on('click', function () {
|
27 |
|
|
var id = $(this).data('event-id');
|
28 |
|
|
var title = $(this).data('title');
|
29 |
|
|
generic_ajaxform_dialog(update_periodic_event_url + id,
|
30 |
|
|
title, '#event-dlg', 950, 'Modifier',
|
31 |
1ea930b0
|
Mikaël Ates
|
"{% url 'periodic-events' service=service date=date %}", add_datepickers);
|
32 |
37674910
|
Benjamin Dauvergne
|
});
|
33 |
|
|
});
|
34 |
|
|
</script>
|
35 |
|
|
{% endblock %}
|
36 |
|
|
|
37 |
e46a1c3f
|
Benjamin Dauvergne
|
{% block appbar %}
|
38 |
37674910
|
Benjamin Dauvergne
|
<h2>Rendez-vous périodiques{% if worker %} de {{ worker }}{% endif %}</h2>
|
39 |
|
|
<a href="{% url 'agenda' service=service date=date %}">Retourner à l'agenda</a>
|
40 |
e46a1c3f
|
Benjamin Dauvergne
|
{% endblock %}
|
41 |
|
|
{% block content %}
|
42 |
|
|
<div id="sidebar">
|
43 |
|
|
<form id="periodic-events-search-form">
|
44 |
37674910
|
Benjamin Dauvergne
|
<div class="field">
|
45 |
cd5d3611
|
Benjamin Dauvergne
|
<label for="start_date">Rendez-vous périodiques possédant une occurence dans les trois mois qui suivent le :</label>
|
46 |
e46a1c3f
|
Benjamin Dauvergne
|
{{ search_form.start_date|add_class:"datepicker-date" }}
|
47 |
|
|
</div>
|
48 |
cd5d3611
|
Benjamin Dauvergne
|
<p>OU</p>
|
49 |
37674910
|
Benjamin Dauvergne
|
<div class="field">
|
50 |
cd5d3611
|
Benjamin Dauvergne
|
<label for="end_date">Rendez-vous périodiques possèdant une occurence avant le :</label>
|
51 |
e46a1c3f
|
Benjamin Dauvergne
|
{{ search_form.end_date|add_class:"datepicker-date" }}
|
52 |
|
|
</div>
|
53 |
37674910
|
Benjamin Dauvergne
|
<div class="field">
|
54 |
|
|
{{ search_form.event_type }}
|
55 |
|
|
<label for="no_end_date">{{ search_form.no_end_date }} Sans date de fin</label>
|
56 |
|
|
</div>
|
57 |
|
|
<div class="field">
|
58 |
|
|
<label for="patient">avec le patient:</label>
|
59 |
|
|
{{ search_form.patient }}
|
60 |
|
|
</div>
|
61 |
6afd600b
|
Benjamin Dauvergne
|
<div class="field">
|
62 |
|
|
<label for="patient">avec le participant:</label>
|
63 |
|
|
{{ search_form.worker }}
|
64 |
|
|
</div>
|
65 |
e3ca6d54
|
Benjamin Dauvergne
|
{% if request.GET %}
|
66 |
|
|
<div class="search-reset">
|
67 |
|
|
<button id="search">Rechercher</button>
|
68 |
|
|
<button id="reset" class="icon-remove-sign" title="Réinitialiser"></button>
|
69 |
|
|
</div>
|
70 |
|
|
{% else %}
|
71 |
|
|
<button id="search">Rechercher</button>
|
72 |
|
|
{% endif %}
|
73 |
e46a1c3f
|
Benjamin Dauvergne
|
</form>
|
74 |
|
|
</div>
|
75 |
|
|
<script>
|
76 |
|
|
$('.datepicker-date').datepicker({dateFormat: 'd/m/yy', showOn: 'button'});
|
77 |
|
|
</script>
|
78 |
|
|
<div class="content">
|
79 |
ee2be5e8
|
Benjamin Dauvergne
|
{% if request.GET %}
|
80 |
|
|
<p>{{ object_list|length }} évènement(s) trouvé(s).</p>
|
81 |
|
|
{% endif %}
|
82 |
e46a1c3f
|
Benjamin Dauvergne
|
{% for event in object_list %}
|
83 |
37674910
|
Benjamin Dauvergne
|
<div id="events">
|
84 |
|
|
<div class="event frame" id="event-frame-{{ event.id }}">
|
85 |
|
|
<h3>
|
86 |
92d6fb7e
|
Benjamin Dauvergne
|
<span>{% if event.patient %}Rendez-vous patient{% else %}Évènement{% endif %}: {{ event.recurrence_description|lower }}</span>
|
87 |
1ea930b0
|
Mikaël Ates
|
—
|
88 |
37674910
|
Benjamin Dauvergne
|
<span class="hour">{{ event.start_datetime.time }}</span>
|
89 |
|
|
{% if event.title %} — {{ event.title }} {% endif %}
|
90 |
|
|
{% if event.patient.paper_id %} — {{ event.patient.paper_id }} {% endif %}
|
91 |
|
|
{% if event.length %} — {{ event.length }} mn {% endif %}
|
92 |
|
|
{% if event.workers_initial %} — {{ event.workers_initial }} {% endif %}
|
93 |
dd986559
|
Serghei MIHAI
|
{% if event.ressource %} — {{ event.ressource }} {% endif %}
|
94 |
37674910
|
Benjamin Dauvergne
|
<span class="right">
|
95 |
|
|
{% for other_service in event.services.all %}
|
96 |
|
|
{% if other_service.name != service_name %}
|
97 |
|
|
<span class="box {{ other_service.slug }}" title="{{ other_service.name }}"></span>
|
98 |
|
|
{% endif %}
|
99 |
|
|
{% endfor %}
|
100 |
|
|
{% if event.description %}
|
101 |
|
|
<span title="Un commentaire existe" class="icon-comment"></span>
|
102 |
|
|
{% endif %}
|
103 |
|
|
{% if event.event_type_id == 1 %}
|
104 |
|
|
<button title="Éditer un rendez-vous" class="edit-periodic-appointment icon-edit" data-event-id="{{ event.id }}"></button>
|
105 |
|
|
{% else %}
|
106 |
|
|
<button title="Éditer un événement" class="edit-periodic-event icon-edit" data-event-id="{{ event.id }}">
|
107 |
|
|
{% endif %}
|
108 |
|
|
</span>
|
109 |
|
|
</h3>
|
110 |
|
|
{% if event.act_type %}
|
111 |
|
|
<p>Type: {{ event.act_type }}</p>
|
112 |
|
|
{% endif %}
|
113 |
1ea930b0
|
Mikaël Ates
|
<p>Avec:
|
114 |
37674910
|
Benjamin Dauvergne
|
{% for participant in event.participants.all %}
|
115 |
|
|
{{ participant }}{% if not forloop.last %}, {% endif %}
|
116 |
|
|
{% endfor %}
|
117 |
|
|
</p>
|
118 |
|
|
</div>
|
119 |
|
|
</div>
|
120 |
e46a1c3f
|
Benjamin Dauvergne
|
{% endfor %}
|
121 |
ee2be5e8
|
Benjamin Dauvergne
|
{% if not request.GET %}
|
122 |
|
|
<div class="big-msg-info">
|
123 |
|
|
Utilisez le formulaire de recherche sur la gauche de l'écran pour afficher
|
124 |
|
|
les rendez-vous périodiques correspondants.
|
125 |
|
|
</div>
|
126 |
|
|
{% elif not object_list %}
|
127 |
|
|
<div>Pas de résultat pour votre recherche</div>
|
128 |
|
|
{% endif %}
|
129 |
e46a1c3f
|
Benjamin Dauvergne
|
</div>
|
130 |
|
|
{% endblock %}
|
131 |
37674910
|
Benjamin Dauvergne
|
|
132 |
|
|
{% block dialogs %}
|
133 |
|
|
<div id="event-dlg" style="display: none">
|
134 |
|
|
</div>
|
135 |
|
|
{% endblock %}
|