Sha256: 51572226ddd74f02528981d9ac47fb716a8aa414a81712c2c7102e638889e76b

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

<ol class="form">
  <% if config_list_columns? %>
  <li class="form-element">
    <dl><dt><label><%= as_ :columns %></label></dt>
    <dd><ul class="<%= active_scaffold_config.config_list.draggable ? 'draggable-lists' : 'sortable-container' %>" id="<%= element_form_id(action: :config_list) %>-columns">
<% config_list_columns.each do |label, column| %>
      <li class="sortable">
        <%= check_box_tag 'config_list[]', column.to_s, (config_list_params.nil? ? true : config_list_params.include?(column)), {id: nil}%>
        <label><%= label %></label>
      </li>
<% end %>
    </ul></dd></dl>
  </li>
  <% end %>
  <% if config_list_sorting? %>
  <li class="form-element">
    <dl><dt><label><%= as_ :default_sorting %></label></dt>
    <dd><ol>
<%
  columns_options = list_columns.select(&:sortable?).map { |c| [c.label, c.name] }
  order_options = ['asc', 'desc'].map { |v| [as_(v), v] }
  selected = config_list_sorting || []
  3.times do |i|
%>
      <li><%= select_tag "config_list_sorting[#{i}][]", options_for_select(columns_options, selected: selected[i]&.first), include_blank: as_(:_select_), class: 'column' %>
      <%= select_tag "config_list_sorting[#{i}][]", options_for_select(order_options, selected: selected[i]&.last), include_blank: as_(:_select_), class: 'order' %></li>
<% end %>
    </ol></dd></dl>
  </li>
  <% end %>
</ol>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_scaffold_config_list-3.6.0 app/views/active_scaffold_overrides/_show_config_list_form_body.html.erb