Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 1 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 11 | <i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.active_rspamd_settings_map }} |
| 12 | </legend> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 13 | <hr /> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 14 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 26 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 27 | {% 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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 31 | data-bs-toggle="modal" |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 32 | data-dont-remember="1" |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 33 | data-bs-target="#addRsettingModal">{{ lang.admin.rsetting_add_rule }}</a> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 34 | </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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 40 | <p class="text-muted">{{ lang.admin.rsetting_none }}</p> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 41 | </div> |
| 42 | {% else %} |
| 43 | <div id="none" class="tab-pane active"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 44 | <p class="text-muted">{{ lang.admin.rsetting_no_selection }}</p> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 45 | </div> |
| 46 | {% for rsetting in rsettings %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 47 | <div id="settings_tab{{ rsetting.details.id }}" class="tab-pane"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 48 | <form class="form" data-id="rsettings" role="form" method="post"> |
| 49 | <input type="hidden" name="active" value="0"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 50 | <div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 51 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 54 | <div class="mt-4"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 55 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 58 | <div class="mt-4 mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 59 | <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> |