blob: 439e55a31a089038b97374426e3b7816cb28adae [file] [log] [blame]
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +01001<div class="tab-pane fade" id="tab-config-rsettings" role="tabpanel" aria-labelledby="tab-config-rsettings">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01002 <div class="card mb-4">
3 <div class="card-header d-flex fs-5">
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +01004 <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">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01005 {{ 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 Benkardd1f5b682023-11-18 13:18:30 +010047 <div id="settings_tab{{ rsetting.details.id }}" class="tab-pane rsettings">
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>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010060 <input type="checkbox" class="form-check-input" name="active" value="1" {% if rsetting.details.active %}checked{% endif %}> {{ lang.admin.active }}
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010061 </label>
62 </div>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010063 <div class="btn-group">
64 <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>
65 <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>
66 </div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010067 </form>
68 </div>
69 {% endfor %}
70 {% endif %}
71 </div>
72 </div>
73 </div>
74 </form>
75 </div>
76 </div>
77</div>