.
This commit is contained in:
@@ -23,12 +23,22 @@
|
||||
</ol>
|
||||
|
||||
{% comment %} Hide the toggle button if there are no users (to add or remove) {% endcomment %}
|
||||
{% if current_cid_users or available_cid_users %}
|
||||
<p><button class="toggle-all-btn">Toggle all</button></p>
|
||||
<p>{% if current_cid_users or available_cid_users %}
|
||||
<button class="toggle-all-btn">Toggle all</button>
|
||||
{% endif %}
|
||||
<button class="add-all-btn">Add all</button>
|
||||
<button class="remove-all-btn">Remove all</button>
|
||||
|
||||
</p>
|
||||
|
||||
<script>
|
||||
$(document).ready(() => {
|
||||
$(".remove-all-btn").click((el) => {
|
||||
$(".current .toggle-btn").click();
|
||||
});
|
||||
$(".add-all-btn").click((el) => {
|
||||
$(":not(.current) .toggle-btn").click();
|
||||
});
|
||||
$(".toggle-all-btn").click((el) => {
|
||||
$(".toggle-btn").click();
|
||||
});
|
||||
|
||||
@@ -37,12 +37,23 @@
|
||||
</ol>
|
||||
|
||||
{% comment %} Hide the toggle button if there are no users (to add or remove) {% endcomment %}
|
||||
<p>
|
||||
{% if current_user_users or available_user_users %}
|
||||
<p><button class="toggle-all-btn">Toggle all</button></p>
|
||||
<button class="toggle-all-btn">Toggle all</button>
|
||||
{% endif %}
|
||||
<button class="add-all-btn">Add all</button>
|
||||
<button class="remove-all-btn">Remove all</button>
|
||||
|
||||
</p>
|
||||
|
||||
<script>
|
||||
$(document).ready(() => {
|
||||
$(".remove-all-btn").click((el) => {
|
||||
$(".current .toggle-btn").click();
|
||||
});
|
||||
$(".add-all-btn").click((el) => {
|
||||
$("li:not(.current) .toggle-btn").click();
|
||||
});
|
||||
$(".toggle-all-btn").click((el) => {
|
||||
$(".toggle-btn").click();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user