Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 1 | {% extends 'edit.twig' %} |
| 2 | |
| 3 | {% block inner_content %} |
| 4 | {% if result %} |
| 5 | <div id="dedit" class="tab-pane fade show active" role="tabpanel" aria-labelledby="domain-edit"> |
| 6 | <form data-id="editdomain_template" class="form-horizontal" role="form" method="post"> |
| 7 | |
| 8 | <input type="hidden" value="0" name="active"> |
| 9 | <input type="hidden" value="0" name="backupmx"> |
| 10 | <input type="hidden" value="0" name="gal"> |
| 11 | <input type="hidden" value="0" name="relay_all_recipients"> |
| 12 | <input type="hidden" value="0" name="relay_unknown_only"> |
| 13 | |
| 14 | {% if mailcow_cc_role == 'admin' %} |
| 15 | <div class="row mb-4"> |
| 16 | <label class="control-label col-sm-2" for="max_num_aliases_for_domain">{{ lang.mailbox.template }}</label> |
| 17 | <div class="col-sm-10"> |
| 18 | |
| 19 | <div class="input-group mb-3"> |
| 20 | <input type="text" name="template" class="form-control" aria-label="Text input with dropdown button" value="{{ template.template }}" /> |
| 21 | </div> |
| 22 | </div> |
| 23 | |
| 24 | </div> |
| 25 | <div class="row mb-4"> |
| 26 | <label class="control-label col-sm-2">{{ lang.add.tags }}</label> |
| 27 | <div class="col-sm-10"> |
| 28 | <div class="form-control tag-box"> |
| 29 | <input id="tags" type="text" class="tag-input"> |
| 30 | <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span> |
| 31 | <input type="hidden" value='{{ template.attributes.tags|json_encode }}' name="tags" class="tag-values" /> |
| 32 | </div> |
| 33 | </div> |
| 34 | </div> |
| 35 | <div class="row mb-2"> |
| 36 | <label class="control-label col-sm-2" for="max_num_aliases_for_domain">{{ lang.edit.max_aliases }}</label> |
| 37 | <div class="col-sm-10"> |
| 38 | <input type="number" class="form-control" name="max_num_aliases_for_domain" value="{{ template.attributes.max_num_aliases_for_domain }}"> |
| 39 | </div> |
| 40 | </div> |
| 41 | <div class="row mb-2"> |
| 42 | <label class="control-label col-sm-2" for="max_num_mboxes_for_domain">{{ lang.edit.max_mailboxes }}</label> |
| 43 | <div class="col-sm-10"> |
| 44 | <input type="number" class="form-control" name="max_num_mboxes_for_domain" value="{{ template.attributes.max_num_mboxes_for_domain }}"> |
| 45 | </div> |
| 46 | </div> |
| 47 | <div class="row mb-2"> |
| 48 | <label class="control-label col-sm-2" for="def_quota_for_mbox">{{ lang.edit.mailbox_quota_def }}</label> |
| 49 | <div class="col-sm-10"> |
| 50 | <input type="number" class="form-control" name="def_quota_for_mbox" value="{{ (template.attributes.def_quota_for_mbox / 1048576) }}"> |
| 51 | </div> |
| 52 | </div> |
| 53 | <div class="row mb-2"> |
| 54 | <label class="control-label col-sm-2" for="max_quota_for_mbox">{{ lang.edit.max_quota }}</label> |
| 55 | <div class="col-sm-10"> |
| 56 | <input type="number" class="form-control" name="max_quota_for_mbox" value="{{ (template.attributes.max_quota_for_mbox / 1048576) }}"> |
| 57 | </div> |
| 58 | </div> |
| 59 | <div class="row mb-4"> |
| 60 | <label class="control-label col-sm-2" for="max_quota_for_domain">{{ lang.edit.domain_quota }}</label> |
| 61 | <div class="col-sm-10"> |
| 62 | <input type="number" class="form-control" name="max_quota_for_domain" value="{{ (template.attributes.max_quota_for_domain / 1048576) }}"> |
| 63 | </div> |
| 64 | </div> |
| 65 | <div class="row"> |
| 66 | <div class="offset-sm-2 col-sm-10"> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 67 | <div class="form-check"> |
| 68 | <label><input type="checkbox" class="form-check-input" value="1" name="gal"{% if template.attributes.gal == '1' %} checked{% endif %}> {{ lang.edit.gal }}</label> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 69 | <small class="text-muted">{{ lang.edit.gal_info|raw }}</small> |
| 70 | </div> |
| 71 | </div> |
| 72 | </div> |
| 73 | <div class="row mb-2"> |
| 74 | <div class="offset-sm-2 col-sm-10"> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 75 | <div class="form-check"> |
| 76 | <label><input type="checkbox" class="form-check-input" value="1" name="active"{% if template.attributes.active == '1' %} checked{% endif %}{% if mailcow_cc_role != 'admin' %} disabled{% endif %}> {{ lang.edit.active }}</label> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 77 | </div> |
| 78 | </div> |
| 79 | </div> |
| 80 | <hr> |
| 81 | <div class="row"> |
| 82 | <label class="control-label col-sm-2">{{ lang.edit.ratelimit }}</label> |
| 83 | <div class="col-sm-10"> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 84 | <div class="input-group"> |
| 85 | <input name="rl_value" type="number" value="{{ template.attributes.rl_value }}" autocomplete="off" class="form-control mb-4" placeholder="{{ lang.ratelimit.disabled }}"> |
| 86 | <select name="rl_frame" class="form-control"> |
| 87 | {% include 'mailbox/rl-frame.twig' %} |
| 88 | </select> |
| 89 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 90 | </div> |
| 91 | </div> |
| 92 | {% endif %} |
| 93 | <hr> |
| 94 | <div class="row mb-2"> |
| 95 | <label class="control-label col-sm-2" for="dkim_selector">{{ lang.admin.dkim_domains_selector }}</label> |
| 96 | <div class="col-sm-10"> |
| 97 | <input class="form-control" id="dkim_selector" name="dkim_selector" value="{{ template.attributes.dkim_selector }}"> |
| 98 | </div> |
| 99 | </div> |
| 100 | <div class="row mb-4"> |
| 101 | <label class="control-label col-sm-2" for="key_size">{{ lang.admin.dkim_key_length }}</label> |
| 102 | <div class="col-sm-10"> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 103 | <select data-style="btn btn-light" class="form-control" id="key_size" name="key_size"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 104 | <option value="1024" data-subtext="bits" {% if template.attributes.key_size == 1024 %} selected{% endif %}>1024</option> |
| 105 | <option value="2048" data-subtext="bits" {% if template.attributes.key_size == 2048 %} selected{% endif %}>2048</option> |
| 106 | </select> |
| 107 | </div> |
| 108 | </div> |
| 109 | <hr> |
| 110 | <div class="row mb-2"> |
| 111 | <label class="control-label col-sm-2">{{ lang.edit.backup_mx_options }}</label> |
| 112 | <div class="col-sm-10"> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 113 | <div class="form-check"> |
| 114 | <label><input type="checkbox" class="form-check-input" value="1" name="backupmx"{% if template.attributes.backupmx == '1' %} checked{% endif %}> {{ lang.edit.relay_domain }}</label> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 115 | <br> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 116 | <label><input type="checkbox" class="form-check-input" value="1" name="relay_all_recipients"{% if template.attributes.relay_all_recipients == '1' %} checked{% endif %}> {{ lang.edit.relay_all }}</label> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 117 | <p>{{ lang.edit.relay_all_info|raw }}</p> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 118 | <label><input type="checkbox" class="form-check-input" value="1" name="relay_unknown_only"{% if template.attributes.relay_unknown_only == '1' %} checked{% endif %}> {{ lang.edit.relay_unknown_only }}</label> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 119 | <br> |
| 120 | <p>{{ lang.edit.relay_transport_info|raw }}</p> |
| 121 | </div> |
| 122 | </div> |
| 123 | </div> |
| 124 | <hr> |
| 125 | <div class="row"> |
| 126 | <div class="offset-sm-2 col-sm-10"> |
| 127 | <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="editdomain_template" data-item="{{ template.id }}" data-api-url='edit/domain/template' data-api-attr='{}' href="#">{{ lang.admin.save }}</button> |
| 128 | </div> |
| 129 | </div> |
| 130 | </form> |
| 131 | </div> |
| 132 | {% else %} |
| 133 | {{ parent() }} |
| 134 | {% endif %} |
| 135 | {% endblock %} |