documento.welcome.lista.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {% if ElencoDocumenti %}
  2. <table class='table table-striped table-hover'>
  3. <thead class='thead-dark'>
  4. <tr>
  5. <th scope='col'><input type='checkbox' class='form-check-input' value='0' name='selezione'></th>
  6. <th scope='col'>Vedi</th>
  7. <th scope='col'>Utente associato</th>
  8. <th scope='col'>Documento</th>
  9. <th scope='col'>Descrizione</th>
  10. <th scope='col'>Inserimento</th>
  11. {% if admin.edit_documento %} <th scope='col'>Cancella</th> {% endif %}
  12. </tr>
  13. </thead>
  14. <tbody>
  15. {% for documento in ElencoDocumenti %}
  16. <tr>
  17. <td><input type='checkbox' class='form-check-input' value='{{ documento.id }}' name='selezione'></td>
  18. <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>
  19. <td> {{ documento.utente.nome }} </td>
  20. <td> {{ documento.documento }}<br>{{ documento.storage }} </td>
  21. <td> {{ documento.descrizione }} </td>
  22. <td> {{ documento.dataupload | date:'d/m/Y' }} </td>
  23. {% if admin.edit_documento %}
  24. <td><button type='button' class='btn btn-secondary' data-bs-toggle='modal' data-bs-target='#ConfirmDeleteModal{{ documento.id }}' value='{{ documento.id }}'>Elimina</button></td>
  25. {% endif %}
  26. </tr>
  27. {% if admin.edit_documento %}
  28. <!-- Modal -->
  29. <div class="modal fade" id="ConfirmDeleteModal{{ documento.id }}" tabindex="-1" role="dialog" aria-labelledby="ConfirmDeleteLabel{{ document.id }}" aria-hidden="true">
  30. <div class="modal-dialog" role="document">
  31. <div class="modal-content">
  32. <div class="modal-header">
  33. <h5 class="modal-title" id="ConfirmDeleteLabel">Conferma Cancellazione</h5>
  34. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Chiudi">
  35. <span aria-hidden="true">&times;</span>
  36. </button>
  37. </div>
  38. <div class="modal-body">
  39. Confermi la cancellazione di {{ documento.documento }}?<br>
  40. La cancellazione del documento è definitiva,immediata e non recuperabile.
  41. </div>
  42. <div class="modal-footer">
  43. <form name='ConfirmDeleteModal' method='POST'>
  44. {% csrf_token %}
  45. <button type="submit" name="DeleteDocument" value='{{ documento.id }}' class="btn btn-primary">Cancella Documento</button>
  46. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Chiudi/Annulla</button>
  47. </form>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <!-- end modal -->
  53. {% endif %}
  54. {% endfor %}
  55. </tbody>
  56. </table>
  57. {% endif %}