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