diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2020-06-20 23:32:55 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2020-06-20 23:32:55 +0200 |
commit | 26fb6c43a27c014383127d0e4b3fb29f8b923690 (patch) | |
tree | 05fd542c342cf12cac72b49e5b4b44db7411d91a /client/templates | |
parent | Document custom field (diff) | |
download | scout-subs-26fb6c43a27c014383127d0e4b3fb29f8b923690.tar.gz scout-subs-26fb6c43a27c014383127d0e4b3fb29f8b923690.zip |
Doc, doctypes, users all done
Diffstat (limited to '')
-rw-r--r-- | client/templates/client/doc_create.html | 8 | ||||
-rw-r--r-- | client/templates/client/doc_edit.html | 86 | ||||
-rw-r--r-- | client/templates/client/index.html | 99 |
3 files changed, 167 insertions, 26 deletions
diff --git a/client/templates/client/doc_create.html b/client/templates/client/doc_create.html index 550eb54..39deb2d 100644 --- a/client/templates/client/doc_create.html +++ b/client/templates/client/doc_create.html @@ -1,6 +1,6 @@ {% extends 'registration/base.html' %} -{% block title %}Admin - Modifica Tipo{% endblock %} +{% block title %}Crea Documento{% endblock %} {% block nav %} <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a> @@ -46,14 +46,14 @@ {% if personal_data %} <div class="row"> <div class="col s12"> - <a style="pointer-events: none; cursor: default;" class="btn red lighten-1"> Il documento conterrá le informazioni personali, prego verificare che siano corrette e aggiornate</a> + <a style="pointer-events: none; cursor: default;" class="btn red lighten-1"> Il documento conterrà le informazioni personali, prego verificare che siano corrette e aggiornate</a> </div> </div> {% endif %} {% if medical_data %} <div class="row"> <div class="col s12"> - <a style="pointer-events: none; cursor: default;" class="btn red lighten-1"> Il documento conterrá le informazioni mediche, prego verificare che siano corrette e aggiornate</a> + <a style="pointer-events: none; cursor: default;" class="btn red lighten-1"> Il documento conterrà le informazioni mediche, prego verificare che siano corrette e aggiornate</a> </div> </div> {% endif %} @@ -68,7 +68,7 @@ {% for key in keys %} <div class="row"> <div class="input-field col s12"> - <input value="{{key.1}}" name="{{key.0.id}}" id="{{key.0.id}}" type="text" class="validate"> + <input value="{{key.1}}" name="{{key.0.id}}" id="{{key.0.id}}" type="text"> <label for="{{key.0.id}}">{{key.0.key}}</label> </div> </div> diff --git a/client/templates/client/doc_edit.html b/client/templates/client/doc_edit.html new file mode 100644 index 0000000..8cd5a98 --- /dev/null +++ b/client/templates/client/doc_edit.html @@ -0,0 +1,86 @@ +{% extends 'registration/base.html' %} + +{% block title %}Modifica documento{% endblock %} + +{% block nav %} + <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a> + <a href="#!" class="breadcrumb hide-on-med-and-down">Modifica Documento</a> +{% endblock %} + +{% block content %} +<div class="row"> + <div class="col l8 offset-l2 s12"> + <div class="card-panel"> + <div class="row"> + <form id="form" action="{% url 'edit'%}" method="post" class="col s12"> + {% csrf_token %} + <input type="hidden" name="doc" value="{{doc.id}}"> + <div class="row"> + <div class="input-field col s12"> + <select> + <option disabled selected>{{doc.document_type.name}}</option> + </select> + <label>Documento</label> + </div> + </div> + {% if personal_data %} + <div class="row"> + <div class="col s12"> + <a style="pointer-events: none; cursor: default;" class="btn red lighten-1"> Il documento conterrà le informazioni personali, prego verificare che siano corrette e aggiornate</a> + </div> + </div> + {% endif %} + {% if medical_data %} + <div class="row"> + <div class="col s12"> + <a style="pointer-events: none; cursor: default;" class="btn red lighten-1"> Il documento conterrà le informazioni mediche, prego verificare che siano corrette e aggiornate</a> + </div> + </div> + {% endif %} + {% if custom_message %} + <div class="row"> + <div class="col s12"> + <a style="pointer-events: none; cursor: default;" class="btn red lighten-1">{{custom_message_text}}</a> + </div> + </div> + {% endif %} + {% if custom_data %} + {% for key in keys %} + <div class="row"> + <div class="input-field col s12"> + <input value="{{key.1}}" name="{{key.0.id}}" id="{{key.0.id}}" type="text"> + <label for="{{key.0.id}}">{{key.0.key}}</label> + </div> + </div> + {% endfor %} + {% endif %} + <div class="row"> + <div class="col s12"> + <br> + <a class="btn waves-effect waves-light" onclick="window.history.back();" > + <i class="material-icons left">navigate_before</i>Indietro + </a> + <a class="btn waves-effect waves-light" onclick="send('save')" >Salva + <i class="material-icons right">save</i> + </a> + </div> + </div> + </form> + </div> + </div> + </div> +</div> +{% endblock %} + +{% block script %} +$(document).ready(function(){ + $('select').formSelect(); + {% if error %} + M.toast({html: '{{ error_text}}', classes: 'orange'}) + {% endif %} + }); +function send(id) { + var form = document.getElementById('form') + form.submit() +} +{% endblock %}
\ No newline at end of file diff --git a/client/templates/client/index.html b/client/templates/client/index.html index 96179b2..733f62f 100644 --- a/client/templates/client/index.html +++ b/client/templates/client/index.html @@ -13,6 +13,12 @@ <p>Usa questo bottone per creare un nuovo documento</p> </div> </div> + +<form id="form" method="post" action="{% url 'index'%}"> + {% csrf_token %} + <input type="hidden" name="action" id="action"> +</form> + {% if user.is_authenticated %} {% if user.is_staff or perms.client.approved %} {% if not empty %} @@ -24,40 +30,83 @@ <i class="material-icons">timelapse</i> {% elif doc.0.status == "ok" %} <i class="material-icons">check</i> + {% elif doc.0.status == "autosign" %} + <i class="material-icons">assignment_turned_in</i> {% endif %} {{doc.0.document_type.name}} - <span class="badge" data-badge-caption="">{{doc.0.compilation_date}}</span></div> + <span class="badge" data-badge-caption="">{{doc.0.compilation_date}}</span> </div> <div class="collapsible-body"><span> {% if doc.0.status == "wait" %} - <a class="waves-effect waves-light btn red lighten-1" href="{%url 'server'%}"><i class="material-icons left">file_download</i> Scarica documento per approvazione</a> - <a class="waves-effect waves-light btn red lighten-1" href="{%url 'server'%}"><i class="material-icons left">delete</i> Elimina documento</a> - <a class="waves-effect waves-light btn red lighten-1" href="{%url 'server'%}"><i class="material-icons left">edit</i> Modifica documento</a> + <a class="waves-effect waves-light btn red lighten-1" onclick="send('f{{doc.0.id}}')"><i class="material-icons left">file_download</i> Scarica documento per approvazione</a> + <a class="waves-effect waves-light btn red lighten-1" onclick="send('d{{doc.0.id}}')"><i class="material-icons left">delete</i> Elimina documento</a> + <a class="waves-effect waves-light btn red lighten-1" onclick="send('e{{doc.0.id}}')"><i class="material-icons left">edit</i> Modifica documento</a> + <br> + <br> + {% elif doc.0.status == "autosign" %} + <a class="waves-effect waves-light btn red lighten-1" onclick="send('a{{doc.0.id}}')"><i class="material-icons left">check</i>Approva documento</a> + <a class="waves-effect waves-light btn red lighten-1" onclick="send('d{{doc.0.id}}')"><i class="material-icons left">delete</i> Elimina documento</a> + <a class="waves-effect waves-light btn red lighten-1" onclick="send('e{{doc.0.id}}')"><i class="material-icons left">edit</i> Modifica documento</a> <br> <br> {% endif %} + <ul class="collapsible"> {% if doc.0.document_type.personal_data %} - <i class="material-icons">person</i> + <li> + <div class="collapsible-header"> + <i class="material-icons">person</i>Dati personali + </div> + <div class="collapsible-body"><span> + <table class="striped"> + <tbody> + {% for field in doc.2 %} + <tr> + <td>{{field}}</td> + </tr> + {% endfor %} + </tbody> + </table> + </span></div> + </li> {% endif %} {% if doc.0.document_type.medical_data %} - <i class="material-icons">healing</i> + <li> + <div class="collapsible-header"> + <i class="material-icons">healing</i>Dati medici + </div> + <div class="collapsible-body"><span> + <table class="striped"> + <tbody> + {% for field in doc.3 %} + <tr> + <td>{{field}}</td> + </tr> + {% endfor %} + </tbody> + </table> + </span></div> + </li> {% endif %} {% if doc.0.document_type.custom_data %} - <i class="material-icons">add_circle_outline</i> - {% endif %} - {% if doc.0.document_type.custom_data %} - <br> - <table class="striped"> - <tbody> - {% for key in doc.1 %} - <tr> - <td>{{key.key}}</td> - <td>{{key.value}}</td> - </tr> - {% endfor %} - </tbody> - </table> + <li> + <div class="collapsible-header"> + <i class="material-icons">add_circle_outline</i>Dati aggiuntivi + </div> + <div class="collapsible-body"><span> + <table class="striped"> + <tbody> + {% for key in doc.1 %} + <tr> + <td>{{key.key}}</td> + <td>{{key.value}}</td> + </tr> + {% endfor %} + </tbody> + </table> + </span></div> + </li> {% endif %} + </ul> </span></div> </li> {% endfor %} @@ -73,7 +122,7 @@ <div class="col l4 offset-l4 m8 offset-m2 s12"> <div class="card"> <div class="card-content"> - <p>Il tuo utente non e` ancora stato approvato.</p> + <p>Il tuo utente non è ancora stato approvato.</p> </div> <div class="card-action"> <a href="{% url 'approve' %}">Come farsi approvare l'utente</a> @@ -87,7 +136,7 @@ <div class="col l4 offset-l4 m8 offset-m2 s12"> <div class="card"> <div class="card-content"> - <p>Se hai gia` un account clicca login in alto a destra. Altrimenti clicca registrazione</p> + <p>Se hai già un account clicca login in alto a destra. Altrimenti clicca registrazione</p> </div> </div> </div> @@ -108,4 +157,10 @@ $('*').click(function(event) { $('.tap-target').tapTarget('close'); } }); +function send(id) { + var form = document.getElementById('form') + var action = document.getElementById('action') + action.setAttribute('value', id); + form.submit() +} {% endblock %}
\ No newline at end of file |