Sha256: cb4d24f31c4495f087fdf10fc2cce26d15dd97fa97d64062bb1c6ce5374d3fd2

Contents?: true

Size: 1.41 KB

Versions: 17

Compression:

Stored size: 1.41 KB

Contents

<%= form.label field do %>
  <%= options[:label] %>
  <% if options[:required] %>
    <button type="button"
            style="background: none; border: none; outline: 0; position: absolute; margin-top: 0.3rem"
            data-bs-trigger="focus"
            data-bs-toggle="popover"
            title="Required"
            data-bs-content="<%= "#{options.fetch(:label)} is a required field." %>">
            <i class="text-secondary fa-solid fa-star-of-life"></i>
    </button>
  <% end %>
  <% if options[:description].present? %>
    <button type="button"
            style="background: none; border: none; outline: 0; position: absolute; <%= options[:required] ? 'margin-left: 1.4rem;' : nil %> margin-top: 0.3rem"
            data-bs-toggle="popover"
            data-bs-trigger="focus"
            title="<%= options.fetch(:label) %>"
            data-bs-content="<%= options[:description] %>">
            <i class="text-secondary fa-solid fa-circle-info"></i>
    </button>
  <% end %>
<% end %>

<% if type == :check_boxes && options[:option_groups].present? %>
  <%= render partial: 'active_element/components/form/option_groups_summary',
             locals: { option_groups: options[:option_groups] } %>
<% end %>

<% if type == :json_field %>
  <div>
  <%= render partial: 'active_element/components/fields/json',
             locals: { value: component.value_for(field), field_id: "#{id}-#{field}-json-view" } %>
  </div>
<% end %>

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
active_element-0.0.31 app/views/active_element/components/form/_label.html.erb
active_element-0.0.30 app/views/active_element/components/form/_label.html.erb
active_element-0.0.29 app/views/active_element/components/form/_label.html.erb
active_element-0.0.28 app/views/active_element/components/form/_label.html.erb
active_element-0.0.27 app/views/active_element/components/form/_label.html.erb
active_element-0.0.26 app/views/active_element/components/form/_label.html.erb
active_element-0.0.24 app/views/active_element/components/form/_label.html.erb
active_element-0.0.23 app/views/active_element/components/form/_label.html.erb
active_element-0.0.22 app/views/active_element/components/form/_label.html.erb
active_element-0.0.21 app/views/active_element/components/form/_label.html.erb
active_element-0.0.19 app/views/active_element/components/form/_label.html.erb
active_element-0.0.18 app/views/active_element/components/form/_label.html.erb
active_element-0.0.17 app/views/active_element/components/form/_label.html.erb
active_element-0.0.16 app/views/active_element/components/form/_label.html.erb
active_element-0.0.15 app/views/active_element/components/form/_label.html.erb
active_element-0.0.14 app/views/active_element/components/form/_label.html.erb
active_element-0.0.13 app/views/active_element/components/form/_label.html.erb