mailbox-templates.twig 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. {% extends 'edit.twig' %}
  2. {% block inner_content %}
  3. {% if result %}
  4. <hr>
  5. <div id="medit" class="tab-pane fade show active" role="tabpanel" aria-labelledby="mailbox-edit">
  6. <form class="form-horizontal" data-id="editmailbox_template" role="form" method="post">
  7. <input type="hidden" value="default" name="sender_acl">
  8. <input type="hidden" value="0" name="force_pw_update">
  9. <input type="hidden" value="0" name="sogo_access">
  10. <input type="hidden" value="0" name="protocol_access">
  11. <div class="row mb-4">
  12. <label class="control-label col-sm-2" for="template">{{ lang.mailbox.template }}</label>
  13. <div class="col-sm-10">
  14. <div class="input-group mb-3">
  15. <input type="text" name="template" class="form-control" aria-label="Text input with dropdown button" value="{{ template.template }}" />
  16. </div>
  17. </div>
  18. </div>
  19. <div class="row mb-2">
  20. <label class="control-label col-sm-2">{{ lang.add.tags }}</label>
  21. <div class="col-sm-10">
  22. <div class="form-control tag-box">
  23. <input id="tags" type="text" class="tag-input">
  24. <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span>
  25. <input type="hidden" value='{{ template.attributes.tags|json_encode }}' name="tags" class="tag-values" />
  26. </div>
  27. </div>
  28. </div>
  29. <div class="row mb-2">
  30. <label class="control-label col-sm-2" for="quota">{{ lang.edit.quota_mb }}</label>
  31. <div class="col-sm-10">
  32. <input type="number" name="quota" class="w-100 form-control" min="0" value="{{ template.attributes.quota / 1048576 }}">
  33. <small class="text-muted">0 = ∞</small>
  34. </div>
  35. </div>
  36. <div class="row mb-2">
  37. <label class="control-label col-sm-2">{{ lang.user.tag_handling }}</label>
  38. <div class="col-sm-10">
  39. <div class="btn-group">
  40. <input type="radio" class="btn-check" name="tagged_mail_handler" id="tagged_mail_handler_subfolder" autocomplete="off" value="subfolder" {% if template.attributes.tagged_mail_handler == 'subfolder' %}checked{% endif %}>
  41. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="tagged_mail_handler_subfolder">{{ lang.user.tag_in_subfolder }}</label>
  42. <input type="radio" class="btn-check" name="tagged_mail_handler" id="tagged_mail_handler_subject" autocomplete="off" value="subject" {% if template.attributes.tagged_mail_handler == 'subject' %}checked{% endif %}>
  43. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="tagged_mail_handler_subject">{{ lang.user.tag_in_subject }}</label>
  44. <input type="radio" class="btn-check" name="tagged_mail_handler" id="tagged_mail_handler_none" autocomplete="off" value="none" {% if template.attributes.tagged_mail_handler == 'none' %}checked{% endif %}>
  45. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="tagged_mail_handler_none">{{ lang.user.tag_in_none }}</label>
  46. </div>
  47. <p class="text-muted"><small>{{ lang.user.tag_help_explain|raw }}</small></p>
  48. <p class="text-muted"><small>{{ lang.user.tag_help_example|raw }}</small></p>
  49. </div>
  50. </div>
  51. <div class="row mb-2">
  52. <label class="control-label col-sm-2">{{ lang.user.quarantine_notification }}</label>
  53. <div class="col-sm-10">
  54. <div class="btn-group">
  55. <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_never" autocomplete="off" value="never" {% if template.attributes.quarantine_notification == 'never' %}checked{% endif %}>
  56. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_never">{{ lang.user.never }}</label>
  57. <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_hourly" autocomplete="off" value="hourly" {% if template.attributes.quarantine_notification == 'hourly' %}checked{% endif %}>
  58. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_hourly">{{ lang.user.hourly }}</label>
  59. <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_daily" autocomplete="off" value="daily" {% if template.attributes.quarantine_notification == 'daily' %}checked{% endif %}>
  60. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_daily">{{ lang.user.daily }}</label>
  61. <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_weekly" autocomplete="off" value="weekly" {% if template.attributes.quarantine_notification == 'weekly' %}checked{% endif %}>
  62. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_notification_weekly">{{ lang.user.weekly }}</label>
  63. </div>
  64. <p class="text-muted"><small>{{ lang.user.quarantine_notification_info }}</small></p>
  65. </div>
  66. </div>
  67. <div class="row mb-2">
  68. <label class="control-label col-sm-2">{{ lang.user.quarantine_category }}</label>
  69. <div class="col-sm-10">
  70. <div class="btn-group">
  71. <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_reject" autocomplete="off" value="reject" {% if template.attributes.quarantine_category == 'reject' %}checked{% endif %}>
  72. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_category_reject">{{ lang.user.q_reject }}</label>
  73. <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_add_header" autocomplete="off" value="add_header" {% if template.attributes.quarantine_category == 'add_header' %}checked{% endif %}>
  74. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_category_add_header">{{ lang.user.q_add_header }}</label>
  75. <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_all" autocomplete="off" value="all" {% if template.attributes.quarantine_category == 'all' %}checked{% endif %}>
  76. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="quarantine_category_all">{{ lang.user.q_all }}</label>
  77. </div>
  78. <p class="text-muted"><small>{{ lang.user.quarantine_category_info }}</small></p>
  79. </div>
  80. </div>
  81. <div class="row mb-4">
  82. <label class="control-label col-sm-2" for="sender_acl">{{ lang.user.tls_policy }}</label>
  83. <div class="col-sm-10">
  84. <div class="btn-group">
  85. <input type="checkbox" class="btn-check" name="tls_enforce_in" id="tls_enforce_in" autocomplete="off" value="1" {% if template.attributes.tls_enforce_in == '1' %}checked{% endif %}>
  86. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="tls_enforce_in">{{ lang.user.tls_enforce_in }}</label>
  87. <input type="checkbox" class="btn-check" name="tls_enforce_out" id="tls_enforce_out" autocomplete="off" value="1" {% if template.attributes.tls_enforce_out == '1' %}checked{% endif %}>
  88. <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-light" for="tls_enforce_out">{{ lang.user.tls_enforce_out }}</label>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="row mb-2">
  93. <label class="control-label col-sm-2" for="protocol_access">{{ lang.edit.allowed_protocols }}</label>
  94. <div class="col-sm-10">
  95. <select name="protocol_access" multiple class="form-control">
  96. <option value="imap"{% if template.attributes.imap_access == '1' %} selected{% endif %}>IMAP</option>
  97. <option value="pop3"{% if template.attributes.pop3_access == '1' %} selected{% endif %}>POP3</option>
  98. <option value="smtp"{% if template.attributes.smtp_access == '1' %} selected{% endif %}>SMTP</option>
  99. <option value="sieve"{% if template.attributes.sieve_access == '1' %} selected{% endif %}>Sieve</option>
  100. </select>
  101. </div>
  102. </div>
  103. <div class="row mb-4">
  104. <label class="control-label col-sm-2">ACL</label>
  105. <div class="col-sm-10">
  106. <select id="template_user_acl" name="acl" size="10" multiple class="form-control">
  107. <option value="spam_alias" {% if template.attributes.acl_spam_alias == '1' %} selected{% endif %}>{{ lang.acl["spam_alias"] }}</option>
  108. <option value="tls_policy" {% if template.attributes.acl_tls_policy == '1' %} selected{% endif %}>{{ lang.acl["tls_policy"] }}</option>
  109. <option value="spam_score" {% if template.attributes.acl_spam_score == '1' %} selected{% endif %}>{{ lang.acl["spam_score"] }}</option>
  110. <option value="spam_policy" {% if template.attributes.acl_spam_policy == '1' %} selected{% endif %}>{{ lang.acl["spam_policy"] }}</option>
  111. <option value="delimiter_action" {% if template.attributes.acl_delimiter_action == '1' %} selected{% endif %}>{{ lang.acl["delimiter_action"] }}</option>
  112. <option value="syncjobs" {% if template.attributes.acl_syncjobs == '1' %} selected{% endif %}>{{ lang.acl["syncjobs"] }}</option>
  113. <option value="eas_reset" {% if template.attributes.acl_eas_reset == '1' %} selected{% endif %}>{{ lang.acl["eas_reset"] }}</option>
  114. <option value="sogo_profile_reset" {% if template.attributes.acl_sogo_profile_reset == '1' %} selected{% endif %}>{{ lang.acl["sogo_profile_reset"] }}</option>
  115. <option value="pushover" {% if template.attributes.acl_pushover == '1' %} selected{% endif %}>{{ lang.acl["pushover"] }}</option>
  116. <option value="quarantine" {% if template.attributes.acl_quarantine == '1' %} selected{% endif %}>{{ lang.acl["quarantine"] }}</option>
  117. <option value="quarantine_attachments" {% if template.attributes.acl_quarantine_attachments == '1' %} selected{% endif %}>{{ lang.acl["quarantine_attachments"] }}</option>
  118. <option value="quarantine_notification" {% if template.attributes.acl_quarantine_notification == '1' %} selected{% endif %}>{{ lang.acl["quarantine_notification"] }}</option>
  119. <option value="quarantine_category" {% if template.attributes.acl_quarantine_category == '1' %} selected{% endif %}>{{ lang.acl["quarantine_category"] }}</option>
  120. <option value="app_passwds" {% if template.attributes.acl_app_passwds == '1' %} selected{% endif %}>{{ lang.acl["app_passwds"] }}</option>
  121. <option value="pw_reset" {% if template.attributes.acl_pw_reset == '1' %} selected{% endif %}>{{ lang.acl["pw_reset"] }}</option>
  122. </select>
  123. </div>
  124. </div>
  125. <div class="row mb-4">
  126. <label class="control-label col-sm-2">{{ lang.acl.ratelimit }}</label>
  127. <div class="col-sm-10">
  128. <div class="input-group">
  129. <input name="rl_value" type="number" autocomplete="off" value="{{ template.attributes.rl_value }}" class="form-control mb-2" placeholder="{{ lang.ratelimit.disabled }}">
  130. <select name="rl_frame" class="form-control">
  131. {% include 'mailbox/rl-frame.twig' %}
  132. </select>
  133. </div>
  134. <p class="text-muted mt-1">{{ lang.edit.mbox_rl_info }}</p>
  135. </div>
  136. </div>
  137. <hr>
  138. <div class="row my-2">
  139. <div class="offset-sm-2 col-sm-10">
  140. <select name="active" class="form-control">
  141. <option value="1"{% if template.attributes.active == '1' %} selected{% endif %}>{{ lang.edit.active }}</option>
  142. <option value="2"{% if template.attributes.active == '2' %} selected{% endif %}>{{ lang.edit.disable_login }}</option>
  143. <option value="0"{% if template.attributes.active == '0' %} selected{% endif %}>{{ lang.edit.inactive }}</option>
  144. </select>
  145. </div>
  146. </div>
  147. <div class="row">
  148. <div class="offset-sm-2 col-sm-10">
  149. <div class="form-check">
  150. <label><input type="checkbox" class="form-check-input" value="1" name="force_pw_update"{% if template.attributes.force_pw_update == '1' %} checked{% endif %}> {{ lang.edit.force_pw_update }}</label>
  151. <small class="text-muted">{{ lang.edit.force_pw_update_info|format(ui_texts.main_name) }}</small>
  152. </div>
  153. </div>
  154. </div>
  155. {% if not skip_sogo %}
  156. <div class="row">
  157. <div class="offset-sm-2 col-sm-10">
  158. <div class="form-check">
  159. <label><input type="checkbox" class="form-check-input" value="1" name="sogo_access"{% if template.attributes.sogo_access == '1' %} checked{% endif %}> {{ lang.edit.sogo_access }}</label>
  160. <small class="text-muted">{{ lang.edit.sogo_access_info }}</small>
  161. </div>
  162. </div>
  163. </div>
  164. {% endif %}
  165. <div class="row my-2">
  166. <div class="offset-sm-2 col-sm-10">
  167. <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="editmailbox_template" data-item="{{ template.id }}" data-api-url='edit/mailbox/template' data-api-attr='{}' href="#">{{ lang.edit.save }}</button>
  168. </div>
  169. </div>
  170. </form>
  171. </div>
  172. {% else %}
  173. {{ parent() }}
  174. {% endif %}
  175. {% endblock %}