<%= raw(t('admin.page_title.edit') + " " + @post_type.the_title.to_s + ": " + @post_decorate.the_title + " #{@post_decorate.the_status}") if !@post.new_record? %> <%= link_to raw("#{t('admin.button.view_draft')}"), {action: :edit, id: @post.drafts.pluck('id') }, id: "view_draft", class: "label label-warning label-form", title: "#{t('admin.button.view_draft')}", target: '_blank' if @post.drafts.present? %> <%= t('admin.page_title.create') + " " + @post_type.the_title.to_s if @post.new_record? %>

<%= form_for @post, url:{action: @post.new_record? ? :create : :update}, html: {class: 'form-post', id: 'form-post'} do |f| %> <%= f.hidden_field :draft_id, value: @post.draft? ? @post.id : '' %>
<% if @post.draft? && !@post.parent.present? %>
<%= f.submit "#{ (@post.new_record?) ? t('admin.page_title.create') : t('admin.button.publish')}", class: "btn btn-success btn-lg btn-block", onclick: "$('#post_status').val('published')" %>
<% elsif @post.draft? && @post.parent.present? %>
<%= f.submit "#{ t('admin.button.recover') }", class: "btn btn-success btn-lg btn-block", onclick: "$('#post_status').val('published')" %>
<% else %>
<%= f.submit "#{ (@post.new_record?) ? t('admin.page_title.create') : t('admin.page_title.update')}", class: "btn btn-success btn-lg btn-block" %>
<% end %>

<%= t('admin.post_type.configuration')%>

<% if @post_type.get_option('has_template', true) _get_list_template_files = get_list_template_files if _get_list_template_files.size > 0 %>
<%= select("meta", "template", _get_list_template_files.collect {|p| [ p.gsub('.html.erb',''), p ] }, { include_blank: true, selected: (params[:meta][:template] rescue false || @post.meta[:template] ) },{class: 'form-control'}) %>
<% end end %> <% if @post_type.get_option('has_comments', false) %>
<% end %> <%= raw @post_form_extra_settings.join("") if @post_form_extra_settings.present? %>
<% if @post_type.manage_categories? %>

<%= t('admin.post_type.categories')%> *

<%= raw post_type_html_inputs(@post_type, "categories", "categories" , "checkbox" ,params[:categories] || (@post.new_record? ? [] : @post.categories.pluck("term_taxonomy.id")), "categorychecklist", true )%>
<% end %> <% if @post_type.manage_tags?%>

<%= t('admin.post_type.tags')%>

"/>
<% end %> <% if @post_type.get_option('has_picture', true) %>

<%= t('admin.post_type.featured_image')%>

<%= t('admin.post_type.upload_image')%>
<% end %>

<%= t('admin.sidebar.content') %>

<%= render partial: 'layouts/admin/form_error', locals: {data: @post} %> <%= hidden_field :meta, :slug %>
<%= f.label t('admin.table.title') %> *
<%= f.text_field :title, :class => "form-control required translatable title-post" %>
<% if @post_type.get_option('has_content', true) %>
<%= f.label t('admin.sidebar.content') %> *
<%= f.text_area :content, :class => "form-control tinymce_textarea required translatable", :height => '520px', :style => "width: 100%" %>
<% end %> <% if @post_type.get_option('has_summary', true) %>

<% end %> <% if @post_type.get_option('has_keywords', true) %>

" />
<% end %>
<% unless @post.draft? || @post.new_record? %> <% if @post_type.get_option('has_comments', false) %> <% end %> <% end %> <%= render partial: "admin/settings/custom_fields/render", locals: {record: @post, field_groups: @post.get_field_groups({kind: "Post", include_parent: true}) } %>
<% end %> <% add_asset_library('tinymce','post') %>