diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2020-07-26 21:28:06 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2020-07-26 21:28:06 +0200 |
commit | e1deaaf4a239db742cea2d1e6c4f48a9656d8a0f (patch) | |
tree | c3bbe11e47616f702f4c56734430005a5fc04504 /server/templates | |
parent | use webp to save images (diff) | |
download | scout-subs-e1deaaf4a239db742cea2d1e6c4f48a9656d8a0f.tar.gz scout-subs-e1deaaf4a239db742cea2d1e6c4f48a9656d8a0f.zip |
bug fixes and visual improvements
Diffstat (limited to '')
-rw-r--r-- | server/templates/server/doc_list.html | 8 | ||||
-rw-r--r-- | server/templates/server/doc_type.html | 31 | ||||
-rw-r--r-- | server/templates/server/index.html | 12 | ||||
-rw-r--r-- | server/templates/server/user_list.html | 31 |
4 files changed, 63 insertions, 19 deletions
diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html index e5be168..fb201d5 100644 --- a/server/templates/server/doc_list.html +++ b/server/templates/server/doc_list.html @@ -124,7 +124,7 @@ <li> <div class="collapsible-header"> <label> - <input name={{doc.0.id}} type="checkbox" class="filled-in"/> + <input name={{doc.0.id}} type="checkbox" class="filled-in allselect"/> <span></span> </label> {% if doc.0.status == "wait" %} @@ -165,6 +165,8 @@ <i class="material-icons">send</i>{{doc.0.compilation_date}} </div> </li> + </ul> + <ul class="collapsible"> {% if doc.0.document_type.personal_data %} <li> <div class="collapsible-header"> @@ -517,11 +519,11 @@ function send(id) { $('#select-all').click(function(event) { if(this.checked) { // Iterate each checkbox - $(':checkbox').each(function() { + $('.allselect').each(function() { this.checked = true; }); } else { - $(':checkbox').each(function() { + $('.allselect').each(function() { this.checked = false; }); } diff --git a/server/templates/server/doc_type.html b/server/templates/server/doc_type.html index e95cef1..82adf83 100644 --- a/server/templates/server/doc_type.html +++ b/server/templates/server/doc_type.html @@ -44,7 +44,6 @@ <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> @@ -57,6 +56,7 @@ <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> + <li><a href="#modal2" data-target="modal2" class="modal-trigger"><i class="material-icons">search</i>Cerca</a></li> </ul> {% endblock %} @@ -118,19 +118,22 @@ </label> </div> </div> - <div class="row hide-on-large-only"> - <div class="col s12"> - <div class="input-field"> - <input autocomplete="off" id="searchs" type="text" onkeyup="filterResultsSmall()" required> - <label for="searchs"><i class="material-icons">search</i></label> - </div> - </div> - </div> </div> <div class="modal-footer"> <a href="#!" onclick="send('filter')" class="modal-close waves-effect waves-green btn-flat">Applica</a> </div> </div> +<div id="modal2" class="modal"> + <div class="modal-content"> + <div class="input-field"> + <input autocomplete="off" id="searchs" type="text" onkeyup="filterResultsSmall()" required> + <label for="searchs"><i class="material-icons">search</i></label> + </div> + </div> + <div class="modal-footer"> + <a href="#!" class="modal-close waves-effect waves-green btn-flat">Chiudi</a> + </div> +</div> <input type="hidden" name="action" id="action"> <ul class="collapsible"> @@ -138,7 +141,7 @@ <li> <div class="collapsible-header list"> <label> - <input name={{doctype.0.id}} type="checkbox" class="filled-in"/> + <input name={{doctype.0.id}} type="checkbox" class="filled-in allselect"/> <span></span> </label> {% if not doctype.0.enabled %} @@ -179,6 +182,9 @@ </div> </li> {% endif %} + </ul> + {% if doctype.0.custom_data or doctype.0.custom_message %} + <ul class="collapsible"> {% if doctype.0.custom_data %} <li> <div class="collapsible-header"> @@ -208,6 +214,7 @@ </li> {% endif %} </ul> + {% endif %} </span></div> </li> {% endfor %} @@ -241,11 +248,11 @@ function send(id) { $('#select-all').click(function(event) { if(this.checked) { // Iterate each checkbox - $(':checkbox').each(function() { + $('.allselect').each(function() { this.checked = true; }); } else { - $(':checkbox').each(function() { + $('.allselect').each(function() { this.checked = false; }); } diff --git a/server/templates/server/index.html b/server/templates/server/index.html index 2676c3a..a049f4f 100644 --- a/server/templates/server/index.html +++ b/server/templates/server/index.html @@ -60,9 +60,21 @@ </ul> </div> <div class="card-action"> + <div class="hide-on-small-only"> <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> + </div> + + <div class="hide-on-med-and-up"> + <a class="col s12 waves-effect waves-light btn red lighten-1" href="{% url 'doctype' %}">Lista tipo doc</a> + <br> + <br> + <a class="col s12 waves-effect waves-light btn red lighten-1" href="{% url 'doclist' %}">Lista documenti</a> + <br> + <br> + <a class="col s12 waves-effect waves-light btn red lighten-1" href="{% url 'docapprove' %}">Approva documento</a> + </div> </div> </div> </div> diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html index 8ee2008..1010bd4 100644 --- a/server/templates/server/user_list.html +++ b/server/templates/server/user_list.html @@ -30,7 +30,6 @@ <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> </div> @@ -51,6 +50,30 @@ {{user.0.first_name}} {{user.0.last_name}} </div> <div class="collapsible-body"><span> + {% if not user.0.is_staff %} + <div id="modal{{user.0.id}}" class="modal"> + <div class="modal-content"> + <h4>Attenzione</h4> + <p> + Sei sicuro di volerlere deapprovare l'utente {{user.0.first_name}} {{user.0.last_name}}?<br> + Una volta deapprovato l'utente non potrà più creare documenti e per essere riapprovato dovrà essere usato il codice di approvazione. + </p> + </div> + <div class="modal-footer"> + <a style="color:red" href="#!" class="modal-close waves-effect waves-green btn-flat">Annulla</a> + <a onclick="send('d{{user.0.id}}')" class="modal-close waves-effect waves-green btn-flat">Deapprova</a> + </div> + </div> + <a class="waves-effect waves-light btn red lighten-1 modal-trigger" href="#modal{{user.0.id}}"><i class="material-icons left">remove_circle_outline</i>Deapprova utente</a> + <br><br> + {% endif %} + <ul class="collapsible"> + <li> + <div class="collapsible-header"> + <i class="material-icons">confirmation_number</i>U{{user.1.code}} + </div> + </li> + </ul> <ul class="collapsible"> <li> <div class="collapsible-header"> @@ -292,9 +315,9 @@ {% endblock %} {% block script %} -document.addEventListener('DOMContentLoaded', function() { - var elems = document.querySelectorAll('.collapsible'); - var instances = M.Collapsible.init(elems, {}); +$(document).ready(function(){ + $('.modal').modal(); + $('.collapsible').collapsible(); }); function send(id) { |