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 | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 5 | <ul class="nav nav-tabs" role="tablist"> |
| 6 | <li role="presentation" class="nav-item"><button class="nav-link active" data-bs-toggle="tab" data-bs-target="#dedit">{{ lang.edit.domain }}</button></li> |
| 7 | <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dratelimit">{{ lang.edit.ratelimit }}</button></li> |
| 8 | <li role="presentation" class="nav-item"><button class="nav-link" data-bs-toggle="tab" data-bs-target="#dspamfilter">{{ lang.edit.spam_filter }}</button></li> |
| 9 | <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> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 10 | </ul> |
| 11 | <hr> |
| 12 | <div class="tab-content"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 13 | <div id="dedit" class="tab-pane fade show active" role="tabpanel" aria-labelledby="domain-edit"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 14 | <form data-id="editdomain" class="form-horizontal" role="form" method="post"> |
| 15 | <input type="hidden" value="0" name="active"> |
| 16 | <input type="hidden" value="0" name="backupmx"> |
| 17 | <input type="hidden" value="0" name="gal"> |
| 18 | <input type="hidden" value="0" name="relay_all_recipients"> |
| 19 | <input type="hidden" value="0" name="relay_unknown_only"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 20 | <div class="row mb-2" data-acl="{{ acl.domain_desc }}"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 21 | <label class="control-label col-sm-2" for="description">{{ lang.edit.description }}</label> |
| 22 | <div class="col-sm-10"> |
| 23 | <input type="text" class="form-control" name="description" value="{{ result.description }}"> |
| 24 | </div> |
| 25 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 26 | <div class="row mb-4"> |
| 27 | <label class="control-label col-sm-2">{{ lang.add.tags }}</label> |
| 28 | <div class="col-sm-10"> |
| 29 | <div class="form-control tag-box"> |
| 30 | {% for tag in domain_details.tags %} |
| 31 | <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"> |
| 32 | <i class="bi bi-tag-fill"></i> |
| 33 | {{ tag }} |
| 34 | </span> |
| 35 | {% endfor %} |
| 36 | <input type="text" class="tag-input"> |
| 37 | <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span> |
| 38 | <input type="hidden" value="" name="tags" class="tag-values" /> |
| 39 | </div> |
| 40 | </div> |
| 41 | </div> |
| 42 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 43 | <label class="control-label col-sm-2" for="relayhost">{{ lang.edit.relayhost }}</label> |
| 44 | <div class="col-sm-10"> |
| 45 | <select data-acl="{{ acl.domain_relayhost }}" data-live-search="true" id="relayhost" name="relayhost" class="form-control"> |
| 46 | {% for rlyhost in rlyhosts %} |
| 47 | <option |
| 48 | style="{% if rlyhost.active != '1' %}background: #ff4136; color: #fff{% endif %}" |
| 49 | {% if result.relayhost == rlyhost.id %} selected{% endif %} |
| 50 | value="{{ rlyhost.id }}"> |
| 51 | ID {{ rlyhost.id }}: {{ rlyhost.hostname }} ({{ rlyhost.username }}) |
| 52 | </option> |
| 53 | {% endfor %} |
| 54 | <option value=""{% if not result.relayhost %} selected{% endif %}> |
| 55 | {{ lang.edit.none_inherit }} |
| 56 | </option> |
| 57 | </select> |
| 58 | </div> |
| 59 | </div> |
| 60 | {% if mailcow_cc_role == 'admin' %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 61 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 62 | <label class="control-label col-sm-2" for="aliases">{{ lang.edit.max_aliases }}</label> |
| 63 | <div class="col-sm-10"> |
| 64 | <input type="number" class="form-control" name="aliases" value="{{ result.max_num_aliases_for_domain }}"> |
| 65 | </div> |
| 66 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 67 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 68 | <label class="control-label col-sm-2" for="mailboxes">{{ lang.edit.max_mailboxes }}</label> |
| 69 | <div class="col-sm-10"> |
| 70 | <input type="number" class="form-control" name="mailboxes" value="{{ result.max_num_mboxes_for_domain }}"> |
| 71 | </div> |
| 72 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 73 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 74 | <label class="control-label col-sm-2" for="defquota">{{ lang.edit.mailbox_quota_def }}</label> |
| 75 | <div class="col-sm-10"> |
| 76 | <input type="number" class="form-control" name="defquota" value="{{ (result.def_quota_for_mbox / 1048576) }}"> |
| 77 | </div> |
| 78 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 79 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 80 | <label class="control-label col-sm-2" for="maxquota">{{ lang.edit.max_quota }}</label> |
| 81 | <div class="col-sm-10"> |
| 82 | <input type="number" class="form-control" name="maxquota" value="{{ (result.max_quota_for_mbox / 1048576) }}"> |
| 83 | </div> |
| 84 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 85 | <div class="row mb-4"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 86 | <label class="control-label col-sm-2" for="quota">{{ lang.edit.domain_quota }}</label> |
| 87 | <div class="col-sm-10"> |
| 88 | <input type="number" class="form-control" name="quota" value="{{ (result.max_quota_for_domain / 1048576) }}"> |
| 89 | </div> |
| 90 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 91 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 92 | <label class="control-label col-sm-2">{{ lang.edit.backup_mx_options }}</label> |
| 93 | <div class="col-sm-10"> |
| 94 | <div class="checkbox"> |
| 95 | <label><input type="checkbox" value="1" name="backupmx"{% if result.backupmx == '1' %} checked{% endif %}> {{ lang.edit.relay_domain }}</label> |
| 96 | <br> |
| 97 | <label><input type="checkbox" value="1" name="relay_all_recipients"{% if result.relay_all_recipients == '1' %} checked{% endif %}> {{ lang.edit.relay_all }}</label> |
| 98 | <p>{{ lang.edit.relay_all_info|raw }}</p> |
| 99 | <label><input type="checkbox" value="1" name="relay_unknown_only"{% if result.relay_unknown_only == '1' %} checked{% endif %}> {{ lang.edit.relay_unknown_only }}</label> |
| 100 | <br> |
| 101 | <p>{{ lang.edit.relay_transport_info|raw }}</p> |
| 102 | <hr style="margin:25px 0px 0px 0px"> |
| 103 | </div> |
| 104 | </div> |
| 105 | </div> |
| 106 | {% endif %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 107 | <div class="row"> |
| 108 | <div class="offset-sm-2 col-sm-10"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 109 | <div class="checkbox"> |
| 110 | <label><input type="checkbox" value="1" name="gal"{% if result.gal == '1' %} checked{% endif %}> {{ lang.edit.gal }}</label> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 111 | <small class="text-muted">{{ lang.edit.gal_info|raw }}</small> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 112 | </div> |
| 113 | </div> |
| 114 | </div> |
| 115 | <hr> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 116 | <div class="row mb-2"> |
| 117 | <div class="offset-sm-2 col-sm-10"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 118 | <div class="checkbox"> |
| 119 | <label><input type="checkbox" value="1" name="active"{% if result.active == '1' %} checked{% endif %}{% if mailcow_cc_role != 'admin' %} disabled{% endif %}> {{ lang.edit.active }}</label> |
| 120 | </div> |
| 121 | </div> |
| 122 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 123 | <div class="row mb-2"> |
| 124 | <div class="offset-sm-2 col-sm-10"> |
| 125 | <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> |
| 126 | </div> |
| 127 | </div> |
| 128 | <div class="row"> |
| 129 | <div class="offset-sm-2 col-sm-10"> |
| 130 | <small class="fst-italic d-block">{{ lang.edit.created_on }}: {{ result.created }}</small> |
| 131 | <small class="fst-italic d-block">{{ lang.edit.last_modified }}: {{ result.modified }}</small> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 132 | </div> |
| 133 | </div> |
| 134 | </form> |
| 135 | {% if dkim %} |
| 136 | <hr> |
| 137 | <div class="row"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 138 | <div class="col-12 col-sm-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 139 | <p>Domain: <strong>{{ result.domain_name }}</strong> ({{ dkim.dkim_selector }}._domainkey)</p> |
| 140 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 141 | <div class="col-12 col-sm-10"> |
| 142 | <pre class="p-2">{{ dkim.dkim_txt }}</pre> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 143 | </div> |
| 144 | </div> |
| 145 | {% endif %} |
| 146 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 147 | <div id="dratelimit" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-ratelimit"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 148 | <form data-id="domratelimit" class="form-inline well" method="post"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 149 | <div class="row"> |
| 150 | <div class="col-12"> |
| 151 | <label class="control-label mb-2">{{ lang.edit.ratelimit }}</label> |
| 152 | <input name="rl_value" type="number" value="{{ rl.value }}" autocomplete="off" class="form-control mb-4" placeholder="{{ lang.ratelimit.disabled }}"> |
| 153 | <select name="rl_frame" class="form-control"> |
| 154 | {% include 'mailbox/rl-frame.twig' %} |
| 155 | </select> |
| 156 | <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> |
| 157 | </div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 158 | </div> |
| 159 | </form> |
| 160 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 161 | <div id="dspamfilter" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-spamfilter"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 162 | <div class="row"> |
| 163 | <div class="col-sm-6"> |
| 164 | <h4>{{ lang.user.spamfilter_wl }}</h4> |
| 165 | <p>{{ lang.user.spamfilter_wl_desc|raw }}</p> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 166 | <form class="form-inline mb-4" data-id="add_wl_policy_domain"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 167 | <div class="input-group" data-acl="{{ acl.spam_policy }}"> |
| 168 | <input type="text" class="form-control" name="object_from" placeholder="*@example.org" required> |
| 169 | <span class="input-group-btn"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 170 | <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> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 171 | </span> |
| 172 | </div> |
| 173 | </form> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 174 | <table id="wl_policy_domain_table" class="table table-striped dt-responsive w-100"></table> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 175 | <div class="mass-actions-user"> |
| 176 | <div class="btn-group" data-acl="{{ acl.spam_policy }}"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 177 | <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> |
| 178 | <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> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 179 | </div> |
| 180 | </div> |
| 181 | </div> |
| 182 | <div class="col-sm-6"> |
| 183 | <h4>{{ lang.user.spamfilter_bl }}</h4> |
| 184 | <p>{{ lang.user.spamfilter_bl_desc|raw }}</p> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 185 | <form class="form-inline mb-4" data-id="add_bl_policy_domain"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 186 | <div class="input-group" data-acl="{{ acl.spam_policy }}"> |
| 187 | <input type="text" class="form-control" name="object_from" placeholder="*@example.org" required> |
| 188 | <span class="input-group-btn"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 189 | <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> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 190 | </span> |
| 191 | </div> |
| 192 | </form> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 193 | <table id="bl_policy_domain_table" class="table table-striped dt-responsive w-100"></table> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 194 | <div class="mass-actions-user"> |
| 195 | <div class="btn-group" data-acl="{{ acl.spam_policy }}"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 196 | <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> |
| 197 | <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> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 198 | </div> |
| 199 | </div> |
| 200 | </div> |
| 201 | </div> |
| 202 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 203 | <div id="dqwbcc" class="tab-pane fade" role="tabpanel" aria-labelledby="domain-qwbcc"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 204 | <div class="row"> |
| 205 | <div class="col-sm-12"> |
| 206 | <h4>{{ lang.edit.quota_warning_bcc }}</h4> |
| 207 | <p>{{ lang.edit.quota_warning_bcc_info|raw }}</p> |
| 208 | <form class="form-horizontal" data-id="quota_bcc"> |
| 209 | <input type="hidden" value="0" name="active"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 210 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 211 | <label class="control-label col-sm-2" for="script_data">{{ lang.edit.target_address|raw }}:</label> |
| 212 | <div class="col-sm-10"> |
| 213 | <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> |
| 214 | </div> |
| 215 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 216 | <div class="row mb-4"> |
| 217 | <div class="offset-sm-2 col-sm-10"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 218 | <div class="checkbox"> |
| 219 | <label><input type="checkbox" value="1" name="active"{% if quota_notification_bcc.active == '1' %} checked{% endif %}> {{ lang.edit.active }}</label> |
| 220 | </div> |
| 221 | </div> |
| 222 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 223 | <div class="row"> |
| 224 | <div class="offset-sm-2 col-sm-10"> |
| 225 | <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> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 226 | </div> |
| 227 | </div> |
| 228 | </form> |
| 229 | </div> |
| 230 | </div> |
| 231 | </div> |
| 232 | </div> |
| 233 | {% else %} |
| 234 | {{ parent() }} |
| 235 | {% endif %} |
| 236 | {% endblock %} |