aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-07-21 21:47:09 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-07-21 21:47:09 +0200
commita531c5e12a65ac7c216bb3f91e510c1d31fbb06e (patch)
treec306bfc36f54815759cfe4b15b8f296865e2b70e /server
parentmodify gitignore (diff)
downloadscout-subs-7aa4a6aebbb65ca67da189e8c231d5dc330d5652.tar.gz
scout-subs-7aa4a6aebbb65ca67da189e8c231d5dc330d5652.zip
static files, last improvements0.1
Diffstat (limited to '')
-rw-r--r--server/templates/server/approve_doc.html2
-rw-r--r--server/templates/server/approve_user.html2
-rw-r--r--server/templates/server/doc_create.html8
-rw-r--r--server/templates/server/doc_list.html19
-rw-r--r--server/templates/server/doc_type.html46
-rw-r--r--server/templates/server/download_doc.html27
-rw-r--r--server/views.py5
7 files changed, 74 insertions, 35 deletions
diff --git a/server/templates/server/approve_doc.html b/server/templates/server/approve_doc.html
index 82ecf2a..3657f8f 100644
--- a/server/templates/server/approve_doc.html
+++ b/server/templates/server/approve_doc.html
@@ -34,7 +34,7 @@
<textarea name="codes" class="materialize-textarea"></textarea>
</div>
<div class="card-action">
- <a href="#" onclick="document.getElementById('form').submit()">Invia</a>
+ <a class="waves-effect waves-light btn red lighten-1" href="#" onclick="document.getElementById('form').submit()">Invia</a>
</div>
</form>
</div>
diff --git a/server/templates/server/approve_user.html b/server/templates/server/approve_user.html
index 9d4b36c..09afee9 100644
--- a/server/templates/server/approve_user.html
+++ b/server/templates/server/approve_user.html
@@ -34,7 +34,7 @@
<textarea name="codes" class="materialize-textarea"></textarea>
</div>
<div class="card-action">
- <a href="#" onclick="document.getElementById('form').submit()">Invia</a>
+ <a class="waves-effect waves-light btn red lighten-1" href="#" onclick="document.getElementById('form').submit()">Invia</a>
</div>
</form>
</div>
diff --git a/server/templates/server/doc_create.html b/server/templates/server/doc_create.html
index 1c469ae..1976967 100644
--- a/server/templates/server/doc_create.html
+++ b/server/templates/server/doc_create.html
@@ -55,25 +55,25 @@
<div class="input-field col s2">
<label>
<input name="personal_data" type="checkbox" class="filled-in" {{personal_check}}/>
- <span>Dati personali</span>
+ <span style="color:black">Dati personali</span>
</label>
</div>
<div class="input-field col s2">
<label>
<input name="medical_data" type="checkbox" class="filled-in" {{medical_check}} />
- <span>Dati medici</span>
+ <span style="color:black">Dati medici</span>
</label>
</div>
<div class="input-field col s4">
<label>
<input name="custom_data" type="checkbox" class="filled-in" {{custom_check}}/>
- <span>Parametri personalizzati</span>
+ <span style="color:black">Parametri personalizzati</span>
</label>
</div>
<div class="input-field col s4">
<label>
<input name="custom_message" type="checkbox" class="filled-in" {{custom_message_check}}/>
- <span>Messaggio personalizzato</span>
+ <span style="color:black">Messaggio personalizzato</span>
</label>
</div>
</div>
diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html
index 51cd5e4..fd546c5 100644
--- a/server/templates/server/doc_list.html
+++ b/server/templates/server/doc_list.html
@@ -59,25 +59,25 @@
<div class="input-field col s3">
<label>
<input name="filter_hidden" type="checkbox" class="filled-in" {{hidden_check}}/>
- <span><i class="material-icons left">archive</i>Archiviati</span>
+ <span style="color:black"><i class="material-icons left">archive</i>Archiviati</span>
</label>
</div>
<div class="input-field col s3">
<label>
<input name="filter_wait" type="checkbox" class="filled-in" {{wait_check}}/>
- <span><i class="material-icons left">timelapse</i>In Attesa</span>
+ <span style="color:black"><i class="material-icons left">timelapse</i>In Attesa</span>
</label>
</div>
<div class="input-field col s3">
<label>
<input name="filter_selfsign" type="checkbox" class="filled-in" {{selfsign_check}}/>
- <span><i class="material-icons left">assignment_turned_in</i>No firma</span>
+ <span style="color:black"><i class="material-icons left">assignment_turned_in</i>No firma</span>
</label>
</div>
<div class="input-field col s3">
<label>
<input name="filter_ok" type="checkbox" class="filled-in" {{ok_check}}/>
- <span><i class="material-icons left">check</i>Approvati</span>
+ <span style="color:black"><i class="material-icons left">check</i>Approvati</span>
</label>
</div>
</div>
@@ -420,10 +420,12 @@ $(document).ready(function(){
$('.collapsible').collapsible();
$('.tooltipped').tooltip();
$('.modal').modal();
+ $('.datepicker').datepicker(options);
{% if error %}
M.toast({html: '{{ error_text}}', classes: 'orange'})
{% endif %}
});
+
$('.chips').chips();
$('#chips_type').chips({
placeholder: 'Tipo',
@@ -511,6 +513,7 @@ function send(id) {
groups.setAttribute('value', groups_array.join("^|"))
form.submit()
}
+
$('#select-all').click(function(event) {
if(this.checked) {
// Iterate each checkbox
@@ -523,6 +526,7 @@ $('#select-all').click(function(event) {
});
}
});
+
var options = {
showClearBtn: true,
container: document.getElementById('main'),
@@ -545,9 +549,6 @@ var options = {
labelMonthPrev: 'Mese precedente',
labelMonthSelect: 'Seleziona un mese',
labelYearSelect: 'Seleziona un anno'
- }}
- document.addEventListener('DOMContentLoaded', function() {
- var elems = document.querySelectorAll('.datepicker');
- var instances = M.Datepicker.init(elems, options);
- });
+ }
+}
{% endblock %} \ No newline at end of file
diff --git a/server/templates/server/doc_type.html b/server/templates/server/doc_type.html
index b4b7f87..33399bf 100644
--- a/server/templates/server/doc_type.html
+++ b/server/templates/server/doc_type.html
@@ -7,7 +7,7 @@
<div class="nav-wrapper red lighten-1">
<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 'doctype' %}" class="breadcrumb hide-on-med-and-down">Tipo Doc</a>
+ <a ref="{% url 'doctype' %}" class="breadcrumb hide-on-med-and-down">Tipo Doc</a>
<ul class="right">
{% if user.is_staff %}
<li><a href="{% url 'server' %}">Pannello Admin</a></li>
@@ -39,6 +39,15 @@
<li><a class="tooltipped" data-position="top" data-tooltip="Elimina selezionati" Onclick="send('delete')"><i class="material-icons">delete</i></a></li>
</ul>
<ul class="right">
+ <li>
+ <form>
+ <div class="input-field">
+ <input autocomplete="off" id="search" type="search" onkeyup="filterResults()" required>
+ <label class="label-icon" for="search"><i class="material-icons">search</i></label>
+ <i class="material-icons">close</i>
+ </div>
+ </form>
+ </li>
<li><a class="tooltipped" data-position="top" data-tooltip="Pulisci filtri" Onclick="send('clear')"><i class="material-icons">clear</i></a></li>
<li><a href="#modal1" data-target="modal1" class="modal-trigger tooltipped" data-position="top" data-tooltip="Filtri"><i class="material-icons">filter_list</i></a></li>
</ul>
@@ -56,25 +65,25 @@
<div class="input-field col l3 s12">
<label>
<input name="filter_hidden" type="checkbox" class="filled-in" {{hidden_check}}/>
- <span><i class="material-icons left">visibility_off</i>Disabilitati</span>
+ <span style="color:black"><i class="material-icons left">visibility_off</i>Disabilitati</span>
</label>
</div>
<div class="input-field col l3 s12">
<label>
<input name="filter_public" type="checkbox" class="filled-in" {{public_check}}/>
- <span><i class="material-icons left">public</i>Pubblici</span>
+ <span style="color:black"><i class="material-icons left">public</i>Pubblici</span>
</label>
</div>
<div class="input-field col l3 s12">
<label>
<input name="filter_selfsign" type="checkbox" class="filled-in" {{selfsign_check}}/>
- <span><i class="material-icons left">assignment_turned_in</i>No firma</span>
+ <span style="color:black"><i class="material-icons left">assignment_turned_in</i>No firma</span>
</label>
</div>
<div class="input-field col l3 s12">
<label>
<input name="filter_group" type="checkbox" class="filled-in" {{group_check}}/>
- <span><i class="material-icons left">group_work</i>Gruppo</span>
+ <span style="color:black"><i class="material-icons left">group_work</i>Gruppo</span>
</label>
</div>
</div>
@@ -82,25 +91,25 @@
<div class="input-field col l3 s12">
<label>
<input name="filter_personal" type="checkbox" class="filled-in" {{personal_check}}/>
- <span><i class="material-icons left">person</i>Personali</span>
+ <span style="color:black"><i class="material-icons left">person</i>Personali</span>
</label>
</div>
<div class="input-field col l3 s12">
<label>
<input name="filter_medic" type="checkbox" class="filled-in" {{medic_check}}/>
- <span><i class="material-icons left">healing</i>Medici</span>
+ <span style="color:black"><i class="material-icons left">healing</i>Medici</span>
</label>
</div>
<div class="input-field col l3 s12">
<label>
<input name="filter_custom" type="checkbox" class="filled-in" {{custom_check}}/>
- <span><i class="material-icons left">add_circle_outline</i>Personalizzati</span>
+ <span style="color:black"><i class="material-icons left">add_circle_outline</i>Personalizzati</span>
</label>
</div>
<div class="input-field col l3 s12">
<label>
<input name="filter_message" type="checkbox" class="filled-in" {{message_check}}/>
- <span><i class="material-icons left">message</i>Messaggi</span>
+ <span style="color:black"><i class="material-icons left">message</i>Messaggi</span>
</label>
</div>
</div>
@@ -114,7 +123,7 @@
<ul class="collapsible">
{% for doctype in docs %}
<li>
- <div class="collapsible-header">
+ <div class="collapsible-header list">
<label>
<input name={{doctype.0.id}} type="checkbox" class="filled-in"/>
<span></span>
@@ -227,4 +236,21 @@ $('#select-all').click(function(event) {
});
}
});
+
+function filterResults() {
+ var search = document.getElementById('search')
+ var filter = search.value.toUpperCase()
+ var items = document.getElementsByClassName('list')
+
+
+ for (i = 0; i < items.length; i++) {
+ var a = items[i];
+ var txtValue = a.innerText;
+ if (txtValue.toUpperCase().indexOf(filter) > -1) {
+ items[i].style.display = "";
+ } else {
+ items[i].style.display = "none";
+ }
+ }
+}
{% endblock %} \ No newline at end of file
diff --git a/server/templates/server/download_doc.html b/server/templates/server/download_doc.html
index b55b9a0..41ce00b 100644
--- a/server/templates/server/download_doc.html
+++ b/server/templates/server/download_doc.html
@@ -1,8 +1,13 @@
-{% extends 'registration/base_custom.html' %}
-
-{% block title %}Admin - Documenti{% endblock %}
-
-{% block content %}
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
+ <title></title>
+</head>
+<body>
+<main style="margin-left: 10px;margin-right: 10px;margin-top: 10px;">
<ul class="collapsible">
<li class="active">
<div class="collapsible-header">
@@ -279,14 +284,16 @@
</li>
</ul>
</form>
-{% endblock %}
-
-{%block script%}
+</main>
+</body>
+<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
+<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.collapsible');
var options = {
accordion: false
}
var instances = M.Collapsible.init(elems, options);
- });
-{% endblock %} \ No newline at end of file
+});
+</script>
+</html> \ No newline at end of file
diff --git a/server/views.py b/server/views.py
index e9739c3..e4fea63 100644
--- a/server/views.py
+++ b/server/views.py
@@ -213,6 +213,9 @@ def doctype(request):
docc = DocumentType.objects.get(id=i)
if docc.group.name in parent_groups:
selected.append(docc)
+ else:
+ error = True
+ error_text = "Non puoi modificare un documento non del tuo gruppo"
for i in selected:
if request.POST["action"] == 'delete':
@@ -524,6 +527,8 @@ def doclist(request):
for i in documents:
personal = None
medical = None
+ vac_file = ""
+ health_file = ""
if i.document_type.personal_data:
personal = i.personal_data
if i.document_type.medical_data: