% title_column_or_id = title_column(f.object.class) || "id" %>
<% resource_title = f.object.send(title_column_or_id) %>
class="associated-resource" data-label-input="<%= resource_name %>_<%= association %>_attributes_<%= index %>_<%= title_column_or_id %>">
<% if positionable?(f.object) %>
<%= image_tag "drag-handle.png", :class => "handle" %>
|
<% end %>
<% if f.object.persisted? %>
<%= resource_title %>
<% else %>
[ <%= t('fullstack.admin.new_record', :default => "new record") %> ]
<% end %>
|
<% begin %>
<%= render :partial => "admin/#{association}/associated_fields", :locals => {:f => f} %>
<% rescue ActionView::MissingTemplate %>
<%= f.resource_inputs :except => [ resource_name ] %>
<% end %>
<%= f.hidden_field(:_destroy, :class => "destroy-associated-resource") %>
<% if positionable?(f.object) %>
<%= f.hidden_field(:position, :class => "associated-resource-position") %>
<% end %>
<% if f.object.errors.any? %>
" data-content='<%= h("#{f.errors(:wrap => false)}") %>' ><%= icon :"warning-sign" %>
<% end %>
<% if subject.can_edit?(f.object) %>
<%= button t('fullstack.admin.edit', :default => "Edit"), "##{resource_name}_#{association}_fields_#{index}", :data => {:toggle => :modal} %>
<% end %>
<% if subject.can_destroy?(f.object) %>
<%= button(
t('fullstack.admin.delete', :default => "Delete"),
"javascript:void(0)",
:type => :danger, :class => "btn-delete-associated-resource", :"data-toggle" => :button
)
%>
<% end %>
|