aboutsummaryrefslogtreecommitdiffstats
path: root/server/templates
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-07-29 23:58:25 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-07-29 23:58:25 +0200
commit9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807 (patch)
treed136fde09ff4803aefc42f8dbd912ba563715faa /server/templates
parentaccept terms on account creation (diff)
downloadscout-subs-9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807.tar.gz
scout-subs-9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807.zip
upload signed documents
Diffstat (limited to '')
-rw-r--r--server/templates/server/approve_doc.html2
-rw-r--r--server/templates/server/doc_list.html18
-rw-r--r--server/templates/server/download_doc.html13
-rw-r--r--server/templates/server/index.html8
-rw-r--r--server/templates/server/upload_doc.html86
-rw-r--r--server/templates/server/user_list.html4
6 files changed, 122 insertions, 9 deletions
diff --git a/server/templates/server/approve_doc.html b/server/templates/server/approve_doc.html
index 3657f8f..c4bdca4 100644
--- a/server/templates/server/approve_doc.html
+++ b/server/templates/server/approve_doc.html
@@ -1,6 +1,6 @@
{% extends 'registration/base.html' %}
-{% block title %}Admin - Approva Utente{% endblock %}
+{% block title %}Admin - Approva Documento{% endblock %}
{% block nav %}
<a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html
index 3953905..12b64cd 100644
--- a/server/templates/server/doc_list.html
+++ b/server/templates/server/doc_list.html
@@ -86,6 +86,16 @@
<ul class="collapsible"><li>
<div class="collapsible-header">Avanzati</div>
<div class="collapsible-body"><span>
+ <div class="row">
+ <div class="input-field col s12">
+ <label>
+ <input name="filter_signdoc" type="checkbox" class="filled-in" {{signdoc_check}}/>
+ <span style="color:black"><i class="material-icons left">check_circle</i>Visualizza solo approvati con firma allegata</span>
+ </label>
+ </div>
+ </div>
+ <br>
+ <br>
<div class = "row">
<div class="input-field col l6 s12">
<label for="newer">Pi&ugrave; recenti di</label>
@@ -130,7 +140,11 @@
{% if doc.0.status == "wait" %}
<i class="material-icons">timelapse</i>
{% elif doc.0.status == "ok" %}
+ {% if doc.0.signed_doc %}
+ <i class="material-icons">check_circle</i>
+ {% else %}
<i class="material-icons">check</i>
+ {% endif %}
{% elif doc.0.status == "archive" %}
<i class="material-icons">archive</i>
{% elif doc.0.status == "autosign" %}
@@ -386,7 +400,7 @@
<div class="col s12">
<div class="card">
<div class="card-image">
- <img src="data:;base64,{{ doc.5 }}">
+ {% if doc.5 %}<img src="data:;base64,{{ doc.5 }}">{% endif %}
</div>
</div>
</div>
@@ -395,7 +409,7 @@
<div class="col s12">
<div class="card">
<div class="card-image">
- <img src="data:;base64,{{ doc.6 }}">
+ {% if doc.6 %}<img src="data:;base64,{{ doc.6 }}">{% endif %}
</div>
</div>
</div>
diff --git a/server/templates/server/download_doc.html b/server/templates/server/download_doc.html
index 41ce00b..4f4f12d 100644
--- a/server/templates/server/download_doc.html
+++ b/server/templates/server/download_doc.html
@@ -262,7 +262,7 @@
<div class="col s12">
<div class="card">
<div class="card-image">
- <img src="data:;base64,{{ vac }}">
+ {% if vac %}<img src="data:;base64,{{ vac }}">{% endif %}
</div>
</div>
</div>
@@ -271,7 +271,16 @@
<div class="col s12">
<div class="card">
<div class="card-image">
- <img src="data:;base64,{{ health }}">
+ {% if health %}<img src="data:;base64,{{ health }}">{% endif %}
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s12">
+ <div class="card">
+ <div class="card-image">
+ {% if sign_doc_file %}<img src="data:;base64,{{ sign_doc_file }}">{% endif %}
</div>
</div>
</div>
diff --git a/server/templates/server/index.html b/server/templates/server/index.html
index 57cfc83..4c82618 100644
--- a/server/templates/server/index.html
+++ b/server/templates/server/index.html
@@ -9,7 +9,7 @@
{% block content %}
<div class="row">
- <div class="col l6 s12">
+ <div class="col l4 s12">
<div class="card large">
<div class="card-content">
<p>
@@ -35,7 +35,7 @@
</div>
</div>
</div>
- <div class="col l6 s12">
+ <div class="col l8 s12">
<div class="card large">
<div class="card-content">
<ul class="collection">
@@ -60,6 +60,7 @@
<a class="waves-effect waves-light btn red lighten-1" href="{% url 'doctype' %}">Lista tipo doc</a>
<a class="waves-effect waves-light btn red lighten-1" href="{% url 'doclist' %}">Lista documenti</a>
<a class="waves-effect waves-light btn red lighten-1" href="{% url 'docapprove' %}">Approva documento</a>
+ <a class="waves-effect waves-light btn red lighten-1" href="{% url 'docupload' %}">Carica firma</a>
</div>
<div class="hide-on-med-and-up">
@@ -70,6 +71,9 @@
<br>
<br>
<a class="col s12 waves-effect waves-light btn red lighten-1" href="{% url 'docapprove' %}">Approva documento</a>
+ <br>
+ <br>
+ <a class="col s12 waves-effect waves-light btn red lighten-1" href="{% url 'docupload' %}">Carica firma</a>
</div>
</div>
</div>
diff --git a/server/templates/server/upload_doc.html b/server/templates/server/upload_doc.html
new file mode 100644
index 0000000..334a819
--- /dev/null
+++ b/server/templates/server/upload_doc.html
@@ -0,0 +1,86 @@
+{% extends 'registration/base.html' %}
+
+{% block title %}Admin - Carica documento{% endblock %}
+
+{% block nav %}
+ <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+ <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
+ <a href="{% url 'docupload'%}" class="breadcrumb hide-on-med-and-down">Carica Documento</a>
+{% endblock %}
+
+{% block content %}
+<form target="_blank" action="{% url 'docpreview' %}" method="post" id="preview_form">
+ {% csrf_token %}
+ <input type="hidden" name="preview" id="code_submit">
+</form>
+
+<div class="row">
+ <div class="col l4 offset-l4 m8 offset-m2 s12">
+ <div class="card">
+ <form id="form" action="{% url 'docupload'%}" method="post" enctype="multipart/form-data">
+ {% csrf_token %}
+ <div class="card-content">
+ <div class="row">
+ <div class="input-field col s12">
+ <input name="code" id="code" type="text">
+ <label for="code">Codice documento</label>
+ </div>
+ <a class="waves-effect waves-light btn red lighten-1" onclick="send()">Anteprima documento</a>
+ </div>
+ <br>
+ <div class="row">
+ <div class="file-field input-field col s12">
+ <div class="btn red lighten-1">
+ <span><i class="material-icons left">file_upload</i>File</span>
+ <input type="file" name="doc_sign" id="doc_sign" onchange="loadFile(event)">
+ </div>
+ <div class="file-path-wrapper">
+ <input id="doc_sign_name" class="file-path" type="text" placeholder="Documento firmato">
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="card-action">
+ <a class="waves-effect waves-light btn red lighten-1" href="#" onclick="document.getElementById('form').submit()">Invia</a>
+ </div>
+ </form>
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="col l4 offset-l4 m8 offset-m2 s12">
+ <div class="card">
+ <div class="card-image">
+ <img id="preview"/>
+ </div>
+ </div>
+ </div>
+</div>
+
+{% endblock %}
+
+{% block script %}
+function send() {
+ var form = document.getElementById('preview_form')
+ var action = document.getElementById('code_submit')
+ var text = document.getElementById('code').value
+ action.setAttribute('value', text);
+ form.submit()
+}
+
+var loadFile = function(event) {
+ var output = document.getElementById('preview');
+ output.src = URL.createObjectURL(event.target.files[0]);
+ output.onload = function() {
+ URL.revokeObjectURL(output.src) // free memory
+ }
+};
+$(document).ready(function(){
+ {% if error %}
+ M.toast({html: '{{ error_text }}', classes: 'orange'})
+ {% elif success %}
+ M.toast({html: '{{ success_text }}', classes: 'green'})
+ {% endif %}
+});
+{% endblock %} \ No newline at end of file
diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html
index 26e4b11..653e33d 100644
--- a/server/templates/server/user_list.html
+++ b/server/templates/server/user_list.html
@@ -274,7 +274,7 @@
<div class="col s12">
<div class="card">
<div class="card-image">
- <img src="data:;base64,{{ user.4 }}">
+ {% if user.4 %}<img src="data:;base64,{{ user.4 }}">{% endif %}
</div>
</div>
</div>
@@ -283,7 +283,7 @@
<div class="col s12">
<div class="card">
<div class="card-image">
- <img src="data:;base64,{{ user.5 }}">
+ {% if user.5 %}<img src="data:;base64,{{ user.5 }}">{% endif %}
</div>
</div>
</div>