<%= t('camaleon_cms.admin.page_title.list_of', post_type: @post_type.the_title) %> (slug = <%= @post_type.the_slug %>) <%= link_to(" #{t("camaleon_cms.common.visit")}".html_safe, @post_type.the_url, class: 'btn btn-xs', target: '_blank') %> <%= link_to raw(" #{t('camaleon_cms.admin.post_type.edit_post_type')}"), edit_cama_admin_settings_post_type_path(@post_type.id), class: "btn btn-xs cama_ajax_request" if can? :manage, :settings %>

<%= link_to raw(" #{t('camaleon_cms.admin.post_type.add')} #{@post_type.the_title}"), {action: :new}, class: "btn btn-primary pull-right cama_ajax_request" if can? :create_post, @post_type %>
<%= render partial: "camaleon_cms/admin/posts/filter_posts" %>
<%= content_tag :th, t('camaleon_cms.admin.table.owner') if @lists_tab == "draft" %> <% 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] %> <% (@post_type.manage_hierarchy? ? cama_hierarchy_post_list(@posts.eager_load(:categories, :post_tags).decorate.to_a) : @posts.eager_load(:categories, :post_tags).decorate).each do |f| title = f.the_hierarchy_title %> "> <%= content_tag :td, f.post_parent.present? ? link_to(f.parent.decorate.the_title, {action: :edit, id: f.post_parent}, class: "cama_ajax_request") : '' if @lists_tab == "draft" %> <% 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('camaleon_cms.admin.table.id') %> <%= t('camaleon_cms.admin.table.title') %><%= t('camaleon_cms.admin.table.status') %> <%= t('camaleon_cms.admin.table.author') %><%= t('camaleon_cms.admin.table.categories', default: 'Categories') %><%= t('camaleon_cms.admin.table.tags', default: 'Tags') %><%= t("camaleon_cms.admin.table.updated_at", default: 'Updated at') %> <%= t('camaleon_cms.admin.table.actions', default: 'Actions') %>
<%= f.id %> <% if !f.trash? && (can? :update, f) %> <%= link_to title, {action: :edit, id: f.id}, class: "cama_ajax_request" %> <% else %> <%= title %> <% end %> <%= link_to raw(f.the_status), {action: :index, s: f.status}, class: "cama_ajax_request" %> <%= f.author.fullname %><%= raw post_type_list_taxonomy(f.categories, "success") %><%= raw post_type_list_taxonomy(f.post_tags, "default") %><%= f.the_updated_at %> <% 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_item')}, class: "btn btn-danger btn-xs cama_ajax_request", title: "#{t('camaleon_cms.admin.button.delete_complete', default: 'Delete completely')}" 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 cama_ajax_request", 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 cama_ajax_request", title: "#{t('camaleon_cms.admin.button.move_trash')}" if can? :destroy, f %> <% else %> <%= link_to raw(''), {action: :edit, id: f.id}, class: "btn btn-default btn-xs cama_ajax_request", 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 cama_ajax_request", title: "#{t('camaleon_cms.admin.button.move_trash')}" if can? :destroy, f %> <% end %>
<%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if @posts.empty? %> <%= raw cama_do_pagination(@posts) %>