Sha256: c9ce2a30054d8bb6a650e30ec3500e23f3bc3aff285ac0cef9f1f4de029faf5a
Contents?: true
Size: 1.66 KB
Versions: 14
Compression:
Stored size: 1.66 KB
Contents
<% scope ||= nil subsection_id ||= nil show_unauthorized_columns = active_scaffold_config.send(form_action).show_unauthorized_columns if active_scaffold_config.actions.include? form_action %> <ol class="form" <%= "id=#{subsection_id}" unless subsection_id.nil? %> <%= "style=\"display: none;\"".html_safe if columns.collapsed %>> <% columns.each_column(for: @record, crud_type: (:read if show_unauthorized_columns)) do |column| %> <% column_css_class = column.css_class unless column.css_class.nil? || column.css_class.is_a?(Proc) %> <% renders_as = column_renders_as(column) %> <% authorized = show_unauthorized_columns || renders_as == :subsection ? @record.authorized_for?(:crud_type => form_action, :column => column.name) : true %> <% if renders_as == :subsection -%> <% if authorized %> <% subsection_id = sub_section_id(:sub_section => column.label) %> <li class="sub-section <%= column_css_class %>"> <h5> <%= column.label %> <%= link_to_visibility_toggle(subsection_id, {:default_visible => !column.collapsed}) -%> </h5> <%= render :partial => 'form', :locals => { :columns => column, :subsection_id => subsection_id, :form_action => form_action, :scope => scope } %> </li> <% end %> <% elsif renders_as == :subform and authorized -%> <%= content_tag :li, active_scaffold_subform_attributes(column, column_css_class) do %> <%= render_column(column, @record, renders_as, scope) %> <% end %> <% else -%> <li class="form-element <%= 'required' if column.required? %> <%= column.form_ui %> <%= column_css_class %>"> <%= render_column(column, @record, renders_as, scope, !authorized) %> </li> <% end -%> <% end -%> </ol>
Version data entries
14 entries across 14 versions & 1 rubygems