aboutsummaryrefslogtreecommitdiffstats
path: root/server/templates
diff options
context:
space:
mode:
authorAndrea Lepori <aleporia@gmail.com>2024-11-12 15:27:12 +0100
committerAndrea Lepori <aleporia@gmail.com>2024-11-12 15:27:23 +0100
commit0b5be72725ffd6cd10490fbd202388e22c7f8522 (patch)
treeaa3738e82a99372468084885aa7cbbbf1ef83fcd /server/templates
parentadd new materialize v2 (diff)
downloadscout-subs-0b5be72725ffd6cd10490fbd202388e22c7f8522.tar.gz
scout-subs-0b5be72725ffd6cd10490fbd202388e22c7f8522.zip
commit edits for new featuredata_download
Diffstat (limited to '')
-rw-r--r--server/templates/server/data_download.html102
-rw-r--r--server/templates/server/doc_type.html2
2 files changed, 103 insertions, 1 deletions
diff --git a/server/templates/server/data_download.html b/server/templates/server/data_download.html
new file mode 100644
index 0000000..59b180d
--- /dev/null
+++ b/server/templates/server/data_download.html
@@ -0,0 +1,102 @@
+{% extends 'registration/base_admin.html' %}
+
+{% block title %}Admin - Richiesta dati{% endblock %}
+
+{% block breadcrumb %}
+ <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
+ <a class="breadcrumb hide-on-med-and-down">Richiesta dati</a>
+{% endblock %}
+
+{% block content %}
+
+<div class="row">
+ <div class="col l4 offset-l4 m8 offset-m2 s12">
+ <div class="card">
+ <div class="card-content">
+ <div class="row">
+ <div class="col s12">
+ <div class="chips" id="doc_search"></div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s12">
+ <p>
+ <label>
+ <input class="filled-in" name="personal" type="checkbox"/>
+ <span>Dati personali</span>
+ </label>
+ </p>
+ <p>
+ <label>
+ <input class="filled-in" name="medic" type="checkbox"/>
+ <span>Dati medici</span>
+ </label>
+ </p>
+ <p>
+ <label>
+ <input class="filled-in" name="attachments" type="checkbox"/>
+ <span>Allegati (vaccinazioni e tessera cassa malati)</span>
+ </label>
+ </p>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s12">
+ <a onclick="send()" class="waves-effect waves-light btn {{color}}"><i class="material-icons left">download</i>Scarica</a>
+ </div>
+ </div>
+ <div class="row" id="loading" hidden>
+ <div class="col s12">
+ <h6 id="progress_text">Preparazione dei documenti</h6>
+ <div class="progress">
+ <div id="progress_bar" class="indeterminate"></div>
+ <div class="determinate" style="width: 0%"></div>
+ </div>
+ <p id="under_text"></p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{% endblock %}
+
+{% block script %}
+$(document).ready(function(){
+ {% if error %}
+ M.toast({html: '{{ error }}', classes: 'orange'})
+ {% endif %}
+});
+
+document.addEventListener('DOMContentLoaded', function() {
+ var options = {
+ placeholder: 'Documento',
+ autocompleteOptions: {
+ data: {
+ {% for doc in docs %}
+ '{{ doc.name }}': null,
+ {% endfor %}
+ },
+ },
+ limit: 1,
+ };
+
+ var elems = document.querySelectorAll('.chips');
+ var instances = M.Chips.init(elems, options);
+});
+
+function send() {
+ var chips = M.Chips.getInstance(document.getElementById('doc_search'));
+ var personal = document.getElementsByName('personal')[0].checked;
+ var medic = document.getElementsByName('medic')[0].checked;
+ var attachments = document.getElementsByName('attachments')[0].checked;
+
+ var loadbox = document.getElementById('loading');
+ var progress = document.getElementById('progress_bar');
+ var progress_text = document.getElementById('progress_text');
+ var under_text = document.getElementById('under_text');
+
+ loadbox.hidden = false;
+
+}
+{% endblock%} \ No newline at end of file
diff --git a/server/templates/server/doc_type.html b/server/templates/server/doc_type.html
index 35dd9f3..023ea5e 100644
--- a/server/templates/server/doc_type.html
+++ b/server/templates/server/doc_type.html
@@ -147,7 +147,7 @@
<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('d{{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">download_for_offline</i>Scarica CSV (con dati medici)</a>
{% endif %}