Преглед изворни кода

modifiche per consentire anche agli amministratori principali l'edit del proprio profilo

mauro пре 9 месеци
родитељ
комит
5f427df662

+ 5 - 5
amministratore/templates/amministratore.edit.amministratore.edit.html

@@ -17,24 +17,24 @@
     {% csrf_token %}
     <div class='form-group'>
       <label for="login">Login Amministratore</label>
-      <input type='text' class='form-control form-control-lg' name='login' id='login' value='{{ amministratore.login.value }}' {% if not "AMMINISTRATORE.EDITSELFLOGIN" in permesso %}readonly{% endif %}>
+      <input type='text' class='form-control form-control-lg' name='login' id='login' value='{{ amministratore.login.value }}' {% if not "AMMINISTRATORE.EDITSELFLOGIN" in permesso or "AMMINISTRATORE.EDIT" in permesso %}readonly{% endif %}>
     </div>
     <div class='form-group'>
       <label for="nome">Nome</label>
-      <input type='text' class='form-control form-control-lg' name='nome' id='nome' value='{{ amministratore.nome.value }}' {% if not "AMMINISTRATORE.EDITSELFNOME" in permesso %}readonly{% endif %}>
+      <input type='text' class='form-control form-control-lg' name='nome' id='nome' value='{{ amministratore.nome.value }}' {% if not "AMMINISTRATORE.EDITSELFNOME" in permesso or "AMMINISTRATORE.EDIT" in permesso %}readonly{% endif %}>
     </div>
     <div class='form-group'>
       <label for="mail">Email</label>
-      <input type='text' class='form-control form-control-lg' name='mail' id='mail' value='{{ amministratore.mail.value }}' {% if not "AMMINISTRATORE.EDITSELFMAIL" %}readonly{% endif %}>
+      <input type='text' class='form-control form-control-lg' name='mail' id='mail' value='{{ amministratore.mail.value }}' {% if not "AMMINISTRATORE.EDITSELFMAIL" or "AMMINISTRATORE.EDIT" in permesso %}readonly{% endif %}>
     </div>
     <div class='form-group'>
       <label for="pin">Pin/Password</label>
-      <input type='password' class='form-control form-control-lg' name='pin' id='pin' value='{{ amministratore.pin.value }}' {% if not "AMMINISTRATORE.EDITSELFPIN" in permesso %}readonly{% endif %}>
+      <input type='password' class='form-control form-control-lg' name='pin' id='pin' value='{{ amministratore.pin.value }}' {% if not "AMMINISTRATORE.EDITSELFPIN" in permesso or "AMMINISTRATORE.EDIT" in permesso %}readonly{% endif %}>
     </div>
     <p></p>
     <div class="btn-group">
       <br>
-      <input type='submit' name="AmministratoreUpdateButton" class="btn btn-primary" value='Aggiorna' {% if "AMMINISTRATORE.EDITSELF" in permesso %} disable {% endif %}>
+      <input type='submit' name="AmministratoreUpdateButton" class="btn btn-primary" value='Aggiorna' {% if "AMMINISTRATORE.EDITSELF" in permesso or "AMMINISTRATORE.EDIT" in permesso %} disable {% endif %}>
       <input type='submit' class="btn btn-primary" name="indietro" value="Indietro">
     </div>
   </form>

+ 3 - 2
azienda/templates/azienda.welcome.html

@@ -28,10 +28,11 @@
       {% if 'SEDE.EDIT' in permesso %}
       <button type='submit' class='btn btn-primary' name='parsede' value='{{ sede.id }}' {% if not sede.id %} disabled {% endif %}>Par.Sede</button>
       {% endif %}
-      {% if "AMMINISTRATORE.EDITSELF" in permesso %}
+    {% endif %}
+
+      {% if "AMMINISTRATORE.EDITSELF" in permesso or "AMMINISTRATORE.EDIT" in permesso %}
       <button type='submit' class='btn btn-primary' name='paramm' value='{{ admin.id }}'>Par.Amministratore</button>
       {% endif %}
-    {% endif %}
     {% if 'LOG.ALL' in permesso %}
     <button type='submit' class='btn btn-primary' name='logall'>Tutti i Log</button>
     {% endif %}