Sha256: e2ba0e05dca755b9c7c1b9798d96b0d7f55df1cd91865e5750964b037a0bfdd2

Contents?: true

Size: 1.49 KB

Versions: 3

Compression:

Stored size: 1.49 KB

Contents

<ol class="form">
  <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">
<%
  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><%= as_ :default_sorting %></label></dt>
    <dd><ol>
<%
  columns_options = list_columns.select{|c| c.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].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

3 entries across 3 versions & 1 rubygems

Version Path
active_scaffold_config_list-3.4.0 app/views/active_scaffold_overrides/_show_config_list_form_body.html.erb
active_scaffold_config_list-3.3.3 app/views/active_scaffold_overrides/_show_config_list_form_body.html.erb
active_scaffold_config_list-3.3.2 app/views/active_scaffold_overrides/_show_config_list_form_body.html.erb