Sha256: 9b876dbf37393c5691f21f75f8e1d41c647313c501650e0abe9a9640e992ea73
Contents?: true
Size: 1.81 KB
Versions: 4
Compression:
Stored size: 1.81 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;\"".html_safe 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
4 entries across 4 versions & 1 rubygems