Sha256: 70d6db7d26d088ccc1e1139ca5cef90c57eee6f63348ae59b5a84f3eb78dc2ff

Contents?: true

Size: 1.95 KB

Versions: 24

Compression:

Stored size: 1.95 KB

Contents

<%
   record_column = column 
   readonly = (@record.readonly? or not @record.authorized_for?(:crud_type => :update))
   crud_type = @record.new_record? ? :create : (readonly ? :read : :update)
   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]}"
%>
<tr id="<%= tr_id %>" class="association-record <%= 'association-record-new' if @record.new_record? -%> <%= 'locked' if locked -%>">
<% config.subform.columns.each :for => @record.class, :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
-%>
  <td<%= ' class="hidden"'.html_safe if column_renders_as(column) == :hidden %>>
    <% unless readonly and not @record.new_record? or not @record.authorized_for?(:crud_type => crud_type, :column => column.name) -%>
      <%= render :partial => form_partial_for_column(column), :locals => { :column => column, :scope => scope } -%>
    <% else -%>
      <p><%= get_column_value(@record, column) -%></p>
    <% end -%>
  </td>
<% end -%>
<% if show_actions -%>
  <td 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.delete_subform_record(\"#{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 -%>
  </td>
<% end -%>
</tr>

Version data entries

24 entries across 22 versions & 2 rubygems

Version Path
active_scaffold-3.1.20 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.19 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.18 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.17 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.15 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.14 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.0.26 frontends/default/views/_horizontal_subform_record.html.erb
active_scaffold-3.0.26 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.13 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.12 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.0.25 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.0.25 frontends/default/views/_horizontal_subform_record.html.erb
active_scaffold-3.1.11 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold_clarity-3.0.24.2 frontends/default/views/_horizontal_subform_record.html.erb
active_scaffold-3.1.10 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.9 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.8 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.7 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.6 frontends/default/views/_horizontal_subform_record.html.erb~
active_scaffold-3.1.5 frontends/default/views/_horizontal_subform_record.html.erb