|
|
@@ -12,38 +12,45 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- tasti per il ritorno e altre funzioni generiche -->
|
|
|
- <div class='card'>
|
|
|
- <div class='card-body'>
|
|
|
- <h5 class="card-title">Upload Indici e Documenti</h5>
|
|
|
- <form name='upload' method='post' enctype='multipart/form-data'>
|
|
|
- {% csrf_token %}
|
|
|
- <div class='form-group form-inline'>
|
|
|
- <label for='indice'>Indice Utenti: </label>
|
|
|
- <input type='file' class="btn btn-primary" name='indice' id='indice' value='{{ uf.indice }}' accept='text/csv'>
|
|
|
- <label for='allegati'>Allegati:</label>
|
|
|
- <input type='file' class="btn btn-primary" name='allegati' id='allegati' value='{{ uf.allegati }}' accept='application/pdf' multiple>
|
|
|
- </div>
|
|
|
- <div><br></div>
|
|
|
- <div class='form-check'>
|
|
|
- <label for='pertutti' class='form-check-label'>Documento in comune (un singolo documento a disposizione di tutti gli utenti)</label>
|
|
|
- <input type='checkbox' class="form-check-input" name='pertutti' id='pertutti'>
|
|
|
- </div>
|
|
|
- <div><br></div>
|
|
|
- <div class='form-group form-inline'>
|
|
|
- <label for='descrizione'>Descrizione: </label>
|
|
|
- <input type='text' name='descrizione' id='descrizione' value='' maxlength='120' size='80'>
|
|
|
- </div>
|
|
|
- <div><br></div>
|
|
|
- <div class='form-group form-inline'>
|
|
|
- <input type='submit' class="btn btn-primary" name='Ritorna' value='Ritorna'>
|
|
|
- <input type='submit' class="btn btn-primary" value='Carica Nuovi Documenti'>
|
|
|
- <button type='button' class='btn btn-primary' data-bs-toggle='modal' data-bs-target='#ConfirmDocumentDeleteModal'>Elimina Vecchi Documenti</button></td>
|
|
|
+ {% if admin.crea_documento %}
|
|
|
+ <div class='card'>
|
|
|
+ <div class='card-body'>
|
|
|
+ <h5 class="card-title">Upload Indici e Documenti</h5>
|
|
|
+ <form name='upload' method='post' enctype='multipart/form-data'>
|
|
|
+ {% csrf_token %}
|
|
|
+ <div class='form-group form-inline'>
|
|
|
+ <label for='indice'>Indice Utenti: </label>
|
|
|
+ <input type='file' class="btn btn-primary" name='indice' id='indice' value='{{ uf.indice }}' accept='text/csv'>
|
|
|
+ <label for='allegati'>Allegati:</label>
|
|
|
+ <input type='file' class="btn btn-primary" name='allegati' id='allegati' value='{{ uf.allegati }}' accept='application/pdf' multiple>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div><br></div>
|
|
|
+
|
|
|
+ <div class='form-check'>
|
|
|
+ <label for='pertutti' class='form-check-label'>Documento in comune (un singolo documento a disposizione di tutti gli utenti)</label>
|
|
|
+ <input type='checkbox' class="form-check-input" name='pertutti' id='pertutti'>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div><br></div>
|
|
|
+
|
|
|
+ <div class='form-group form-inline'>
|
|
|
+ <label for='descrizione'>Descrizione: </label>
|
|
|
+ <input type='text' name='descrizione' id='descrizione' value='' maxlength='120' size='80'>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div><br></div>
|
|
|
+
|
|
|
+ <div class='form-group form-inline'>
|
|
|
+ <input type='submit' class="btn btn-primary" name='Ritorna' value='Ritorna'>
|
|
|
+ <input type='submit' class="btn btn-primary" value='Carica Nuovi Documenti'>
|
|
|
+ <button type='button' class='btn btn-primary' data-bs-toggle='modal' data-bs-target='#ConfirmDocumentDeleteModal'>Elimina Vecchi Documenti</button></td>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
<!-- fine barra tasti ritorno e utilita' -->
|
|
|
-
|
|
|
+ {% endif %}
|
|
|
{% endblock %}
|
|
|
|
|
|
{% block body %}
|
|
|
@@ -64,7 +71,7 @@
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
- {% if ElencoDocumentiPerAzienda %}
|
|
|
+ {% if ElencoDocumenti %}
|
|
|
<table class='table table-striped table-hover'>
|
|
|
<thead class='thead-dark'>
|
|
|
<tr>
|
|
|
@@ -74,11 +81,11 @@
|
|
|
<th scope='col'>Documento</th>
|
|
|
<th scope='col'>Descrizione</th>
|
|
|
<th scope='col'>Inserimento</th>
|
|
|
- <th scope='col'>Cancella</th>
|
|
|
+ {% if admin.edit_documento %} <th scope='col'>Cancella</th> {% endif %}
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- {% for documento in ElencoDocumentiPerAzienda %}
|
|
|
+ {% for documento in ElencoDocumenti %}
|
|
|
<tr>
|
|
|
<td><input type='checkbox' class='form-check-input' value='{{ documento.id }}' name='selezione'></td>
|
|
|
<td> <button type='button' class='btn btn-primary btn-block btn-lg mb-2 active' onclick="window.open('{% url "documento:finalize" documento.id documento.utente.id%}')">Vedi</button></td>
|
|
|
@@ -86,34 +93,37 @@
|
|
|
<td> {{ documento.documento }}<br>{{ documento.storage }} </td>
|
|
|
<td> {{ documento.descrizione }} </td>
|
|
|
<td> {{ documento.dataupload | date:'d/m/Y' }} </td>
|
|
|
- <td><button type='button' class='btn btn-secondary' data-bs-toggle='modal' data-bs-target='#ConfirmDeleteModal{{ documento.id }}' value='{{ documento.id }}'>Elimina</button></td>
|
|
|
+ {% if admin.edit_documento %}
|
|
|
+ <td><button type='button' class='btn btn-secondary' data-bs-toggle='modal' data-bs-target='#ConfirmDeleteModal{{ documento.id }}' value='{{ documento.id }}'>Elimina</button></td>
|
|
|
+ {% endif %}
|
|
|
</tr>
|
|
|
- <!-- Modal -->
|
|
|
- <div class="modal fade" id="ConfirmDeleteModal{{ documento.id }}" tabindex="-1" role="dialog" aria-labelledby="ConfirmDeleteLabel{{ document.id }}" aria-hidden="true">
|
|
|
- <div class="modal-dialog" role="document">
|
|
|
- <div class="modal-content">
|
|
|
- <div class="modal-header">
|
|
|
- <h5 class="modal-title" id="ConfirmDeleteLabel">Conferma Cancellazione</h5>
|
|
|
- <button type="button" class="close" data-bs-dismiss="modal" aria-label="Chiudi">
|
|
|
- <span aria-hidden="true">×</span>
|
|
|
- </button>
|
|
|
+ {% if admin.edit_documento %}
|
|
|
+ <!-- Modal -->
|
|
|
+ <div class="modal fade" id="ConfirmDeleteModal{{ documento.id }}" tabindex="-1" role="dialog" aria-labelledby="ConfirmDeleteLabel{{ document.id }}" aria-hidden="true">
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title" id="ConfirmDeleteLabel">Conferma Cancellazione</h5>
|
|
|
+ <button type="button" class="close" data-bs-dismiss="modal" aria-label="Chiudi">
|
|
|
+ <span aria-hidden="true">×</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ Confermi la cancellazione di {{ documento.documento }}?<br>
|
|
|
+ La cancellazione del documento è definitiva,immediata e non recuperabile.
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <form name='ConfirmDeleteModal' method='POST'>
|
|
|
+ {% csrf_token %}
|
|
|
+ <button type="submit" name="DeleteDocument" value='{{ documento.id }}' class="btn btn-primary">Cancella</button>
|
|
|
+ <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Chiudi</button>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="modal-body">
|
|
|
- Confermi la cancellazione di {{ documento.documento }}?<br>
|
|
|
- La cancellazione del documento è definitiva,immediata e non recuperabile.
|
|
|
- </div>
|
|
|
- <div class="modal-footer">
|
|
|
- <form name='ConfirmDeleteModal' method='POST'>
|
|
|
- {% csrf_token %}
|
|
|
- <button type="submit" name="DeleteDocument" value='{{ documento.id }}' class="btn btn-primary">Annulla</button>
|
|
|
- </form>
|
|
|
- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Chiudi</button>
|
|
|
-
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- end modal -->
|
|
|
+ </div>
|
|
|
+ <!-- end modal -->
|
|
|
+ {% endif %}
|
|
|
{% endfor %}
|
|
|
</tbody>
|
|
|
</table>
|
|
|
@@ -125,6 +135,7 @@
|
|
|
<br>
|
|
|
</div>
|
|
|
|
|
|
+ {% if admin.edit_documento %}
|
|
|
<!-- Modal -->
|
|
|
<div class="modal fade" id="ConfirmDocumentDeleteModal" tabindex="-1" role="dialog" aria-labelledby="ConfirmDocumentDeleteLabel{{ document.id }}" aria-hidden="true">
|
|
|
<div class="modal-dialog" role="document">
|
|
|
@@ -153,7 +164,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- end modal -->
|
|
|
-
|
|
|
+ {% endif %}
|
|
|
<div><br></div>
|
|
|
|
|
|
|