blob: a62e907ffe347921991b75c14aff08eb8e6c5f44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
|
{% extends 'registration/base_client.html' %}
{% block title %}Home{% endblock %}
{% block content %}
<div class="tap-target {{color}}" data-target="add">
<div class="tap-target-content">
<h5 style="color:white">Aggiungi un documento</h5>
<p style="color:white">Usa questo bottone per creare un nuovo documento</p>
</div>
</div>
<form id="form" method="post" action="{% url 'index'%}">
{% csrf_token %}
<input type="hidden" name="action" id="action">
</form>
{% if user.is_authenticated %}
{% if user.is_staff or perms.client.approved %}
{% if not empty %}
<ul class="collapsible">
{% for doc in docs %}
<li>
<div class="collapsible-header">
{% if doc.0.status == "wait" %}
<i class="material-icons">timelapse</i>
{% elif doc.0.status == "ok" %}
<i class="material-icons">check</i>
{% elif doc.0.status == "autosign" %}
<i class="material-icons">assignment_turned_in</i>
{% endif %}
{{doc.0.document_type.name}}
<span class="badge" data-badge-caption="">{{doc.0.compilation_date}}</span>
</div>
<div class="collapsible-body"><span>
{% if doc.0.status == "wait" %}
<div class="hide-on-med-and-down">
<a class="waves-effect waves-light btn {{color}}" onclick="send('f{{doc.0.id}}')"><i class="material-icons left">file_download</i> Scarica documento per approvazione</a>
<a class="waves-effect waves-light btn {{color}}" onclick="send('d{{doc.0.id}}')"><i class="material-icons left">delete</i> Elimina documento</a>
<a class="waves-effect waves-light btn {{color}}" onclick="send('e{{doc.0.id}}')"><i class="material-icons left">edit</i> Modifica documento</a>
</div>
<div style="margin-bottom: 0px;" class="hide-on-large-only row">
<a class="col s12 waves-effect waves-light btn {{color}}" onclick="send('f{{doc.0.id}}')"><i class="material-icons left">file_download</i> Scarica documento per approvazione</a>
<br>
<br>
<a class="col s12 waves-effect waves-light btn {{color}}" onclick="send('d{{doc.0.id}}')"><i class="material-icons left">delete</i> Elimina documento</a>
<br>
<br>
<a class="col s12 waves-effect waves-light btn {{color}}" onclick="send('e{{doc.0.id}}')"><i class="material-icons left">edit</i> Modifica documento</a>
</div>
<br>
<br>
{% elif doc.0.status == "autosign" %}
<div id="modal{{doc.0.id}}" class="modal">
<div class="modal-content">
<h4>Attenzione</h4>
<p>Una volta approvato il documento non potrà più essere modificato.<br>
Sei sicuro di volerlo approvare?
</p>
</div>
<div class="modal-footer">
<a style="color:red" href="#!" class="modal-close waves-effect waves-green btn-flat">Annulla</a>
<a onclick="send('a{{doc.0.id}}')" class="modal-close waves-effect waves-green btn-flat">Approva</a>
</div>
</div>
<div class="hide-on-med-and-down">
<a class="waves-effect waves-light btn {{color}} modal-trigger" href="#modal{{doc.0.id}}"><i class="material-icons left">check</i>Approva documento</a>
<a class="waves-effect waves-light btn {{color}}" onclick="send('d{{doc.0.id}}')"><i class="material-icons left">delete</i>Elimina documento</a>
<a class="waves-effect waves-light btn {{color}}" onclick="send('e{{doc.0.id}}')"><i class="material-icons left">edit</i>Modifica documento</a>
</div>
<div style="margin-bottom: 0px;" class="hide-on-large-only row">
<a class="col s12 waves-effect waves-light btn {{color}} modal-trigger" href="#modal{{doc.0.id}}"><i class="material-icons left">check</i>Approva documento</a>
<br>
<br>
<a class="col s12 waves-effect waves-light btn {{color}}" onclick="send('d{{doc.0.id}}')"><i class="material-icons left">delete</i>Elimina documento</a>
<br>
<br>
<a class="col s12 waves-effect waves-light btn {{color}}" onclick="send('e{{doc.0.id}}')"><i class="material-icons left">edit</i>Modifica documento</a>
</div>
<br>
<br>
{% endif %}
<ul class="collection">
<li class="collection-item">
<i class="material-icons left">confirmation_number</i>{{doc.0.code}}
</li>
</ul>
<ul class="collapsible">
{% if doc.0.document_type.personal_data %}
<li>
<div class="collapsible-header">
<i class="material-icons">person</i>Dati personali
</div>
<div class="collapsible-body"><span>
<div class="row">
<div class="input-field col l4 s12">
<input disabled value="{{doc.0.user.first_name}}" id="first_name" type="text" >
<label for="first_name">Nome</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.0.user.last_name}}" id="last_name" type="text" >
<label for="last_name">Cognome</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.2.born_date}}" id="birth_date" type="text">
<label for="birth_date">Data di nascita</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.4}}" id="branca" type="text">
<label for="branca">Branca</label>
</div>
<div class="input-field col l8 s12">
<input disabled value="{{doc.2.parent_name}}" id="parent_name" type="text" >
<label for="parent_name">Nome dei genitori</label>
</div>
<div class="input-field col l12 s12">
<input value="{{doc.2.via}}" disabled id="via" type="text" >
<label for="via">Via e numero</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.2.cap}}" name="cap" id="cap" type="text" >
<label for="cap">CAP</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.2.country}}" name="country" id="country" type="text" >
<label for="country">Paese</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.2.nationality}}" name="nationality" id="nationality" type="text" >
<label for="nationality">Nazionalità</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.2.phone}}" name="phone" id="phone" type="text" >
<label for="phone">Cellulare</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.2.home_phone}}" name="home_phone" id="home_phone" type="text" >
<label for="home_phone">Telefono di casa</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.2.email}}" name="email" id="email" type="text" >
<label for="email">Email</label>
</div>
<div class="input-field col l8 s12">
<input disabled value="{{doc.2.school}}" name="school" id="school" type="text" >
<label for="school">Scuola frequentata</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.2.year}}" name="year" id="year" type="text" >
<label for="year">Classe</label>
</div>
</div>
</span></div>
</li>
{% endif %}
{% if doc.0.document_type.medical_data %}
<li>
<div class="collapsible-header">
{% if doc.0.medical_data %}
<i class="material-icons">healing</i>Dati medici
{% else %}
<i class="material-icons">healing</i><del>Dati medici</del>
{% endif %}
</div>
{% if doc.0.medical_data %}
<div class="collapsible-body"><span>
<div class="row">
<div class="col s12">
<h6>Persona di contatto in caso di necessità</h6>
</div>
</div>
<div class="row">
<div class="input-field col l6 s12">
<input disabled name="emer_name" value="{{doc.3.emer_name}}" id="emer_name" type="text" >
<label for="emer_name">Nome e cognome</label>
</div>
<div class="input-field col l3 s12">
<input disabled name="emer_relative" value="{{doc.3.emer_relative}}" id="emer_relative" type="text" >
<label for="emer_releative">Parentela</label>
</div>
<div class="input-field col l3 s12">
<input disabled name="cell_phone" value="{{doc.3.cell_phone}}" id="cellphone" type="text" >
<label for="cell_phone">Cellulare</label>
</div>
<div class="input-field col l9 s12">
<input disabled value="{{doc.3.address}}" name="address" id="address" type="text" >
<label for="address">Indirizzo completo</label>
</div>
<div class="input-field col l3 s12">
<input disabled value="{{doc.3.emer_phone}}" name="emer_phone" id="emer_phone" type="text" >
<label for="emer_phone">Telefono di casa</label>
</div>
</div>
<div class="row">
<div class="col s12">
<h6>Assicurazione</h6>
</div>
</div>
<div class="row">
<div class="input-field col l4 s12">
<input disabled value="{{doc.3.health_care}}" name="health_care" id="health_care" type="text" >
<label for="health_care">Cassa Malati</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.3.injuries}}" name="injuries" id="injuries" type="text" >
<label for="injuries">Infortuni</label>
</div>
<div class="input-field col l4 s12">
<input disabled value="{{doc.3.rc}}" name="rc" id="rc" type="text" >
<label for="rc">Responsabilità civile</label>
</div>
</div>
<div class="row">
<div class="switch col s12">
È sostenitore REGA
<label>
No
<input disabled name="rega" type="checkbox" {% if doc.3.rega %}checked="checked"{%endif%}>
<span class="lever"></span>
Si
</label>
</div>
</div>
<div class="row">
<div class="col s12">
<h6>Medico di famiglia</h6>
</div>
<div class="input-field col l6 s12">
<input disabled value="{{doc.3.medic_name}}" name="medic_name" id="medic_name" type="text" >
<label for="medic_name">Nome e cognome</label>
</div>
<div class="input-field col l6 s12">
<input disabled value="{{doc.3.medic_phone}}" name="medic_phone" id="medic_phone" type="text" >
<label for="medic_phone">Telefono studio</label>
</div>
<div class="input-field col l12 s12">
<input disabled value="{{doc.3.medic_address}}" name="medic_address" id="medic_address" type="text" >
<label for="medic_address">Indirizzo completo</label>
</div>
</div>
<div class="row">
<div class="col s12">
<h6>Scheda medica personale</h6>
</div>
<div class="input-field col s12">
<input disabled value="{{doc.3.sickness}}" name="sickness" id="sickness" type="text">
<label for="sickness">Principali malattie avute</label>
</div>
<div class="input-field col l8 s12">
<input disabled value="{{doc.3.vaccine}}" name="vaccine" id="vaccine" type="text">
<label for="vaccine">Vacinazioni fatte</label>
</div>
<div class="input-field col l4 s12">
<label for="tetanus_date">Ultima vacinazione contro il tetano</label>
<input disabled value="{{doc.3.tetanus_date}}" name="tetanus_date" id="tetanus_date" type="text">
</div>
<div class="input-field col s12">
<input disabled value="{{doc.3.allergy}}" name="allergy" id="allergy" type="text">
<label for="allergy">Allergie particolari/Intolleraze alimentari</label>
</div>
<div class="switch col s12">
Deve assumere regolarmente medicamenti
<label>
No
<input disabled name="drugs_bool" type="checkbox" {% if doc.3.drugs_bool %}checked="checked"{%endif%}>
<span class="lever"></span>
Si
</label>
</div>
<div class="input-field col s12">
<input disabled value="{{doc.3.drugs}}" name="drugs" id="drugs" type="text">
<label for="drugs">Se sì quali, in che dosi e prescrizioni</label>
</div>
<div class="switch col s12">
Informazioni particolari sullo stato di salute: (postumi di operazioni, incidenti, malattie, disturbi fisici)
<label>
No
<input disabled name="misc_bool" type="checkbox" {% if doc.3.misc_bool %}checked="checked"{%endif%}>
<span class="lever"></span>
Si
</label>
</div>
<div class="input-field col s12">
<input disabled value="{{doc.3.misc}}" name="misc" id="misc" type="text">
<label for="misc">Se sì quali</label>
</div>
</span></div>
{% endif %}
</li>
{% endif %}
{% if doc.0.document_type.custom_data %}
<li>
<div class="collapsible-header">
<i class="material-icons">add_circle_outline</i>Dati aggiuntivi
</div>
<div class="collapsible-body"><span>
<table class="striped">
<tbody>
{% for key in doc.1 %}
<tr>
<td>{{key.key}}</td>
<td>{{key.value}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</span></div>
</li>
{% endif %}
{% if doc.0.document_type.medical_data %}
<li>
<div class="collapsible-header">
<i class="material-icons">attach_file</i>Allegati
</div>
<div class="collapsible-body"><span>
<div class="row">
<div class="col s12">
<div class="card">
<div class="card-image">
{% if doc.5 %} <img src="data:;base64,{{ doc.5 }}"> {% endif %}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<div class="card">
<div class="card-image">
{% if doc.6 %}<img src="data:;base64,{{ doc.6 }}">{% endif %}
</div>
</div>
</div>
</div>
</span></div>
</li>
{% endif %}
</ul>
</span></div>
</li>
{% endfor %}
</ul>
{% endif %}
<div class="fixed-action-btn">
<a id="add" class="btn-floating btn-large {{color}}" href="{% url 'create'%}">
<i class="large material-icons">add</i>
</a>
</div>
{% else %}
<div class="row">
<div class="col l4 offset-l4 m8 offset-m2 s12">
<div class="card">
<div class="card-content">
<p>Il tuo utente non è ancora stato approvato.</p>
<br>
{% if user_code %}
<p>Per approvare l'utente invia il seguente codice al capo branca:</p>
<h3 class="center-align">{{user_code}}<h3>
{% else %}
<p class="hide-on-small-only">Per approvare l'utente inserire prima i propri dati personali e medici cliccando il proprio nome in alto a destra. Torna in seguito su questa pagina per i prossimi passaggi.</p>
<p class="hide-on-med-and-up">Per approvare l'utente inserire prima i propri dati personali e medici cliccando <i class="material-icons tiny">person</i>. Torna in seguito su questa pagina per i prossimi passaggi.</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
{% else %}
<div class="row">
<div class="col l4 offset-l4 m8 offset-m2 s12">
<div class="card">
<div class="card-content">
<p>Se hai già un account clicca login in alto a destra. Altrimenti clicca registrazione</p>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block script %}
$(document).ready(function(){
{% if user.is_authenticated %}
{% if user.is_staff or perms.client.approved %}
$('.collapsible').collapsible();
$('.tap-target').tapTarget();
$('.modal').modal();
{% if empty %}
$('.tap-target').tapTarget('open');
{% endif %}
{% endif %}
{% endif %}
});
{% if user.is_authenticated %}
{% if user.is_staff or perms.client.approved %}
$('*').click(function(event) {
if (this === event.target) {
$('.tap-target').tapTarget('close');
}
});
function send(id) {
var form = document.getElementById('form')
var action = document.getElementById('action')
action.setAttribute('value', id);
form.submit()
}
{% endif %}
{% endif %}
{% endblock %}
|