Files
fizzy/app/views/webhooks/form/_actions.html.erb
T
Rob Zolkos 4321ed86aa Add Enable all/Disable all buttons to webhook event selection
Makes it easier to quickly select or deselect all webhook event types when configuring a webhook. Uses the existing toggle-class Stimulus controller.
2026-01-15 21:09:23 -05:00

25 lines
1.2 KiB
Plaintext

<div data-controller="toggle-class">
<div class="flex align-center gap-half margin-block-end-half">
<%= button_tag "Enable all", type: "button", class: "btn btn--plain txt-x-small txt-link font-weight-normal", data: { action: "click->toggle-class#checkAll" } %>
<span class="txt-subtle">&middot;</span>
<%= button_tag "Disable all", type: "button", class: "btn btn--plain txt-x-small txt-link font-weight-normal", data: { action: "click->toggle-class#checkNone" } %>
</div>
<ul class="flex flex-column align-start gap-half margin-none unpad">
<%= form.collection_check_boxes \
:subscribed_actions,
webhook_action_options,
:first,
:last do |item| %>
<li class="list-style-none margin-none">
<label class="toggler__visible-when-off flex align-center gap cursor-pointer">
<span class="switch txt-x-small flex-item-no-shrink">
<%= item.check_box(class: "switch__input", data: { toggle_class_target: "checkbox" }) %>
<span class="switch__btn round"></span>
</span>
<span class="min-width"><%= item.text %></span>
</label>
</li>
<% end %>
</ul>
</div>