blob: 8cd690e92c6ed12f4fe4e010d064101e7b52d049 [file] [log] [blame]
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01001<div role="tabpanel" class="tab-pane fade" id="tab-config-rsettings" role="tabpanel" aria-labelledby="tab-config-rsettings">
2 <div class="card mb-4">
3 <div class="card-header d-flex fs-5">
4 <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">
5 {{ lang.admin.rspamd_settings_map }}
6 </button>
7 <span class="d-none d-md-block">{{ lang.admin.rspamd_settings_map }}</span>
8 </div>
9 <div id="collapse-tab-config-rsettings" class="card-body collapse" data-bs-parent="#admin-content">
10 <legend data-bs-target="#active_settings_map" style="cursor:pointer" unselectable="on" data-bs-toggle="collapse">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010011 <i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.active_rspamd_settings_map }}
12 </legend>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010013 <hr />
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010014 <div id="active_settings_map" class="collapse" >
15 <textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control textarea-code" rows="20" name="settings_map" readonly>{{ rsettings_map }}</textarea>
16 </div>
17 <br>
18 <form class="form" data-id="rsettings" role="form" method="post">
19 <div class="row">
20 <div class="col-sm-3">
21 <div class="list-group">
22 {% if not rsettings %}
23
24 {% endif %}
25 {% for rsetting in rsettings %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010026 <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>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010027 {% else %}
28 <span class="list-group-item"><em>{{ lang.admin.rsetting_none }}</em></span>
29 {% endfor %}
30 <a href="#" class="list-group-item list-group-item-default"
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010031 data-bs-toggle="modal"
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010032 data-dont-remember="1"
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010033 data-bs-target="#addRsettingModal">{{ lang.admin.rsetting_add_rule }}</a>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010034 </div>
35 </div>
36 <div class="col-sm-9">
37 <div class="tab-content">
38 {% if not rsettings %}
39 <div id="none" class="tab-pane active">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010040 <p class="text-muted">{{ lang.admin.rsetting_none }}</p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010041 </div>
42 {% else %}
43 <div id="none" class="tab-pane active">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010044 <p class="text-muted">{{ lang.admin.rsetting_no_selection }}</p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010045 </div>
46 {% for rsetting in rsettings %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010047 <div id="settings_tab{{ rsetting.details.id }}" class="tab-pane">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010048 <form class="form" data-id="rsettings" role="form" method="post">
49 <input type="hidden" name="active" value="0">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010050 <div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010051 <label for="rsettings_desc">{{ lang.admin.rsetting_desc }}:</label>
52 <input type="text" class="form-control" id="rsettings_desc" name="desc" value="{{ rsetting.details.desc }}">
53 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010054 <div class="mt-4">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010055 <label for="rsettings_content">{{ lang.admin.rsetting_content }}:</label>
56 <textarea class="form-control" id="rsettings_content" name="content" rows="10">{{ rsetting.details.content }}</textarea>
57 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010058 <div class="mt-4 mb-2">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010059 <label>
60 <input type="checkbox" name="active" value="1" {% if rsetting.details.active %}checked{% endif %}> {{ lang.admin.active }}
61 </label>
62 </div>
63 <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>
64 <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>
65 </form>
66 </div>
67 {% endfor %}
68 {% endif %}
69 </div>
70 </div>
71 </div>
72 </form>
73 </div>
74 </div>
75</div>