aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-08-31 13:46:00 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-08-31 13:46:00 +0200
commitc46671ed9306eebb66322487ab600e070b2a81c6 (patch)
tree9fb917db87c003642f94c459a172fe36b19fea82 /server
parentdynamicaly check for commit id (diff)
downloadscout-subs-c46671ed9306eebb66322487ab600e070b2a81c6.tar.gz
scout-subs-c46671ed9306eebb66322487ab600e070b2a81c6.zip
graghics improvement for mobile, and more modular
Diffstat (limited to 'server')
-rw-r--r--server/templates/server/approve_doc.html7
-rw-r--r--server/templates/server/approve_user.html7
-rw-r--r--server/templates/server/data_request.html7
-rw-r--r--server/templates/server/doc_create.html7
-rw-r--r--server/templates/server/doc_list.html93
-rw-r--r--server/templates/server/doc_type.html86
-rw-r--r--server/templates/server/index.html5
-rw-r--r--server/templates/server/upload_doc.html7
-rw-r--r--server/templates/server/user_list.html47
9 files changed, 107 insertions, 159 deletions
diff --git a/server/templates/server/approve_doc.html b/server/templates/server/approve_doc.html
index c4bdca4..42f4436 100644
--- a/server/templates/server/approve_doc.html
+++ b/server/templates/server/approve_doc.html
@@ -1,11 +1,10 @@
-{% extends 'registration/base.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin - Approva Documento{% endblock %}
-{% block nav %}
- <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+{% block breadcrumb %}
<a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
- <a href="{% url 'docapprove'%}" class="breadcrumb hide-on-med-and-down">Approva Documento</a>
+ <a class="breadcrumb hide-on-med-and-down">Approva Documento</a>
{% endblock %}
{% block content %}
diff --git a/server/templates/server/approve_user.html b/server/templates/server/approve_user.html
index 09afee9..288b4f9 100644
--- a/server/templates/server/approve_user.html
+++ b/server/templates/server/approve_user.html
@@ -1,11 +1,10 @@
-{% extends 'registration/base.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin - Approva Utente{% endblock %}
-{% block nav %}
- <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+{% block breadcrumb %}
<a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
- <a href="{% url 'uapprove'%}" class="breadcrumb hide-on-med-and-down">Approva Utente</a>
+ <a class="breadcrumb hide-on-med-and-down">Approva Utente</a>
{% endblock %}
{% block content %}
diff --git a/server/templates/server/data_request.html b/server/templates/server/data_request.html
index 8b0ed7c..1f65ff1 100644
--- a/server/templates/server/data_request.html
+++ b/server/templates/server/data_request.html
@@ -1,11 +1,10 @@
-{% extends 'registration/base.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin - Richiesta dati{% endblock %}
-{% block nav %}
- <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+{% block breadcrumb %}
<a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
- <a href="{% url 'request'%}" class="breadcrumb hide-on-med-and-down">Richiesta dati</a>
+ <a class="breadcrumb hide-on-med-and-down">Richiesta dati</a>
{% endblock %}
{% block content %}
diff --git a/server/templates/server/doc_create.html b/server/templates/server/doc_create.html
index b078bc5..a9877a3 100644
--- a/server/templates/server/doc_create.html
+++ b/server/templates/server/doc_create.html
@@ -1,12 +1,11 @@
-{% extends 'registration/base.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin - Crea Tipo{% endblock %}
-{% block nav %}
- <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+{% 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">Tipo Doc</a>
- <a href="#!" class="breadcrumb hide-on-med-and-down">Crea Tipo</a>
+ <a class="breadcrumb hide-on-med-and-down">Crea Tipo</a>
{% endblock %}
{% block content %}
diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html
index 2bdc6c5..b9f1b1b 100644
--- a/server/templates/server/doc_list.html
+++ b/server/templates/server/doc_list.html
@@ -1,53 +1,34 @@
-{% extends 'registration/base_custom.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin - Documenti{% endblock %}
-{% block nav %}
- <nav class="nav-extended">
- <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 'doclist' %}" class="breadcrumb hide-on-med-and-down">Documenti</a>
- <ul class="right">
- {% if user.is_staff or perms.client.staff %}
- <li><a href="{% url 'server' %}">Pannello Admin</a></li>
- {% endif %}
- {% if user.is_authenticated %}
- <li><a href="{% url 'personal' %}">{{ user.username }}</a></li>
- {% endif %}
- {% if user.username != "" %}
- <li>
- <a href="{% url 'logout' %}"><i class="material-icons">exit_to_app</i></a>
- </li>
- {% else %}
- <li><a href="{% url 'signup' %}">Registrazione</a></li>
- <li><a href="{% url 'login' %}">Login</a></li>
- {% endif %}
- </ul>
- </div>
- <div class="nav-wrapper red lighten-1">
- <ul>
- <li>
- <input id="select-all" type="checkbox" class="filled-in"/>
- <label for="select-all">
- <a class="tooltipped" data-position="top" data-tooltip="(De)Seleziona tutti" onclick=""><i class="material-icons">select_all</i>
- </label>
- </a>
- </li>
- <li><a class="tooltipped modal-trigger" href="#modal2" data-position="top" data-tooltip="Archivia selezionati"><i class="material-icons">archive</i></a></li>
- <li><a class="tooltipped" data-position="top" data-tooltip="Dearchivia selezionati" Onclick="send('unarchive')"><i class="material-icons">unarchive</i></a></li>
- <li><a class="tooltipped modal-trigger" href="#modal3" data-position="top" data-tooltip="Scarica selezionati" Onclick="send('download')"><i class="material-icons">file_download</i></a></li>
- {% if settings.DEBUG %}
- <li><a class="tooltipped" data-position="top" data-tooltip="Approva selezionati" Onclick="send('approve')"><i class="material-icons left">check</i>DEBUG</a></li>
- <li><a class="tooltipped" data-position="top" data-tooltip="Elimina selezionati" Onclick="send('delete')"><i class="material-icons left">delete</i>DEBUG</a></li>
- {% endif %}
- </ul>
- <ul class="right">
- <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>
- </div>
- </nav>
+{% block breadcrumb %}
+ <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
+ <a class="breadcrumb hide-on-med-and-down">Documenti</a>
+{% endblock %}
+{% block toolbar %}
+ <div class="nav-wrapper red lighten-1">
+ <ul>
+ <li>
+ <input id="select-all" type="checkbox" class="filled-in"/>
+ <label for="select-all">
+ <a class="tooltipped" data-position="top" data-tooltip="(De)Seleziona tutti" onclick=""><i class="material-icons">select_all</i>
+ </label>
+ </a>
+ </li>
+ <li><a class="tooltipped modal-trigger" href="#modal2" data-position="top" data-tooltip="Archivia selezionati"><i class="material-icons">archive</i></a></li>
+ <li><a class="tooltipped" data-position="top" data-tooltip="Dearchivia selezionati" Onclick="send('unarchive')"><i class="material-icons">unarchive</i></a></li>
+ <li><a class="tooltipped modal-trigger" href="#modal3" data-position="top" data-tooltip="Scarica selezionati" Onclick="send('download')"><i class="material-icons">file_download</i></a></li>
+ {% if settings.DEBUG %}
+ <li><a class="tooltipped" data-position="top" data-tooltip="Approva selezionati" Onclick="send('approve')"><i class="material-icons left">check</i>DEBUG</a></li>
+ <li><a class="tooltipped" data-position="top" data-tooltip="Elimina selezionati" Onclick="send('delete')"><i class="material-icons left">delete</i>DEBUG</a></li>
+ {% endif %}
+ </ul>
+ <ul class="right">
+ <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>
+ </div>
{% endblock %}
{% block content %}
@@ -73,6 +54,9 @@
<div class="determinate" style="width: 0%"></div>
</div>
<p id="progress_text"></p>
+ <div id="modal_close_button" class="modal-footer" hidden>
+ <a onclick="resetModal()" class="modal-close waves-effect waves-green btn-flat">Chiudi</a>
+ </div>
</div>
</div>
@@ -469,8 +453,9 @@
{%block script%}
$(document).ready(function(){
$('.collapsible').collapsible();
- $('.tooltipped').tooltip();
- $('.modal').modal();
+ $('#modal1').modal();
+ $('#modal2').modal();
+ $('#modal3').modal({"dismissible": false});
$('.datepicker').datepicker(options);
{% if error %}
M.toast({html: '{{ error_text}}', classes: 'orange'})
@@ -482,6 +467,13 @@ $(document).ready(function(){
{% endif %}
});
+function resetModal() {
+ $('#modal3').modal('close');
+ document.getElementById('progress_bar').className = "indeterminate";
+ document.getElementById("modal_close_button").hidden = true;
+ document.getElementById('progress_text').innerHTML = "";
+}
+
$('.chips').chips();
$('#chips_type').chips({
placeholder: 'Tipo',
@@ -552,7 +544,8 @@ function update() {
if (data[2]) {
bar.className = "indeterminate";
url = '{% url "progress" %}' + '?job=' + '{{task_id}}' + '&download=true';
- box.innerHTML = "Il download dovrebbe partire automaticamente. Nel caso non succedesse cliccare il seguente <a id='downloadLink' href=" + url + ">link</a><br>Clicca lo sfondo per chiudere la finestra";
+ box.innerHTML = "Il download dovrebbe partire automaticamente. Nel caso non succedesse cliccare il seguente <a id='downloadLink' href=" + url + ">link</a>";
+ document.getElementById("modal_close_button").hidden = false;
document.getElementById('downloadLink').click();
} else {
bar.style.width = "100%";
diff --git a/server/templates/server/doc_type.html b/server/templates/server/doc_type.html
index 01db1be..f621e07 100644
--- a/server/templates/server/doc_type.html
+++ b/server/templates/server/doc_type.html
@@ -1,58 +1,39 @@
-{% extends 'registration/base_custom.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin - Tipo Documenti{% endblock %}
-{% block nav %}
- <nav class="nav-extended">
- <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 ref="{% url 'doctype' %}" class="breadcrumb hide-on-med-and-down">Tipo Doc</a>
- <ul class="right">
- {% if user.is_staff or perms.client.staff %}
- <li><a href="{% url 'server' %}">Pannello Admin</a></li>
- {% endif %}
- {% if user.is_authenticated %}
- <li><a href="{% url 'personal' %}">{{ user.username }}</a></li>
- {% endif %}
- {% if user.username != "" %}
- <li>
- <a href="{% url 'logout' %}"><i class="material-icons">exit_to_app</i></a>
- </li>
- {% else %}
- <li><a href="{% url 'signup' %}">Registrazione</a></li>
- <li><a href="{% url 'login' %}">Login</a></li>
- {% endif %}
- </ul>
- </div>
- <div class="nav-wrapper red lighten-1">
- <ul>
- <li>
- <input id="select-all" type="checkbox" class="filled-in"/>
- <label for="select-all">
- <a class="tooltipped" data-position="top" data-tooltip="(De)Seleziona tutti" onclick=""><i class="material-icons">select_all</i>
- </label>
- </a>
- </li>
- <li><a class="tooltipped" data-position="top" data-tooltip="Mostra selezionati" onclick="send('show')"><i class="material-icons">visibility</i></a></li>
- <li><a class="tooltipped" data-position="top" data-tooltip="Nascondi selezionati" Onclick="send('hide')"><i class="material-icons">visibility_off</i></a></li>
- <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 class="hide-on-med-and-down">
- <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>
- </div>
- </form>
- </li>
- <li class="hide-on-med-and-down"><a class="tooltipped" data-position="top" data-tooltip="Pulisci filtri" Onclick="send('clear')"><i class="material-icons">clear</i></a></li>
- <li class="hide-on-med-and-down"><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>
- <li class="hide-on-large-only"><a class='dropdown-trigger' href='#' data-target='dropdown1'><i class="material-icons">filter_list</i></a></li>
- </ul>
- </div>
- </nav>
+{% 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>
+{% endblock %}
+{% block toolbar %}
+ <div class="nav-wrapper red lighten-1">
+ <ul>
+ <li>
+ <input id="select-all" type="checkbox" class="filled-in"/>
+ <label for="select-all">
+ <a class="tooltipped" data-position="top" data-tooltip="(De)Seleziona tutti" onclick=""><i class="material-icons">select_all</i>
+ </label>
+ </a>
+ </li>
+ <li><a class="tooltipped" data-position="top" data-tooltip="Mostra selezionati" onclick="send('show')"><i class="material-icons">visibility</i></a></li>
+ <li><a class="tooltipped" data-position="top" data-tooltip="Nascondi selezionati" Onclick="send('hide')"><i class="material-icons">visibility_off</i></a></li>
+ <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 class="hide-on-med-and-down">
+ <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>
+ </div>
+ </form>
+ </li>
+ <li class="hide-on-med-and-down"><a class="tooltipped" data-position="top" data-tooltip="Pulisci filtri" Onclick="send('clear')"><i class="material-icons">clear</i></a></li>
+ <li class="hide-on-med-and-down"><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>
+ <li class="hide-on-large-only"><a class='dropdown-trigger' href='#' data-target='dropdown1'><i class="material-icons">filter_list</i></a></li>
+ </ul>
+ </div>
<ul id='dropdown1' class='dropdown-content'>
<li><a Onclick="send('clear')"><i class="material-icons">clear</i>Pulisci</a></li>
<li><a href="#modal1" data-target="modal1" class="modal-trigger"><i class="material-icons">filter_list</i>Filtri</a></li>
@@ -224,7 +205,6 @@
{%block script%}
$(document).ready(function(){
$('.collapsible').collapsible();
- $('.tooltipped').tooltip();
$('.modal').modal();
$('.dropdown-trigger').dropdown({constantWidth: false});
{% if error %}
diff --git a/server/templates/server/index.html b/server/templates/server/index.html
index 83be995..f2a2242 100644
--- a/server/templates/server/index.html
+++ b/server/templates/server/index.html
@@ -1,9 +1,8 @@
-{% extends 'registration/base.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin{% endblock %}
-{% block nav %}
- <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+{% block breadcrumb %}
<a href="#!" class="breadcrumb hide-on-med-and-down">Admin</a>
{% endblock %}
diff --git a/server/templates/server/upload_doc.html b/server/templates/server/upload_doc.html
index 3650cd8..b29e2ae 100644
--- a/server/templates/server/upload_doc.html
+++ b/server/templates/server/upload_doc.html
@@ -1,11 +1,10 @@
-{% extends 'registration/base.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin - Carica documento{% endblock %}
-{% block nav %}
- <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+{% block breadcrumb %}
<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>
+ <a class="breadcrumb hide-on-med-and-down">Carica Documento</a>
{% endblock %}
{% block content %}
diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html
index 54b7b77..0537ab0 100644
--- a/server/templates/server/user_list.html
+++ b/server/templates/server/user_list.html
@@ -1,39 +1,20 @@
-{% extends 'registration/base_custom.html' %}
+{% extends 'registration/base_admin.html' %}
{% block title %}Admin - Lista Utenti{% endblock %}
-{% block nav %}
- <nav class="nav-extended">
- <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="#!" class="breadcrumb hide-on-med-and-down">Lista Utenti</a>
- <ul class="right">
- {% if user.is_staff or perms.client.staff %}
- <li><a href="{% url 'server' %}">Pannello Admin</a></li>
- {% endif %}
- {% if user.is_authenticated %}
- <li><a href="{% url 'personal' %}">{{ user.username }}</a></li>
- {% endif %}
- {% if user.username != "" %}
- <li>
- <a href="{% url 'logout' %}"><i class="material-icons">exit_to_app</i></a>
- </li>
- {% else %}
- <li><a href="{% url 'signup' %}">Registrazione</a></li>
- <li><a href="{% url 'login' %}">Login</a></li>
- {% endif %}
- </ul>
- </div>
- <div class="nav-wrapper red lighten-1">
- <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>
- </div>
- </form>
- </div>
- </nav>
+{% block breadcrumb %}
+ <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
+ <a class="breadcrumb hide-on-med-and-down">Lista Utenti</a>
+{% endblock %}
+{% block toolbar %}
+ <div class="nav-wrapper red lighten-1">
+ <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>
+ </div>
+ </form>
+ </div>
{% endblock %}
{% block content %}