<%= t('camaleon_cms.admin.page_title.list_of') %> <%= @post_type.decorate.the_title.pluralize %>

<%= link_to raw(" #{t('camaleon_cms.admin.post_type.add')} #{@post_type.decorate.the_title}"), {action: :new}, class: "btn btn-primary pull-right" if can? :create_post, @post_type %>
<%= render partial: "camaleon_cms/admin/posts/filter_posts" %>
<% if @post_type.manage_categories? %> <% end %> <% if @post_type.manage_tags? %> <% end %> <% extra_column = {post_type: @post_type, content: "", from_body: false}; hooks_run("list_post_extra_columns", extra_column) %> <%= raw extra_column[:content] %> <% @posts.eager_load(:categories, :post_tags).each do |f| f = f.decorate %> "> <% if @post_type.manage_categories? %> <% end %> <% if @post_type.manage_tags? %> <% end %> <% extra_column = {post: f, post_type: @post_type, content: "", from_body: true}; hooks_run("list_post_extra_columns", extra_column) %> <%= raw extra_column[:content] %> <% end %>
<%= t('plugins.ecommerce.product.sku') %> <%= t('camaleon_cms.admin.table.title') %> <%= t('camaleon_cms.admin.table.status') %> <%= t('plugins.ecommerce.product.price') %> <%= t('plugins.ecommerce.product.weight') %> <%= t('plugins.ecommerce.product.stock') %> <%= t('plugins.ecommerce.product.qty') %> <%= t('camaleon_cms.admin.table.author')%><%= t('camaleon_cms.admin.table.categories')%><%= t('camaleon_cms.admin.table.tags')%><%= t('camaleon_cms.admin.table.actions')%>
<%= f.the_sku %> <% if !f.trash? && (can? :update, f) %> <%= link_to f.the_title, {action: :edit, id: f.id }, class: "" %> <% else %> <%= f.the_title %> <% end %> <%= "*" + " (is #{@post_type.the_title} #{f.parent.decorate.the_title})" if f.draft? && f.parent.present? %> <%= link_to raw(f.the_status), {action: :index, s: f.status } %> <%= f.the_price %> <%= f.the_weight %> <%= raw f.the_stock_status %> <%= f.the_qty %> <%= f.author.fullname %><%= raw post_type_list_taxonomy(f.categories, "success") %><%= raw post_type_list_taxonomy(f.post_tags, "default") %> <% if f.published? %> <% if f.slug.to_s.translations.present? %>
<% else %> <% end %> <% end %> <% if f.trash? %> <%= link_to raw(''), {action: :restore, post_id: f.id, s: params[:s] }, class: "btn btn-success btn-xs", title: "#{t('camaleon_cms.admin.button.restore')}" if can? :update, f %> <%= link_to raw(''), { action: :destroy, id: f.id, s: params[:s] }, method: :delete, data: { confirm: t('camaleon_cms.admin.message.delete') }, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete')}" if can? :destroy, f %> <% elsif f.draft? %> <%= link_to raw(''), {action: :edit, id: f.id, recover_draft: 'true' }, class: "btn btn-success btn-xs", title: "#{t('camaleon_cms.admin.button.recover')}" if can? :update, f %> <%= link_to raw(''), {action: :edit, id: f.id }, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" if can? :update, f %> <%= link_to raw(''), { action: :trash, post_id: f.id, s: params[:s] }, data: { confirm: t('camaleon_cms.admin.message.delete') }, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete')}" if can? :destroy, f %> <% else %> <%= link_to raw(''), {action: :edit, id: f.id }, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" if can? :update, f %> <%= link_to raw(''), { action: :trash, post_id: f.id, s: params[:s] }, data: { confirm: t('camaleon_cms.admin.message.delete') }, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete')}" if can? :destroy, f %> <% end %>
<%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if @posts.empty? %> <%= will_paginate @posts, renderer: BootstrapPagination::Rails if @posts.present? %>