diff options
Diffstat (limited to 'server/templates')
-rw-r--r-- | server/templates/server/debug_usercode.html | 2 | ||||
-rw-r--r-- | server/templates/server/doc_list.html | 5 | ||||
-rw-r--r-- | server/templates/server/doc_list_table.html | 24 | ||||
-rw-r--r-- | server/templates/server/doc_type.html | 120 | ||||
-rw-r--r-- | server/templates/server/index.html | 12 |
5 files changed, 137 insertions, 26 deletions
diff --git a/server/templates/server/debug_usercode.html b/server/templates/server/debug_usercode.html index 014d6fd..9549d77 100644 --- a/server/templates/server/debug_usercode.html +++ b/server/templates/server/debug_usercode.html @@ -6,7 +6,7 @@ <pre> {% for user in data %} -[{{user.0.id}}] {{user.0.username}} {{user.0.first_name}} {{user.0.last_name}} +[{{user.0.id}}] {{user.0.username}} {{user.0.first_name}} {{user.0.last_name}} ({{user.2}}) {% for uc in user.1 %} [{{uc.id}}] {{uc.code}} {{uc.first_name}} {{uc.last_name}} ({{uc.branca}}) {% endfor %} {% endfor %} </pre> diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html index 28511e7..27c209c 100644 --- a/server/templates/server/doc_list.html +++ b/server/templates/server/doc_list.html @@ -4,6 +4,7 @@ {% block breadcrumb %} <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a> + <a href="{% url 'doctype'%}" class="breadcrumb hide-on-med-and-down">Tipi</a> <a class="breadcrumb hide-on-med-and-down">Documenti</a> {% endblock %} {% block toolbar %} @@ -62,7 +63,7 @@ </div> </div> -<form id="selection" action="{% url 'doclist' %}" method="post"> +<form id="selection" action="{% url 'doclist' type_id=type_id %}" method="post"> {% csrf_token %} <div id="modal1" class="modal modal-fixed-footer"> <div class="modal-content"> @@ -106,7 +107,7 @@ </div> </div> <div class = "row"> - <div class="col s12"> + <div class="col s12" {% if type_id != 0 %} hidden {% endif %}> <div id="chips_type" class="chips chips-placeholder chips-autocomplete"></div> </div> <div class="col s12"> diff --git a/server/templates/server/doc_list_table.html b/server/templates/server/doc_list_table.html index 6b3556b..6a12378 100644 --- a/server/templates/server/doc_list_table.html +++ b/server/templates/server/doc_list_table.html @@ -4,6 +4,7 @@ {% block breadcrumb %} <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a> + <a href="{% url 'doctype'%}" class="breadcrumb hide-on-med-and-down">Tipi</a> <a class="breadcrumb hide-on-med-and-down">Documenti</a> {% endblock %} {% block toolbar %} @@ -20,7 +21,7 @@ {% block content %} {% load app_filter %} -<form id="selection" action="{% url 'doclist-table' %}" method="post"> +<form id="selection" action="{% url 'doclist-table' type_id=type_id %}" method="post"> {% csrf_token %} <div id="modal2" class="modal modal-fixed-footer"> <div class="modal-content"> @@ -64,7 +65,7 @@ </div> </div> <div class = "row"> - <div class="col s12"> + <div class="col s12" {% if type_id != 0 %} hidden {% endif %}> <div id="chips_type" class="chips chips-placeholder chips-autocomplete"></div> </div> <div class="col s12"> @@ -170,6 +171,9 @@ allergy: "{{doc.medical_data.allergy}}", drugs: "{{doc.medical_data.drugs}}", misc: "{{doc.medical_data.misc}}", + {% for key in doc|doc_key %} + custom_key_{{forloop.counter0}}: "{{key.value}}", + {% endfor %} }, {% endfor %} ]; @@ -179,11 +183,11 @@ var col_categories = [ {field: "base", name: "Informazioni base", cols: [ + {title: "Nome", field: "name", frozen: true}, + {title: "Cognome", field: "last_name", frozen: true}, {title: "Stato", field: "status", formatter: iconFormatter}, {title: "Tipo", field: "type"}, {title: "Codice", field: "code"}, - {title: "Nome", field: "name"}, - {title: "Cognome", field: "last_name"}, {title: "Capo", field: "capo", formatter:"tickCross"}, {title: "Data compilazione", field: "compilation_date"}, {title: "Branca", field: "branca"}, @@ -227,6 +231,15 @@ {title: "Info particolari", field: "misc", visible: false}, ] }, + {% if custom_keys|length > 0 %} + {field: "custom", name: "Parametri personalizzati", cols: + [ + {% for key in custom_keys %} + {title: "{{key.1}}", field: "custom_key_{{key.0}}", visible: true, width: "7%"}, + {% endfor %} + ] + }, + {% endif %} ] var docTypes = {}; @@ -261,8 +274,9 @@ var table = new Tabulator("#example-table", { movableColumns: true, layout:"fitDataFill", - responsiveLayout: "hide", + {% if type_id == 0 %} groupBy: "type", + {% endif %} data:tabledata, columns:columns, groupHeader:function(value, count, data, group){ diff --git a/server/templates/server/doc_type.html b/server/templates/server/doc_type.html index 4f8fe6f..c81bcdb 100644 --- a/server/templates/server/doc_type.html +++ b/server/templates/server/doc_type.html @@ -4,7 +4,7 @@ {% block breadcrumb %} <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a> - <a class="breadcrumb hide-on-med-and-down">Tipo Doc</a> + <a class="breadcrumb hide-on-med-and-down">Tipi</a> {% endblock %} {% block toolbar %} <div class="nav-wrapper {{color}}"> @@ -119,7 +119,7 @@ <input type="hidden" name="action" id="action"> <ul class="collapsible"> - {% for doctype in docs %} + {% for doctype, dat in docs %} <li> <div class="collapsible-header list"> <label> @@ -142,15 +142,17 @@ <i class="material-icons">lock</i> {% endif %} {{doctype.name}} - <span class="new badge {{color}}" data-badge-caption="">{{doctype|doc_count}}</span> + <span class="new badge {{color}}" data-badge-caption="">{{dat.doc_count}}</span> </div> <div class="collapsible-body"><span> <div class="hide-on-med-and-down"> - <a class="waves-effect waves-light btn {{color}}" onclick="send('e{{doctype.id}}')"><i class="material-icons left">edit</i> Modifica tipo</a> - <a class="waves-effect waves-light btn {{color}}" onclick="send('p{{doctype.id}}')"><i class="material-icons left">file_download</i> Scarica CSV</a> + <a class="waves-effect waves-light btn {{color}}" onclick="send('e{{doctype.id}}')"><i class="material-icons left">edit</i>Modifica tipo</a> + <a class="waves-effect waves-light btn {{color}}" onclick="send('p{{doctype.id}}')"><i class="material-icons left">file_download</i>Scarica CSV</a> {% if doctype.medical_data %} - <a class="waves-effect waves-light btn {{color}}" onclick="send('m{{doctype.id}}')"><i class="material-icons left">file_download</i> Scarica CSV (con dati medici)</a> + <a class="waves-effect waves-light btn {{color}}" onclick="send('m{{doctype.id}}')"><i class="material-icons left">download_for_offline</i>Scarica CSV (con dati medici)</a> {% endif %} + <a class="waves-effect waves-light btn {{color}}" href={% url "doclist" type_id=doctype.id %}><i class="material-icons left">description</i>Documenti</a> + <a class="waves-effect waves-light btn {{color}}" href={% url "doclist-table" type_id=doctype.id %}><i class="material-icons left">document_scanner</i>Documenti formato tabella (BETA)</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('e{{doctype.id}}')"><i class="material-icons left">edit</i> Modifica tipo</a> @@ -160,11 +162,16 @@ {% if doctype.medical_data %} <br> <br> - <a class="col s12 waves-effect waves-light btn {{color}}" onclick="send('m{{doctype.id}}')"><i class="material-icons left">file_download</i> Scarica CSV (con dati medici)</a> + <a class="col s12 waves-effect waves-light btn {{color}}" onclick="send('m{{doctype.id}}')"><i class="material-icons left">download_for_offline</i> Scarica CSV (con dati medici)</a> + <br> + <br> + <a class="col s12 waves-effect waves-light btn {{color}}" href={% url "doclist" type_id=doctype.id %}><i class="material-icons left">description</i>Documenti</a> + <br> + <br> + <a class="col s12 waves-effect waves-light btn {{color}}" href={% url "doclist-table" type_id=doctype.id %}><i class="material-icons left">document_scanner</i>Documenti formato tabella (BETA)</a> {% endif %} </div> <br> - <br> <ul class="collection"> {% if not doctype.group_private %} <li class="collection-item"> @@ -187,6 +194,103 @@ </li> {% endif %} </ul> + <br> + + <div class="hide-on-med-and-down"> + <div class="row"> + <div class="col s6"> + <table class="responsive-table striped"> + <tbody> + <tr> + <td><b>Riassuntivo</b></td> + <td><b>Partecipanti</b></td> + <td><b>Capi</b></td> + <td><b>Totale</b></td> + </tr> + <tr> + <td><b>diga</b></td> + <td>{{dat.diga.0}}</td> + <td>{{dat.diga.1}}</td> + <td>{{dat.diga.2}}</td> + </tr> + <tr> + <td><b>muta</b></td> + <td>{{dat.muta.0}}</td> + <td>{{dat.muta.1}}</td> + <td>{{dat.muta.2}}</td> + </tr> + <tr> + <td><b>reparto</b></td> + <td>{{dat.reparto.0}}</td> + <td>{{dat.reparto.1}}</td> + <td>{{dat.reparto.2}}</td> + </tr> + <tr> + <td><b>posto</b></td> + <td>{{dat.posto.0}}</td> + <td>{{dat.posto.1}}</td> + <td>{{dat.posto.2}}</td> + </tr> + <tr> + <td><b>clan</b></td> + <td>{{dat.clan.0}}</td> + <td>{{dat.clan.1}}</td> + <td>{{dat.clan.2}}</td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + + <div class="hide-on-large-only row"> + <div class="row"> + <div class="col s12"> + <table class="responsive-table striped"> + <tbody> + <tr> + <td><b>Riassuntivo</b></td> + <td><b>Partecipanti</b></td> + <td><b>Capi</b></td> + <td><b>Totale</b></td> + </tr> + <tr> + <td><b>diga</b></td> + <td>{{dat.diga.0}}</td> + <td>{{dat.diga.1}}</td> + <td>{{dat.diga.2}}</td> + </tr> + <tr> + <td><b>muta</b></td> + <td>{{dat.muta.0}}</td> + <td>{{dat.muta.1}}</td> + <td>{{dat.muta.2}}</td> + </tr> + <tr> + <td><b>reparto</b></td> + <td>{{dat.reparto.0}}</td> + <td>{{dat.reparto.1}}</td> + <td>{{dat.reparto.2}}</td> + </tr> + <tr> + <td><b>posto</b></td> + <td>{{dat.posto.0}}</td> + <td>{{dat.posto.1}}</td> + <td>{{dat.posto.2}}</td> + </tr> + <tr> + <td><b>clan</b></td> + <td>{{dat.clan.0}}</td> + <td>{{dat.clan.1}}</td> + <td>{{dat.clan.2}}</td> + </tr> + </tbody> + </table> + </div> + </div> + </div> + + <br> {% if doctype.custom_data or doctype.custom_message %} <ul class="collapsible"> {% if doctype.custom_data %} diff --git a/server/templates/server/index.html b/server/templates/server/index.html index 487ef71..5a8bd5f 100644 --- a/server/templates/server/index.html +++ b/server/templates/server/index.html @@ -87,20 +87,12 @@ </div> <div class="card-action"> <div class="hide-on-med-and-down"> - <a class="waves-effect waves-light btn {{color}}" href="{% url 'doctype' %}">Tipi</a> - <a class="waves-effect waves-light btn {{color}}" href="{% url 'doclist' %}">Documenti</a> - <a class="waves-effect waves-light btn {{color}}" href="{% url 'doclist-table' %}">Documenti (Tabella BETA)</a> + <a class="waves-effect waves-light btn {{color}}" href="{% url 'doctype' %}">Documenti</a> <a class="waves-effect waves-light btn {{color}}" href="{% url 'docapprove' %}">Approva documento</a> </div> <div class="hide-on-large-only"> - <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'doctype' %}">Tipi</a> - <br> - <br> - <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'doclist' %}">Documenti</a> - <br> - <br> - <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'docapprove' %}">Approva documento</a> + <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'doctype' %}">Documenti</a> <br> <br> <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'docupload' %}">Carica firma</a> |