blob: 439e55a31a089038b97374426e3b7816cb28adae [file] [log] [blame]
<div 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 fs-5">
<button class="btn d-md-none flex-grow-1 text-start" data-bs-target="#collapse-tab-config-rsettings" data-bs-toggle="collapse" aria-controls="collapse-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="#" class="list-group-item list-group-item-{% if rsetting.details.active %}success{% endif %}" data-dont-remember="1" data-bs-target="#settings_tab{{ rsetting.details.id }}" 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-bs-toggle="modal"
data-dont-remember="1"
data-bs-target="#addRsettingModal">{{ 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="settings_tab{{ rsetting.details.id }}" class="tab-pane rsettings">
<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 class="mt-4">
<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 class="mt-4 mb-2">
<label>
<input type="checkbox" class="form-check-input" name="active" value="1" {% if rsetting.details.active %}checked{% endif %}> {{ lang.admin.active }}
</label>
</div>
<div class="btn-group">
<button class="btn btn-sm btn-xs-lg 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-xs-lg 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>
</div>
</form>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</form>
</div>
</div>
</div>