1
|
{% extends "agenda/base.html" %}
|
2
|
{% load widget_tweaks %}
|
3
|
{% load url from future %}
|
4
|
{% load apptags %}
|
5
|
|
6
|
{% block extrascripts %}
|
7
|
{{ block.super }}
|
8
|
<script type="text/javascript" src="{{ STATIC_URL }}/js/calebasse.reset-button.js">
|
9
|
</script>
|
10
|
<script>
|
11
|
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
|
$(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
|
"{% url 'periodic-events' service=service date=date %}", add_datepickers);
|
25
|
});
|
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
|
"{% url 'periodic-events' service=service date=date %}", add_datepickers);
|
32
|
});
|
33
|
});
|
34
|
</script>
|
35
|
{% endblock %}
|
36
|
|
37
|
{% block appbar %}
|
38
|
<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
|
{% endblock %}
|
41
|
{% block content %}
|
42
|
<div id="sidebar">
|
43
|
<form id="periodic-events-search-form">
|
44
|
<div class="field">
|
45
|
<label for="start_date">Rendez-vous périodiques possédant une occurence dans les trois mois qui suivent le :</label>
|
46
|
{{ search_form.start_date|add_class:"datepicker-date" }}
|
47
|
</div>
|
48
|
<p>OU</p>
|
49
|
<div class="field">
|
50
|
<label for="end_date">Rendez-vous périodiques possèdant une occurence avant le :</label>
|
51
|
{{ search_form.end_date|add_class:"datepicker-date" }}
|
52
|
</div>
|
53
|
<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
|
<div class="field">
|
62
|
<label for="patient">avec le participant:</label>
|
63
|
{{ search_form.worker }}
|
64
|
</div>
|
65
|
{% 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
|
</form>
|
74
|
</div>
|
75
|
<script>
|
76
|
$('.datepicker-date').datepicker({dateFormat: 'd/m/yy', showOn: 'button'});
|
77
|
</script>
|
78
|
<div class="content">
|
79
|
{% if request.GET %}
|
80
|
<p>{{ object_list|length }} évènement(s) trouvé(s).</p>
|
81
|
{% endif %}
|
82
|
{% for event in object_list %}
|
83
|
<div id="events">
|
84
|
<div class="event frame" id="event-frame-{{ event.id }}">
|
85
|
<h3>
|
86
|
<span>{% if event.patient %}Rendez-vous patient{% else %}Évènement{% endif %}: {{ event.recurrence_description|lower }}</span>
|
87
|
—
|
88
|
<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 }} min {% endif %}
|
92
|
{% if event.workers_initial %} — {{ event.workers_initial }} {% endif %}
|
93
|
{% if event.ressource %} — {{ event.ressource }} {% endif %}
|
94
|
<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
|
<p>Avec:
|
114
|
{% for participant in event.participants.all %}
|
115
|
{{ participant }}{% if not forloop.last %}, {% endif %}
|
116
|
{% endfor %}
|
117
|
</p>
|
118
|
</div>
|
119
|
</div>
|
120
|
{% endfor %}
|
121
|
{% 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
|
</div>
|
130
|
{% endblock %}
|
131
|
|
132
|
{% block dialogs %}
|
133
|
<div id="event-dlg" style="display: none">
|
134
|
</div>
|
135
|
{% endblock %}
|