Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 1 | {% extends 'edit.twig' %} |
| 2 | |
| 3 | {% block inner_content %} |
| 4 | {% if result %} |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 5 | <div id="domain-content" class="responsive-tabs"> |
| 6 | <ul class="nav nav-tabs" role="tablist"> |
| 7 | <li role="presentation" class="nav-item"><button class="nav-link active" data-bs-toggle="tab" data-bs-target="#dedit">{{ lang.edit.domain }}</button></li> |
| 8 | <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dratelimit">{{ lang.edit.ratelimit }}</button></li> |
| 9 | <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dspamfilter">{{ lang.edit.spam_filter }}</button></li> |
| 10 | <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dqwbcc">{{ lang.edit.quota_warning_bcc }}</button></li> |
| 11 | <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dfooter">{{ lang.edit.domain_footer }}</button></li> |
| 12 | </ul> |
| 13 | <hr class="d-none d-md-block"> |
| 14 | <div class="tab-content"> |
| 15 | <div id="dedit" class="tab-pane fade show active" role="tabpanel" aria-labelledby="domain-edit"> |
| 16 | <div class="card mb-4"> |
| 17 | <div class="card-header d-flex d-md-none fs-5"> |
| 18 | <button class="btn flex-grow-1 text-start" data-bs-target="#collapse-tab-dedit" data-bs-toggle="collapse" aria-controls="collapse-tab-dedit"> |
| 19 | {{ lang.edit.domain }} <span class="badge bg-info table-lines"></span> |
| 20 | </button> |
| 21 | </div> |
| 22 | <div id="collapse-tab-dedit" class="card-body collapse show" data-bs-parent="#domain-content"> |
| 23 | <form data-id="editdomain" class="form-horizontal" role="form" method="post"> |
| 24 | <input type="hidden" value="0" name="active"> |
| 25 | <input type="hidden" value="0" name="backupmx"> |
| 26 | <input type="hidden" value="0" name="gal"> |
| 27 | <input type="hidden" value="0" name="relay_all_recipients"> |
| 28 | <input type="hidden" value="0" name="relay_unknown_only"> |
| 29 | <div class="row mb-2" data-acl="{{ acl.domain_desc }}"> |
| 30 | <label class="control-label col-sm-2" for="description">{{ lang.edit.description }}</label> |
| 31 | <div class="col-sm-10"> |
| 32 | <input type="text" class="form-control" name="description" value="{{ result.description }}"> |
| 33 | </div> |
| 34 | </div> |
| 35 | <div class="row mb-4"> |
| 36 | <label class="control-label col-sm-2">{{ lang.add.tags }}</label> |
| 37 | <div class="col-sm-10"> |
| 38 | <div class="form-control tag-box"> |
| 39 | {% for tag in domain_details.tags %} |
| 40 | <span data-action='delete_selected' data-item="{{ tag|url_encode }}" data-id="domain_tag_{{ tag }}" data-api-url='delete/domain/tag/{{ domain }}' class="badge bg-primary tag-badge btn-badge"> |
| 41 | <i class="bi bi-tag-fill"></i> |
| 42 | {{ tag }} |
| 43 | </span> |
| 44 | {% endfor %} |
| 45 | <input type="text" class="tag-input"> |
| 46 | <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span> |
| 47 | <input type="hidden" value="" name="tags" class="tag-values" /> |
| 48 | </div> |
| 49 | </div> |
| 50 | </div> |
| 51 | <div class="row mb-2"> |
| 52 | <label class="control-label col-sm-2" for="relayhost">{{ lang.edit.relayhost }}</label> |
| 53 | <div class="col-sm-10"> |
| 54 | <select data-acl="{{ acl.domain_relayhost }}" data-live-search="true" id="relayhost" name="relayhost" class="form-control"> |
| 55 | {% for rlyhost in rlyhosts %} |
| 56 | <option |
| 57 | style="{% if rlyhost.active != '1' %}background: #ff4136; color: #fff{% endif %}" |
| 58 | {% if result.relayhost == rlyhost.id %} selected{% endif %} |
| 59 | value="{{ rlyhost.id }}"> |
| 60 | ID {{ rlyhost.id }}: {{ rlyhost.hostname }} ({{ rlyhost.username }}) |
| 61 | </option> |
| 62 | {% endfor %} |
| 63 | <option value=""{% if not result.relayhost %} selected{% endif %}> |
| 64 | {{ lang.edit.none_inherit }} |
| 65 | </option> |
| 66 | </select> |
| 67 | </div> |
| 68 | </div> |
| 69 | {% if mailcow_cc_role == 'admin' %} |
| 70 | <div class="row mb-2"> |
| 71 | <label class="control-label col-sm-2" for="aliases">{{ lang.edit.max_aliases }}</label> |
| 72 | <div class="col-sm-10"> |
| 73 | <input type="number" class="form-control" name="aliases" value="{{ result.max_num_aliases_for_domain }}"> |
| 74 | </div> |
| 75 | </div> |
| 76 | <div class="row mb-2"> |
| 77 | <label class="control-label col-sm-2" for="mailboxes">{{ lang.edit.max_mailboxes }}</label> |
| 78 | <div class="col-sm-10"> |
| 79 | <input type="number" class="form-control" name="mailboxes" value="{{ result.max_num_mboxes_for_domain }}"> |
| 80 | </div> |
| 81 | </div> |
| 82 | <div class="row mb-2"> |
| 83 | <label class="control-label col-sm-2" for="defquota">{{ lang.edit.mailbox_quota_def }}</label> |
| 84 | <div class="col-sm-10"> |
| 85 | <input type="number" class="form-control" name="defquota" value="{{ (result.def_quota_for_mbox / 1048576) }}"> |
| 86 | </div> |
| 87 | </div> |
| 88 | <div class="row mb-2"> |
| 89 | <label class="control-label col-sm-2" for="maxquota">{{ lang.edit.max_quota }}</label> |
| 90 | <div class="col-sm-10"> |
| 91 | <input type="number" class="form-control" name="maxquota" value="{{ (result.max_quota_for_mbox / 1048576) }}"> |
| 92 | </div> |
| 93 | </div> |
| 94 | <div class="row mb-4"> |
| 95 | <label class="control-label col-sm-2" for="quota">{{ lang.edit.domain_quota }}</label> |
| 96 | <div class="col-sm-10"> |
| 97 | <input type="number" class="form-control" name="quota" value="{{ (result.max_quota_for_domain / 1048576) }}"> |
| 98 | </div> |
| 99 | </div> |
| 100 | <div class="row mb-2"> |
| 101 | <label class="control-label col-sm-2">{{ lang.edit.backup_mx_options }}</label> |
| 102 | <div class="col-sm-10"> |
| 103 | <div class="form-check"> |
| 104 | <label><input type="checkbox" class="form-check-input" value="1" name="backupmx"{% if result.backupmx == '1' %} checked{% endif %}> {{ lang.edit.relay_domain }}</label> |
| 105 | <br> |
| 106 | <label><input type="checkbox" class="form-check-input" value="1" name="relay_all_recipients"{% if result.relay_all_recipients == '1' %} checked{% endif %}> {{ lang.edit.relay_all }}</label> |
| 107 | <p>{{ lang.edit.relay_all_info|raw }}</p> |
| 108 | <label><input type="checkbox" class="form-check-input" value="1" name="relay_unknown_only"{% if result.relay_unknown_only == '1' %} checked{% endif %}> {{ lang.edit.relay_unknown_only }}</label> |
| 109 | <br> |
| 110 | <p>{{ lang.edit.relay_transport_info|raw }}</p> |
| 111 | <hr style="margin:25px 0px 0px 0px"> |
| 112 | </div> |
| 113 | </div> |
| 114 | </div> |
| 115 | {% endif %} |
| 116 | <div class="row"> |
| 117 | <div class="offset-sm-2 col-sm-10"> |
| 118 | <div class="form-check"> |
| 119 | <label><input type="checkbox" class="form-check-input" value="1" name="gal"{% if result.gal == '1' %} checked{% endif %}> {{ lang.edit.gal }}</label> |
| 120 | <small class="text-muted">{{ lang.edit.gal_info|raw }}</small> |
| 121 | </div> |
| 122 | </div> |
| 123 | </div> |
| 124 | <hr> |
| 125 | <div class="row mb-2"> |
| 126 | <div class="offset-sm-2 col-sm-10"> |
| 127 | <div class="form-check"> |
| 128 | <label><input type="checkbox" class="form-check-input" value="1" name="active"{% if result.active == '1' %} checked{% endif %}{% if mailcow_cc_role != 'admin' %} disabled{% endif %}> {{ lang.edit.active }}</label> |
| 129 | </div> |
| 130 | </div> |
| 131 | </div> |
| 132 | <div class="row mb-2"> |
| 133 | <div class="offset-sm-2 col-sm-10"> |
| 134 | <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="editdomain" data-item="{{ domain }}" data-api-url='edit/domain' data-api-attr='{}' href="#">{{ lang.admin.save }}</button> |
| 135 | </div> |
| 136 | </div> |
| 137 | <div class="row"> |
| 138 | <div class="offset-sm-2 col-sm-10"> |
| 139 | <small class="fst-italic d-block">{{ lang.edit.created_on }}: {{ result.created }}</small> |
| 140 | <small class="fst-italic d-block">{{ lang.edit.last_modified }}: {{ result.modified }}</small> |
| 141 | </div> |
| 142 | </div> |
| 143 | </form> |
| 144 | {% if dkim %} |
| 145 | <hr> |
| 146 | <div class="row"> |
| 147 | <div class="col-12 col-sm-2"> |
| 148 | <p>{{ lang.add.domain }}: <strong>{{ result.domain_name }}</strong> ({{ dkim.dkim_selector }}._domainkey)</p> |
| 149 | </div> |
| 150 | <div class="col-12 col-sm-10"> |
| 151 | <pre class="p-2">{{ dkim.dkim_txt }}</pre> |
| 152 | </div> |
| 153 | </div> |
| 154 | {% endif %} |
| 155 | </div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 156 | </div> |
| 157 | </div> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 158 | <div id="dratelimit" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-ratelimit"> |
| 159 | <div class="card mb-4"> |
| 160 | <div class="card-header d-flex d-md-none fs-5"> |
| 161 | <button class="btn flex-grow-1 text-start" data-bs-target="#collapse-tab-ratelimit" data-bs-toggle="collapse" aria-controls="collapse-tab-ratelimit"> |
| 162 | {{ lang.edit.ratelimit }} <span class="badge bg-info table-lines"></span> |
| 163 | </button> |
| 164 | </div> |
| 165 | <div id="collapse-tab-ratelimit" class="card-body collapse" data-bs-parent="#domain-content"> |
| 166 | <form data-id="domratelimit" class="well" method="post"> |
| 167 | <div class="row mb-2"> |
| 168 | <label class="control-label col-sm-2">{{ lang.edit.ratelimit }}</label> |
| 169 | <div class="col-sm-10"> |
| 170 | <div class="input-group"> |
| 171 | <input name="rl_value" type="number" value="{{ rl.value }}" autocomplete="off" class="form-control placeholder="{{ lang.ratelimit.disabled }}"> |
| 172 | <select name="rl_frame" class="form-control"> |
| 173 | {% include 'mailbox/rl-frame.twig' %} |
| 174 | </select> |
| 175 | </div> |
| 176 | </div> |
| 177 | </div> |
| 178 | <div class="row mb-2"> |
| 179 | <div class="offset-sm-2 col-sm-10"> |
| 180 | <button data-acl="{{ acl.ratelimit }}" class="btn btn-xs-lg d-block d-sm-inline btn-secondary" data-action="edit_selected" data-id="domratelimit" data-item="{{ domain }}" data-api-url='edit/rl-domain' data-api-attr='{}' href="#">{{ lang.admin.save }}</button> |
| 181 | </div> |
| 182 | </div> |
| 183 | </form> |
| 184 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 185 | </div> |
| 186 | </div> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 187 | <div id="dspamfilter" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-spamfilter"> |
| 188 | <div class="card mb-4"> |
| 189 | <div class="card-header d-flex d-md-none fs-5"> |
| 190 | <button class="btn flex-grow-1 text-start" data-bs-target="#collapse-tab-spamfilter" data-bs-toggle="collapse" aria-controls="collapse-tab-spamfilter"> |
| 191 | {{ lang.edit.spam_filter }} <span class="badge bg-info table-lines"></span> |
| 192 | </button> |
| 193 | </div> |
| 194 | <div id="collapse-tab-spamfilter" class="card-body collapse" data-bs-parent="#domain-content"> |
| 195 | <div class="row"> |
| 196 | <div class="col-sm-6"> |
| 197 | <h4>{{ lang.user.spamfilter_wl }}</h4> |
| 198 | <p>{{ lang.user.spamfilter_wl_desc|raw }}</p> |
| 199 | <form class="form-inline mb-4" data-id="add_wl_policy_domain"> |
| 200 | <div class="input-group" data-acl="{{ acl.spam_policy }}"> |
| 201 | <input type="text" class="form-control" name="object_from" placeholder="*@example.org" required> |
| 202 | <button class="btn btn-secondary" data-action="add_item" data-id="add_wl_policy_domain" data-api-url='add/domain-policy' data-api-attr='{"domain":"{{ domain }}","object_list":"wl"}' href="#">{{ lang.user.spamfilter_table_add }}</button> |
| 203 | </div> |
| 204 | </form> |
| 205 | <table id="wl_policy_domain_table" class="table table-striped dt-responsive w-100"></table> |
| 206 | <div class="mass-actions-user"> |
| 207 | <div class="btn-group" data-acl="{{ acl.spam_policy }}"> |
| 208 | <a class="btn btn-xs-half d-block d-sm-inline btn-sm btn-secondary" id="toggle_multi_select_all" data-id="policy_wl_domain" href="#"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</a> |
| 209 | <a class="btn btn-xs-half d-block d-sm-inline btn-sm btn-danger" data-action="delete_selected" data-id="policy_wl_domain" data-api-url='delete/domain-policy' href="#">{{ lang.mailbox.remove }}</a> |
| 210 | </div> |
| 211 | </div> |
| 212 | </div> |
| 213 | <div class="col-sm-6"> |
| 214 | <h4>{{ lang.user.spamfilter_bl }}</h4> |
| 215 | <p>{{ lang.user.spamfilter_bl_desc|raw }}</p> |
| 216 | <form class="form-inline mb-4" data-id="add_bl_policy_domain"> |
| 217 | <div class="input-group" data-acl="{{ acl.spam_policy }}"> |
| 218 | <input type="text" class="form-control" name="object_from" placeholder="*@example.org" required> |
| 219 | <button class="btn btn-secondary" data-action="add_item" data-id="add_bl_policy_domain" data-api-url='add/domain-policy' data-api-attr='{"domain":"{{ domain }}","object_list":"bl"}' href="#">{{ lang.user.spamfilter_table_add }}</button> |
| 220 | </div> |
| 221 | </form> |
| 222 | <table id="bl_policy_domain_table" class="table table-striped dt-responsive w-100"></table> |
| 223 | <div class="mass-actions-user"> |
| 224 | <div class="btn-group" data-acl="{{ acl.spam_policy }}"> |
| 225 | <a class="btn btn-xs-half d-block d-sm-inline btn-sm btn-secondary" id="toggle_multi_select_all" data-id="policy_bl_domain" href="#"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</a> |
| 226 | <a class="btn btn-xs-half d-block d-sm-inline btn-sm btn-danger" data-action="delete_selected" data-id="policy_bl_domain" data-api-url='delete/domain-policy' href="#">{{ lang.mailbox.remove }}</a></li> |
| 227 | </div> |
| 228 | </div> |
| 229 | </div> |
| 230 | </div> |
| 231 | </div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 232 | </div> |
| 233 | </div> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 234 | <div id="dqwbcc" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-qwbcc"> |
| 235 | <div class="card mb-4"> |
| 236 | <div class="card-header d-flex d-md-none fs-5"> |
| 237 | <button class="btn flex-grow-1 text-start" data-bs-target="#collapse-tab-qwbcc" data-bs-toggle="collapse" aria-controls="collapse-tab-qwbcc"> |
| 238 | {{ lang.edit.quota_warning_bcc }} <span class="badge bg-info table-lines"></span> |
| 239 | </button> |
| 240 | </div> |
| 241 | <div id="collapse-tab-qwbcc" class="card-body collapse" data-bs-parent="#domain-content"> |
| 242 | <div class="row"> |
| 243 | <div class="col-sm-12"> |
| 244 | <h4>{{ lang.edit.quota_warning_bcc }}</h4> |
| 245 | <p>{{ lang.edit.quota_warning_bcc_info|raw }}</p> |
| 246 | <form class="form-horizontal" data-id="quota_bcc"> |
| 247 | <input type="hidden" value="0" name="active"> |
| 248 | <div class="row mb-2"> |
| 249 | <label class="control-label col-sm-2" for="script_data">{{ lang.edit.target_address|raw }}:</label> |
| 250 | <div class="col-sm-10"> |
| 251 | <textarea spellcheck="false" autocorrect="off" autocapitalize="none" class="form-control" rows="10" id="bcc_rcpt" name="bcc_rcpt">{{ quota_notification_bcc.bcc_rcpts|join("\n") }}</textarea> |
| 252 | </div> |
| 253 | </div> |
| 254 | <div class="row mb-4"> |
| 255 | <div class="offset-sm-2 col-sm-10"> |
| 256 | <div class="form-check"> |
| 257 | <label><input type="checkbox" class="form-check-input" value="1" name="active"{% if quota_notification_bcc.active == '1' %} checked{% endif %}> {{ lang.edit.active }}</label> |
| 258 | </div> |
| 259 | </div> |
| 260 | </div> |
| 261 | <div class="row"> |
| 262 | <div class="offset-sm-2 col-sm-10"> |
| 263 | <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="quota_bcc" data-item="quota_bcc" data-api-url='edit/quota_notification_bcc' data-api-attr='{"domain":"{{ domain }}"}' href="#">{{ lang.edit.save }}</button> |
| 264 | </div> |
| 265 | </div> |
| 266 | </form> |
| 267 | </div> |
| 268 | </div> |
| 269 | </div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 270 | </div> |
| 271 | </div> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 272 | <div id="dfooter" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-footer"> |
| 273 | <div class="card mb-4"> |
| 274 | <div class="card-header d-flex d-md-none fs-5"> |
| 275 | <button class="btn flex-grow-1 text-start" data-bs-target="#collapse-tab-footer" data-bs-toggle="collapse" aria-controls="collapse-tab-footer"> |
| 276 | {{ lang.edit.domain_footer }} <span class="badge bg-info table-lines"></span> |
| 277 | </button> |
| 278 | </div> |
| 279 | <div id="collapse-tab-footer" class="card-body collapse" data-bs-parent="#domain-content"> |
| 280 | <div class="row"> |
| 281 | <div class="col-sm-12"> |
| 282 | <h4>{{ lang.edit.domain_footer }}</h4> |
| 283 | <p>{{ lang.edit.domain_footer_info|raw }}</p> |
| 284 | <pre>{{ lang.edit.domain_footer_info_vars.auth_user }} |
| 285 | {{ lang.edit.domain_footer_info_vars.from_user }} |
| 286 | {{ lang.edit.domain_footer_info_vars.from_name }} |
| 287 | {{ lang.edit.domain_footer_info_vars.from_addr }} |
| 288 | {{ lang.edit.domain_footer_info_vars.from_domain }}</pre> |
| 289 | <form class="form-horizontal mt-4" data-id="domain_footer"> |
| 290 | <div class="row mb-2"> |
| 291 | <label class="control-label col-sm-2" for="domain_footer_html">{{ lang.edit.domain_footer_html }}:</label> |
| 292 | <div class="col-sm-10"> |
| 293 | <textarea spellcheck="false" autocorrect="off" autocapitalize="none" class="form-control" rows="10" id="domain_footer_html" name="footer_html">{{ domain_footer.html }}</textarea> |
| 294 | </div> |
| 295 | </div> |
| 296 | <div class="row mb-4"> |
| 297 | <label class="control-label col-sm-2" for="domain_footer_plain">{{ lang.edit.domain_footer_plain }}:</label> |
| 298 | <div class="col-sm-10"> |
| 299 | <textarea spellcheck="false" autocorrect="off" autocapitalize="none" class="form-control" rows="10" id="domain_footer_plain" name="footer_plain">{{ domain_footer.plain }}</textarea> |
| 300 | </div> |
| 301 | </div> |
| 302 | <div class="row"> |
| 303 | <div class="offset-sm-2 col-sm-10"> |
| 304 | <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="domain_footer" data-item="domain_footer" data-api-url='edit/domain-wide-footer' data-api-attr='{"domain":"{{ domain }}"}' href="#">{{ lang.edit.save }}</button> |
| 305 | </div> |
| 306 | </div> |
| 307 | </form> |
| 308 | </div> |
| 309 | </div> |
| 310 | </div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 311 | </div> |
| 312 | </div> |
| 313 | </div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 314 | </div> |
| 315 | {% else %} |
| 316 | {{ parent() }} |
| 317 | {% endif %} |
| 318 | {% endblock %} |