Sha256: c6353a87a1b6e581ca8e1c1ff7f6b06901947da3f092cfb8443144a9b5476bd9

Contents?: true

Size: 1.44 KB

Versions: 1

Compression:

Stored size: 1.44 KB

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

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