class="ordered <%= params[:order].downcase %>" data-order="<%= params[:order] %>" <% else %> class="ordered" <% end %> ># | <% list_params.each do |attr| %> <% if attr.is_a?(Hash) %><%= @model_class.human_attribute_name(attr.keys.first) %> | <% else %>data-order-field="<%= attr %>" <% if params[:order_field].to_s == attr.to_s %> class="ordered <%= params[:order].downcase %>" data-order="<%= params[:order] %>" <% else %> class="ordered" <% end %> <% end %>> <%= @model_class.human_attribute_name(attr) %> | <% end %> <% end %><%= t('slash_admin.view.actions') %> | |||||
---|---|---|---|---|---|---|---|---|
<%= m.id %> | <% list_params.each do |attr| %> <% if attr.is_a?(Hash) %> <% if attr[attr.keys.first][:type].to_s == 'image' %><% if m.send(attr.keys.first).present? %> <% else %> <%= t('slash_admin.view.no_image') %> <% end %> | <% else %><%= render attr.keys.first.to_s, model: m %> | <% end %> <% else %> <% if m.send(attr).is_a?(TrueClass) || m.send(attr).is_a?(FalseClass) %><%= m.send(attr) ? 'Oui' : 'Non' %> | <% elsif @belongs_to_fields.include?(attr) || @has_one_fields.include?(attr) %><%= link_to(edit_polymorphic_url([:slash_admin, m.send(attr)]), class: 'link', target: '_blank') do %> <%= show_object(m.send(attr)) %> <% end rescue show_object(m.send(attr)) %> | <% elsif @has_many_fields.include?(attr) %><% else %> | <%= m.send(attr) %> | <% end %> <% end %> <% end %>
<% if can? :show, @model_class %>
<%= link_to(polymorphic_url([:slash_admin, m]), class: 'btn btn-info btn-sm') do %>
<% end rescue nil %>
<% end %>
<% if can? :edit, @model_class %>
<%= link_to(edit_polymorphic_url([:slash_admin, m]), class: 'btn btn-warning btn-sm') do %>
<% end rescue nil %>
<% end %>
<% if can? :destroy, @model_class %>
<%= link_to(polymorphic_url([:slash_admin, m]), class: 'single-delete btn btn-danger btn-sm') do %>
<% end rescue nil %>
<% end %>
|