===entity_code=== <%% if can? :update, <%= @model.klass %> %> <%% end %> <%- @model.attributes.select{|a| !['id', 'created_at', 'updated_at', 'removed'].include?(a.name)}.each do |attr| -%> <%- end -%> <%- @model.associations.each do |assoc| -%> <%- end -%> <%% @<%= @model.plural_name %>.each do |<%= @model.singular_name %>| %> <%% if can? :update, <%= @model.klass %> %> <%% end %> <%- @model.attributes.select{|a| !['id', 'created_at', 'updated_at', 'removed'].include?(a.name)}.each do |attr| -%> <%- end -%> <%- @model.associations.each do |assoc| -%> <%- end -%> <%% end %>
<%%= check_all_th %><%%= t '<%= @model.plural_name %>.index.id' %><%%= t '<%= @model.plural_name %>.index.<%= attr.name %>' %><%%= t '<%= @model.plural_name %>.index.<%= assoc.model2.singular_name %>' %><%%= t '<%= @model.plural_name %>.index.edit' %> <%%= t '<%= @model.plural_name %>.index.remove' %>
<%%= check_all_td(<%= @model.singular_name %>.id) %> <%%= link_to <%= @model.singular_name %>.id, <%= @model.object_name %>_path(<%= @model.singular_name %>) <%= ", class: 'lightbox various fancybox.ajax'" if @entity.ajax %> %> <%- if attr.type.to_sym == :file -%> <%% unless <%= @model.singular_name %>.<%= attr.name %>_file_name.blank? %> <%%= link_to image_tag(file_icon_path(<%= @model.singular_name %>.<%= attr.name %>_file_name)), <%= @model.singular_name %>.<%= attr.name %>.url, :target => '_blank' %> <%% else %> <%%= t 'system.no_file' %> <%% end %> <%- elsif attr.type.to_sym == :status -%> <%%= <%= @model.singular_name %>.<%= attr.name %>_to_s %> <%- else -%> <%%= <%= @model.singular_name %>.<%= attr.name %> %> <%- end -%> <%- if assoc.belongs_to? || assoc.nested_one? || assoc.has_one? -%> <%%= <%= @model.singular_name %>.<%= assoc.model2.singular_name %>.<%= assoc.reference_field %> unless <%= @model.singular_name %>.<%= assoc.model2.singular_name %>.nil? %> <%- elsif assoc.has_many? or assoc.has_and_belongs_to_many? or assoc.nested_many? -%>
    <%% <%= @model.singular_name %>.<%= assoc.model2.plural_name %>.each do |<%= assoc.model2.singular_name %>| %>
  • <%%= <%= assoc.model2.singular_name %>.<%= assoc.reference_field %> %>
  • <%% end %>
<%- end -%>
<%%= link_to t('<%= @model.plural_name %>.index.edit_label'), edit_<%= @model.object_name %>_path(<%= @model.singular_name %>) <%= ", :class => 'lightbox various fancybox.ajax'" if @entity.ajax %> %> <%%= link_to t('<%= @model.plural_name %>.index.remove_label'), <%= @model.to_route_object %>, :method => :delete, <%= ':remote => true,' if @entity.ajax %> :data => {:confirm => t('<%= @model.plural_name %>.index.confirm_deletion')} %>
<%%= pagination_footer @<%= @model.plural_name %> %>