Sha256: d901a66a2934cd8f9b53f6795d15bff9118664ff457c1773ab9424e1c7586ae7

Contents?: true

Size: 1.8 KB

Versions: 5

Compression:

Stored size: 1.8 KB

Contents

<%
  scope ||= nil
  subsection_id ||= nil
  show_unauthorized_columns = active_scaffold_config.send(form_action).show_unauthorized_columns
%>
<ol class="form" <%= "id=#{subsection_id}" unless subsection_id.nil? %> <%= "style=\"display: none;\"".html_safe if columns.collapsed %>>
  <% columns.each :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) %>
  <% authorized = show_unauthorized_columns ? @record.authorized_for?(:crud_type => form_action, :column => column.name) : true %>
  <% renders_as = column_renders_as(column) %>
  <% if renders_as == :subsection -%>
    <% subsection_id = sub_section_id(:sub_section => column.label) %>
  <li class="sub-section <%= column_css_class %>">
    <h5><%= column.label %></h5>
    <%= render :partial => 'form', :locals => { :columns => column, :subsection_id => subsection_id, :form_action => form_action, :scope => scope } %>
    <%= link_to_visibility_toggle(subsection_id, {:default_visible => !column.collapsed}) -%>
  </li>
  <% elsif renders_as == :subform and !override_form_field?(column) and authorized -%>
  <li class="sub-form <%= active_scaffold_config_for(column.association.klass).subform.layout %>-sub-form <%= column_css_class %> <%=column.name%>-sub-form" id="<%= sub_form_id(:association => column.name) %>">
    <%=raw render :partial => form_partial_for_column(column, renders_as), :locals => { :column => column, :scope => scope } -%>
  </li>
  <% else -%>
  <li class="form-element <%= 'required' if column.required? %> <%= column_css_class %>">
    <%=raw render :partial => form_partial_for_column(column, renders_as), :locals => { :column => column, :only_value => !authorized, :scope => scope } -%>
  </li>
  <% end -%>
  <% end -%>
</ol>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_scaffold-3.2.20 frontends/default/views/_form.html.erb
active_scaffold-3.2.19 frontends/default/views/_form.html.erb
active_scaffold-3.3.0.rc app/views/active_scaffold_overrides/_form.html.erb
active_scaffold-3.2.17 frontends/default/views/_form.html.erb
active_scaffold-3.2.16 frontends/default/views/_form.html.erb