2
0

Alias.Edit.ori 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {% extends 'base.html' %}
  2. {% block headersupplement %}
  3. <script>
  4. function updatemailfrom() {
  5. var randInt = Math.floor(Math.random()*100000000);
  6. $('#mailfrom').val(' {{utenteautorizzato.mail }}'+randInt);
  7. }
  8. </script>
  9. {% endblock %}
  10. {% block top %}
  11. <p>
  12. utente che sta effettuando gli aggiornamenti: {{ utenteautorizzato.mail }}@{{ utenteautorizzato.domain.nome }}
  13. </p>
  14. {% if user %}
  15. <p>
  16. si stanno effettuando aggiornamenti sull'alias: {{ alias.mailfrom }}@{{ alias.domain.nome }}
  17. </p>
  18. {% endif %}
  19. {% endblock %}
  20. {% block body %}
  21. <div>Pannello Controllo alias - gestione</div>
  22. <div><br></div>
  23. <form name='aliasedit' method='post'>
  24. {% csrf_token %}
  25. <div class='row form-group'>
  26. <div class='col'>
  27. <label for='mailfrom'>Alias Mail From</label>
  28. <input type='text' class='form-control' id='mailfrom' name='mailfrom' placeholder='Mail From' value='{{ formalias.mailfrom.value }}' {% if formalias.locked.value %}readonly{% endif %}>
  29. </div>
  30. <div class='col'>
  31. <label for='domain_name'>Dominio</label>
  32. <input type='text' class='form-control' id='domain_name' name='domain_name' value='{{ alias.domain.nome }}' readonly>
  33. <input type='hidden' name='domain' value={{ formalias.domain.value }}>
  34. </div>
  35. </div>
  36. <div class='col'>
  37. <label for='mailfrom_generator'>-</label><br>
  38. <button type='button' class='btn btn-primary' id='mailfrom_generator' onclick="updatemailfrom()">Casuale</button>
  39. </div>
  40. <div class='form-group'>
  41. <label for='mailto'>Email di destinazione</label>
  42. <input type='text' class='form-control' id='mailto' name="mailto" value='{{ formalias.mailto.value }}' {% if formalias.locked.value %}readonly{% endif %} placeholder='{{ utenteautorizzato.mail }}@{{ utenteautorizzato.domain.nome }}'>
  43. </div>
  44. <div class='form-group'>
  45. <label for='nota'>Note e appunti</label>
  46. <textarea class='form-control' rows='3' id='nota' name='nota' placeholder='note e appunti' >{{ formalias.nota.value }}</textarea>
  47. </div>
  48. <div class='form-group'>
  49. {% if 'ALIASLOCKED' in securitylist %}
  50. <label for='locked' class='form-check-label' for='locked'>Alias Bloccato:</label>
  51. <input type='checkbox' class='form-check-input' id='locked' name='locked'
  52. {% if formalias.locked.value %} checked {% endif %}>
  53. {% endif %}
  54. <label for='enabled' class='form-check-label' for='enabled'>Alias Attivo: </label>
  55. <input type='checkbox' class='form-check-input' id='enabled' name='enabled'
  56. {% if formalias.enabled.value %} checked {% endif %}
  57. {% if formalias.locked.value %} disabled {% endif %}>
  58. {% if 'ALIASTOBEDELETED' in securitylist %}
  59. <label for='tobedeleted' class="form-check-label" for='tobedeleted'>Account da eliminare: </label>
  60. <input type='checkbox' class='form-check-input' id='tobedeleted' name='tobedeleted'
  61. {% if formalias.tobedeleted.value %} checked {% endif %}
  62. {% if formalias.locked.value %} disabled {% endif %}>
  63. {% endif %}
  64. </div>
  65. <div>
  66. {% if formalias.errors %}
  67. <p>Rilevati Errori, impossibile proseguire.</p>
  68. {% for f in formalias %}
  69. {% for e in f.errors %}
  70. <div class="alter alter-danger">
  71. <strong>{{f.label|escape }}: {{ e|escape }}</strong>
  72. </div>
  73. {% endfor %}
  74. {% endfor %}
  75. {% for e in formalias.non_field_errors %}
  76. <div class="alter alter-danger">
  77. <strong>{{ e|escape }}</strong>
  78. </div>
  79. {% endfor %}
  80. {% endif %}
  81. </div>
  82. <div><br></div>
  83. <div class=' form-group btn-group' role='group' aria-label='conferme'>
  84. <button type='submit' class='btn btn-primary'>Conferma</button>
  85. <button type='reset' class='btn btn-secondary'>Reset</button>
  86. <button type='submit' class='btn btn-secondary' name="Ritorno">Ritorno (Senza salvare)</button>
  87. </div>
  88. </form>
  89. </div>
  90. {% endblock %}