5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 01:36:22 +00:00
panel/app/views/bootstrap/_custom_checkbox.haml

10 lines
417 B
Text
Raw Normal View History

2023-03-28 20:31:35 +00:00
- help_id = "#{id}_help"
- checkbox_attributes = local_assigns.slice(:id, :type, :name, :value, :required, :checked)
- checkbox_attributes[:type] ||= 'checkbox'
2023-03-28 20:31:35 +00:00
.custom-control.custom-checkbox
%input.custom-control-input{ **checkbox_attributes }
2023-03-28 20:31:35 +00:00
%label.custom-control-label{ for: id, aria: { describedby: help_id } }= content
- if (block = yield).present?
%small.form-text.text-muted{ id: help_id }= block