Sha256: f37d1352f1db45ddc5b4184d266742c0afd7107a341b75fba0e79db7be2eefb7

Contents?: true

Size: 1.85 KB

Versions: 13

Compression:

Stored size: 1.85 KB

Contents

<%
  record_column = column
  readonly = (@record.readonly? or not @record.authorized_for?(:crud_type => :update))
  crud_type = @record.new_record? ? :create : (readonly ? :read : nil)
  show_actions = false
  config = active_scaffold_config_for(@record.class)
  options = active_scaffold_input_options(config.columns[@record.class.primary_key], scope)
  tr_id = "association-#{options[:id]}"
-%>
<ol id="<%= tr_id %>" class="association-record <%= 'association-record-new' if @record.new_record? -%> <%= 'locked' if locked -%>">
<% config.subform.columns.each :for => @record, :crud_type => crud_type, :flatten => true do |column| %>
<%
  next unless in_subform?(column, parent_record)
  show_actions = true
  column = column.clone
  column.form_ui ||= :select if column.association
-%>
  <li class="form-element <%= 'required' if column.required? %> <%= column.css_class unless column.css_class.nil? %>">
    <% unless readonly -%>
      <%= render :partial => form_partial_for_column(column), :locals => { :column => column, :scope => scope } -%>
    <% else -%>
      <p><%= get_column_value(@record, column) -%></p>
    <% end -%>
  </li>
<% end -%>
<% if show_actions -%>
  <li class="actions">
    <% if record_column.plural_association? and (@record.authorized_for?(:crud_type => :delete) or not [:destroy, :delete_all].include?(record_column.association.options[:dependent])) %>
      <% destroy_id = "#{options[:id]}-destroy" %>
      <%= link_to as_(:remove), '#', :class => 'destroy', :id => destroy_id , :onclick => "ActiveScaffold.remove(\"#{tr_id}\"); return false;", :style=> "display: none;" %>
      <%= javascript_tag("ActiveScaffold.show('#{destroy_id}');") if !locked %>
    <% end %> 
    <% unless @record.new_record? %>
      <input type="hidden" name="<%= options[:name] -%>" id="<%= options[:id] -%>" value="<%= @record.id -%>" />
    <% end -%>
  </li>
<% end -%>
</ol>

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
active_scaffold_vho-3.0.11 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold-3.0.12 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold-3.0.11 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold_vho-3.0.10 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold_vho-3.0.9 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold_vho-3.0.8 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold_vho-3.0.7 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold_vho-3.0.6 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold-3.0.5 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold-3.0.4 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold-3.0.2 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold-3.0.1 frontends/default/views/_vertical_subform_record.html.erb
active_scaffold-3.0.0 frontends/default/views/_vertical_subform_record.html.erb