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"> |
| 67 | <div class="checkbox"> |
| 68 | <label><input type="checkbox" value="1" name="gal"{% if template.attributes.gal == '1' %} checked{% endif %}> {{ lang.edit.gal }}</label> |
| 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"> |
| 75 | <div class="checkbox"> |
| 76 | <label><input type="checkbox" value="1" name="active"{% if template.attributes.active == '1' %} checked{% endif %}{% if mailcow_cc_role != 'admin' %} disabled{% endif %}> {{ lang.edit.active }}</label> |
| 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"> |
| 84 | <input name="rl_value" type="number" value="{{ template.attributes.rl_value }}" autocomplete="off" class="form-control mb-4" placeholder="{{ lang.ratelimit.disabled }}"> |
| 85 | <select name="rl_frame" class="form-control"> |
| 86 | <option value="s"{% if template.attributes.rl_frame == 's' %} selected{% endif %}>{{ lang.ratelimit.second }}</option> |
| 87 | <option value="m"{% if template.attributes.rl_frame == 'm' %} selected{% endif %}>{{ lang.ratelimit.minute }}</option> |
| 88 | <option value="h"{% if template.attributes.rl_frame == 'h' %} selected{% endif %}>{{ lang.ratelimit.hour }}</option> |
| 89 | <option value="d"{% if template.attributes.rl_frame == 'd' %} selected{% endif %}>{{ lang.ratelimit.day }}</option> |
| 90 | </select> |
| 91 | </div> |
| 92 | </div> |
| 93 | {% endif %} |
| 94 | <hr> |
| 95 | <div class="row mb-2"> |
| 96 | <label class="control-label col-sm-2" for="dkim_selector">{{ lang.admin.dkim_domains_selector }}</label> |
| 97 | <div class="col-sm-10"> |
| 98 | <input class="form-control" id="dkim_selector" name="dkim_selector" value="{{ template.attributes.dkim_selector }}"> |
| 99 | </div> |
| 100 | </div> |
| 101 | <div class="row mb-4"> |
| 102 | <label class="control-label col-sm-2" for="key_size">{{ lang.admin.dkim_key_length }}</label> |
| 103 | <div class="col-sm-10"> |
| 104 | <select data-style="btn btn-secondary btn-sm" class="form-control" id="key_size" name="key_size"> |
| 105 | <option value="1024" data-subtext="bits" {% if template.attributes.key_size == 1024 %} selected{% endif %}>1024</option> |
| 106 | <option value="2048" data-subtext="bits" {% if template.attributes.key_size == 2048 %} selected{% endif %}>2048</option> |
| 107 | </select> |
| 108 | </div> |
| 109 | </div> |
| 110 | <hr> |
| 111 | <div class="row mb-2"> |
| 112 | <label class="control-label col-sm-2">{{ lang.edit.backup_mx_options }}</label> |
| 113 | <div class="col-sm-10"> |
| 114 | <div class="checkbox"> |
| 115 | <label><input type="checkbox" value="1" name="backupmx"{% if template.attributes.backupmx == '1' %} checked{% endif %}> {{ lang.edit.relay_domain }}</label> |
| 116 | <br> |
| 117 | <label><input type="checkbox" value="1" name="relay_all_recipients"{% if template.attributes.relay_all_recipients == '1' %} checked{% endif %}> {{ lang.edit.relay_all }}</label> |
| 118 | <p>{{ lang.edit.relay_all_info|raw }}</p> |
| 119 | <label><input type="checkbox" value="1" name="relay_unknown_only"{% if template.attributes.relay_unknown_only == '1' %} checked{% endif %}> {{ lang.edit.relay_unknown_only }}</label> |
| 120 | <br> |
| 121 | <p>{{ lang.edit.relay_transport_info|raw }}</p> |
| 122 | </div> |
| 123 | </div> |
| 124 | </div> |
| 125 | <hr> |
| 126 | <div class="row"> |
| 127 | <div class="offset-sm-2 col-sm-10"> |
| 128 | <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> |
| 129 | </div> |
| 130 | </div> |
| 131 | </form> |
| 132 | </div> |
| 133 | {% else %} |
| 134 | {{ parent() }} |
| 135 | {% endif %} |
| 136 | {% endblock %} |