mailcow/data/web/templates/admin/tab-config-rsettings.twig
2022-06-06 20:38:24 +02:00

78 lines
4.4 KiB
Twig

<div role="tabpanel" class="tab-pane fade" id="tab-config-rsettings" role="tabpanel" aria-labelledby="tab-config-rsettings">
<div class="card mb-4">
<div class="card-header d-flex">
<button class="btn d-md-none flex-grow-1 text-start" data-bs-target="#collapse-tab-config-rsettings" data-bs-toggle="collapse" aria-controls="ollapse-tab-config-rsettings">
{{ lang.admin.rspamd_settings_map }}
</button>
<span class="d-none d-md-block">{{ lang.admin.rspamd_settings_map }}</span>
</div>
<div id="collapse-tab-config-rsettings" class="card-body collapse" data-bs-parent="#admin-content">
<legend data-bs-target="#active_settings_map" style="cursor:pointer" unselectable="on" data-bs-toggle="collapse">
<i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.active_rspamd_settings_map }}
</legend>
<hr />
<div id="active_settings_map" class="collapse" >
<textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control textarea-code" rows="20" name="settings_map" readonly>{{ rsettings_map }}</textarea>
</div>
<br>
<form class="form" data-id="rsettings" role="form" method="post">
<div class="row">
<div class="col-sm-3">
<div class="list-group">
{% if not rsettings %}
{% endif %}
{% for rsetting in rsettings %}
<a href="#{{ rsetting.details.id }}" class="list-group-item list-group-item-{% if rsetting.details.active %}success{% endif %}" data-dont-remember="1" data-bs-toggle="tab">{{ rsetting.details.desc }} (ID #{{ rsetting.id }})</a>
{% else %}
<span class="list-group-item"><em>{{ lang.admin.rsetting_none }}</em></span>
{% endfor %}
<a href="#" class="list-group-item list-group-item-default"
data-id="add_domain_admin"
data-bs-toggle="modal"
data-dont-remember="1"
data-bs-target="#addRsettingModal"
data-bs-toggle="tab">{{ lang.admin.rsetting_add_rule }}</a>
</div>
</div>
<div class="col-sm-9">
<div class="tab-content">
{% if not rsettings %}
<div id="none" class="tab-pane active">
<p class="text-muted">{{ lang.admin.rsetting_none }}</p>
</div>
{% else %}
<div id="none" class="tab-pane active">
<p class="text-muted">{{ lang.admin.rsetting_no_selection }}</p>
</div>
{% for rsetting in rsettings %}
<div id="{{ rsetting.details.id }}" class="tab-pane">
<form class="form" data-id="rsettings" role="form" method="post">
<input type="hidden" name="active" value="0">
<div>
<label for="rsettings_desc">{{ lang.admin.rsetting_desc }}:</label>
<input type="text" class="form-control" id="rsettings_desc" name="desc" value="{{ rsetting.details.desc }}">
</div>
<div>
<label for="rsettings_content">{{ lang.admin.rsetting_content }}:</label>
<textarea class="form-control" id="rsettings_content" name="content" rows="10">{{ rsetting.details.content }}</textarea>
</div>
<div>
<label>
<input type="checkbox" name="active" value="1" {% if rsetting.details.active %}checked{% endif %}> {{ lang.admin.active }}
</label>
</div>
<button class="btn btn-sm btn-success" data-action="edit_selected" data-item="{{ rsetting.details.id }}" data-id="rsettings" data-api-url='edit/rsetting' data-api-attr='{}' href="#"><i class="bi bi-check-lg"></i> {{ lang.admin.save }}</button>
<button class="btn btn-sm btn-danger" data-action="delete_selected" data-item="{{ rsetting.details.id }}" data-id="rsettings" data-api-url="delete/rsetting" data-api-attr='{}' href="#">{{ lang.admin.remove }}</button>
</form>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</form>
</div>
</div>
</div>