Sha256: e67c90fa33a1ab6ff761dbed4304e23ee31aadb78d722f8e71a77c26ec4d298f

Contents?: true

Size: 1.8 KB

Versions: 21

Compression:

Stored size: 1.8 KB

Contents

<% 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;\"" if columns.collapsed %>>
  <% columns.each :for => @record, :crud_type => (:read if show_unauthorized_columns) do |column| %>
  <% 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 } %>
    <%= link_to_visibility_toggle(subsection_id, {:default_visible => !column.collapsed}) -%>
  </li>
  <% elsif column.readonly_association?
    next %>
  <% 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 unless column.css_class.nil? || column.css_class.is_a?(Proc) %> <%=column.name%>-sub-form" id="<%= sub_form_id(:association => column.name) %>">
    <%=raw render :partial => form_partial_for_column(column, renders_as), :locals => { :column => column } -%>
  </li>
  <% else -%>
  <li class="form-element <%= 'required' if column.required? %> <%= column.css_class unless column.css_class.nil? || column.css_class.is_a?(Proc) %>">
    <%=raw render :partial => form_partial_for_column(column, renders_as), :locals => { :column => column, :only_value => !authorized } -%>
  </li>
  <% end -%>
  <% end -%>
</ol>

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
active_scaffold-3.2.3 frontends/default/views/_form.html.erb
active_scaffold-3.2.2 frontends/default/views/_form.html.erb
active_scaffold-3.2.1 frontends/default/views/_form.html.erb
active_scaffold-3.2.0 frontends/default/views/_form.html.erb
active_scaffold-3.1.20 frontends/default/views/_form.html.erb
active_scaffold-3.1.19 frontends/default/views/_form.html.erb
active_scaffold-3.1.18 frontends/default/views/_form.html.erb
active_scaffold-3.1.17 frontends/default/views/_form.html.erb
active_scaffold-3.1.15 frontends/default/views/_form.html.erb
active_scaffold-3.1.14 frontends/default/views/_form.html.erb
active_scaffold-3.1.13 frontends/default/views/_form.html.erb
active_scaffold-3.1.12 frontends/default/views/_form.html.erb
active_scaffold-3.1.11 frontends/default/views/_form.html.erb
active_scaffold-3.1.10 frontends/default/views/_form.html.erb
active_scaffold-3.1.9 frontends/default/views/_form.html.erb
active_scaffold-3.1.8 frontends/default/views/_form.html.erb
active_scaffold-3.1.7 frontends/default/views/_form.html.erb
active_scaffold-3.1.6 frontends/default/views/_form.html.erb
active_scaffold-3.1.5 frontends/default/views/_form.html.erb
active_scaffold-3.1.4 frontends/default/views/_form.html.erb