utente.welcome.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. {% extends 'base.html' %}
  2. {% block headersupplement %}
  3. <script language="JavaScript">
  4. function toggleCSV(source) {
  5. checkboxes = document.getElementsByName('MultipleCSVSelect');
  6. for(var i=0, n=checkboxes.length;i<n;i++) {
  7. checkboxes[i].checked = source.checked;
  8. }
  9. }
  10. {% if listaok or listanotok %}
  11. $(window).on('load', function() {
  12. $('#StatoDocumentiCaricatiId').modal('show');
  13. });
  14. {% endif %}
  15. </script>
  16. {% endblock %}
  17. {% block body %}
  18. <form name="inputUtenti" method="POST">
  19. {% csrf_token %}
  20. <div class='form-control'>
  21. {% if "UTENTE.CREA" in permesso %}
  22. <button type='submit' class="btn btn-primary" name='scelta' value='Nuovo Dipendente'>Nuovo Dipendente</button>
  23. <button type='button' class="btn btn-primary" name='TastoCaricaIndici' data-bs-toggle='modal' data-bs-target='#CaricaIndiceModal'>Carica Lista Nuovi Dipendenti</button>
  24. <button type='submit' class="btn btn-primary" name='ScaricaCSVSelezionati' value="Scarica CSV Selezionati"/>Scarica CSV Selezionati</button>
  25. {% endif %}
  26. <button type='submit' class="btn btn-primary" name="indietro" value="Indietro">Indietro</button>
  27. </div>
  28. <div class='form-control'>
  29. Numero di dipendenti selezionati {{ numeroRecordAttuali }} su un totale di {{ numeroRecordAzienda }}.
  30. </div>
  31. <table class='table table-striped table-hover'>
  32. <thead class='thead-dark'>
  33. <tr>
  34. {% if "UTENTE.CREA" in permesso %}<th scope='col'>*</th>{% endif %}
  35. <th scope='col' style='white-space: nowrap; width: 1%;'>Dipendente&nbsp;
  36. <button name='utDW' type="submit" class="btn btn-outline-primary btn-sm">&#x2193;</button>
  37. <button name='utUP' type="submit" class="btn btn-outline-primary btn-sm">&#x2191;</button></th>
  38. <th scope='col' style='white-space: nowrap; width: 1%;'>Codice Fiscale</th>
  39. <th scope='col' style='white-space: nowrap; width: 1%;'>Sede&nbsp;
  40. <button name='seDW' type="submit" class="btn btn-outline-primary btn-sm">&#x2193;</button>
  41. <button name="seUP" type="submit" class="btn btn-outline-primary btn-sm">&#x2191;</button></th>
  42. <th scope='col'>Data di Nascita</th>
  43. <th scope='col'>Luogo di Nascita</th>
  44. {% if "DOCUMENTO" in permesso %}
  45. <th scope='col'>documenti</th>
  46. {% endif %}
  47. {% if "UTENTE.EDIT" in permesso %}
  48. <th scope='col'>Mail</th>
  49. <th scope='col'>Pin</th>
  50. {% endif %}
  51. <th scope='col'>Inserimento</th>
  52. <th scope='col'><input class="form-check-input" type="checkbox" id="selectCSVAll" name="selectCSVAll" value='0' onClick="toggleCSV(this);"/></th>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. {% for uu in utenti %}
  57. <tr>
  58. {% if "UTENTE.EDIT" in permesso %}
  59. <td> <button type='submit' class='btn btn-primary ' name='scelta' value='{{ uu.id }}'>Edit</button></td>
  60. {% endif %}
  61. <td {% if not uu.enabled %} class="text-decoration-line-through" {% endif %} > {{ uu.nome }} </td>
  62. <td> {{ uu.codicefiscale }} </td>
  63. <td> {{ uu.sede.nome }} </td>
  64. <td> {{ uu.datanascita|date:'d/m/Y' }} </td>
  65. <td> {{ uu.luogonascita }} </td>
  66. {% if "DOCUMENTO" in permesso %}
  67. <td>{% if uu.documenti %}<a href='{% url 'documento:welcome' uu.id %}'>Download</a>{% else %} N/A {% endif %}</td>
  68. {% endif %}
  69. {% if "UTENTE.EDIT" in permesso %}
  70. <td> {{ uu.mail }} </td>
  71. <td> {{ uu.pin }} </td>
  72. {% endif %}
  73. <td> {{ uu.inserimento|date:'d/m/Y' }} </td>
  74. {% if "DOCUMENTO" in permesso %}
  75. <td>
  76. <input class="form-check-input" type="checkbox" id="MultipleCSVSelect-{{ uu.id }}" name="MultipleCSVSelect" value='{{ uu.id }}'>
  77. </td>
  78. {% endif %}
  79. </tr>
  80. {% endfor %}
  81. </tbody>
  82. </table>
  83. </form>
  84. {% if "UTENTE.CREA" in permesso %}
  85. <!-- Modal -->
  86. <div class="modal fade" id="CaricaIndiceModal" tabindex="-1" role="dialog" aria-labelledby="CaricaIndiceLabel" aria-hidden="false">
  87. <div class="modal-dialog" role="document">
  88. <div class="modal-content">
  89. <form name='formCaricaIndice' method='POST' enctype='multipart/form-data'>
  90. {% csrf_token %}
  91. <div class="modal-header">
  92. <h5 class="modal-title" id="CaricaIndiceLabel">Carica Elenco Dipendenti</h5>
  93. <span aria-hidden="true">&times;</span>
  94. </button>
  95. </div>
  96. <div class="modal-body">
  97. Caricamento Lista Dipendenti<br>
  98. Formato File CSV - obbligatorio <br>
  99. Separatore: ';' - prima riga: "Nome colonna".</br>
  100. <table class='table table-striped table-hover'>
  101. <tbody>
  102. <tr>
  103. <td>Nome Cognome</td>
  104. <td>Codice Fiscale</td>
  105. <td>Data Nascita</td>
  106. <td>Luogo Nascita</td>
  107. <td>email</td>
  108. <td>Sede Indentificativo</td>
  109. </tr>
  110. </tbody>
  111. </table><br>
  112. <label for='indice'>Elenco Dipendenti:&nbsp;</label>
  113. <input type='file' name='indice' id='indice' value='' accept='text/csv'>
  114. </div>
  115. <div class="modal-footer">
  116. <button type="submit" name="CaricaIndice" value='Carica Lista' class="btn btn-primary">Carica Lista Dipendenti</button>
  117. <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Annulla</button>
  118. </div>
  119. </form>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <!-- end modal -->
  125. {% endif %}
  126. {% endblock %}
  127. {% block bodybottom %}
  128. {% include "documento.stato.html" %}
  129. {% endblock %}