<%= form_for [:admin, @record], :url => { action: @action.to_sym } do |f| %>
<%= render :partial => 'roroacms/admin/partials/submit_bar', :locals => { post_record: @record } %>
<% if !@record.cover_image.blank? %>
<%= render partial: 'roroacms/admin/partials/cover_image', locals: { image: @record.cover_image } %>
<% else %>
<%= render partial: 'roroacms/admin/partials/cover_image', locals: { image: @record.cover_image } %>
<% end %> <%= f.file_field :cover_image, :class => "", :id => "cover_image" %>
<%= f.hidden_field :id %> <%= f.hidden_field :post_type, :value => @post_type %>
<%= f.label :post_title, :class => "col-sm-3 control-label" %>
<%= f.text_field :post_title, size: 40, :class => "form-control" %> <%= errors_for @record, :post_title %>
<%= f.label :post_slug, :class => "col-sm-3 control-label" %>
/ <%= f.text_field :post_slug, size: 40, :class => "form-control" %>
<%= errors_for @record, :post_slug %>
<%= f.label :post_visible, :class => "col-sm-3 control-label" %>
<%= f.check_box :post_visible, {}, 'N', 'Y' %>
<%= f.label :post_status, :class => "col-sm-3 control-label" %>
<%= f.select :post_status, Roroacms::Post::POST_STATUS, {:selected => @record.post_status.blank? ? 'Draft' : @record.post_status}, { class: "form-control" } %> <%= errors_for @record, :post_status %>
<%= f.label :post_author, :class => "col-sm-3 control-label" %>
<%= f.select :admin_id, Roroacms::Admin::GET_ADMINS.collect {|p| [ p.username, p.id ] }, { :selected => @record.admin_id.blank? ? current_user.id : @record.admin_id }, { class: "form-control" } %>
<% if @post_type == 'page' %>
<%= f.label :parent_id, :class => "col-sm-3 control-label" %>
<%= f.select :parent_id, nested_dropdown(Roroacms::Post.parent_records(@record.id)), { include_blank: t("views.admin.generic.none") }, { class: "form-control" } %> <%= errors_for @record, :parent_id %>
<% end %> <% if !get_template_dropdown(@record.post_template).blank? %>
<%= f.label :post_template, :class => "col-sm-3 control-label" %>
<%= f.select :post_template, get_template_dropdown(@record.post_template), { include_blank: t("views.admin.generic.none") }, { class: "form-control" } %> <%= errors_for @record, :post_template %>
<% end %>
<%= f.label :sort_order, :class => "col-sm-3 control-label" %>
<%= f.text_field :sort_order, size: 5, :class => "form-control sort-input" %> <%= errors_for @record, :sort_order %>
<%= f.label :post_date, :class => "col-sm-3 control-label" %>
<%= t("views.admin.generic.date") %> <%= f.datetime_select :post_date, { order: [:day, :month, :year, :hour, :minute], use_short_month: true, time_separator: '', datetime_separator: t("views.admin.generic.datetime_separator") }, :class => 'form-control' %>
   <%= t("views.admin.pages.new.tab_content.markdown") %>
<%= f.text_area :post_content, :class => 'markdown_editor', :value => @record.post_content.blank? ? '...' : @record.post_content %>
   <%= t("views.admin.generic.preview") %> 0 <%= t("views.admin.generic.words") %>
<%= render 'roroacms/admin/partials/revision_tree' %>
<%= f.label :post_seo_title, :class => "col-sm-3 control-label" %>
<%= f.text_field :post_seo_title, size: 40, :class => "form-control" %> <%= errors_for @record, :post_seo_title %> <%= t("views.admin.pages.new.tab_content.seo.seo_title_content") %>
<%= f.label :post_seo_description, :class => "col-sm-3 control-label" %>
<%= f.text_field :post_seo_description, size: 40, :class => "form-control" %> <%= errors_for @record, :post_seo_description %> <%= t("views.admin.pages.new.tab_content.seo.seo_description_content") %>
<%= f.label :post_seo_is_disabled, :class => "col-sm-3 control-label" %>
<%= f.check_box :post_seo_is_disabled, {}, 'Y', 'N' %> <%= t("views.admin.pages.new.tab_content.seo.seo_disabled_content") %>
<%= f.label :post_seo_no_index, :class => "col-sm-3 control-label" %>
<%= f.check_box :post_seo_no_index, {}, 'Y', 'N' %> <%= t("views.admin.pages.new.tab_content.seo.seo_no_index_content") %>
<%= f.label :post_seo_no_follow, :class => "col-sm-3 control-label" %>
<%= f.check_box :post_seo_no_follow, {}, 'Y', 'N' %> <%= t("views.admin.pages.new.tab_content.seo.seo_no_follow_content") %>
<% if @post_type == 'post' %>
<% cats = Roroacms::Term.term_cats('category') if !cats.blank? %> <%= select_tag 'category_ids[]', options_for_select(cats.map {|c| [c.name, c.id]}, @record.terms.map {|t| t.id}), multiple: true, class: "chosen-select" %> <% else %>
<%= t("views.admin.pages.new.tab_content.categories.no_categories") %>
<% end %>
<% tags = Roroacms::Term.term_cats('tag') if !tags.blank? %> <%= select_tag 'tag_ids[]', options_for_select(tags.map {|c| [c.name, c.id]}, @record.terms.map {|t| t.id}), multiple: true, class: "chosen-select" %> <% else %>
<%= t("views.admin.pages.new.tab_content.categories.no_tags") %>
<% end %>
<% end %>
<% if !@record.post_additional_data.blank? %> <%= addition_data_loop(@json.decode(@record.post_additional_data)) %> <% end %>
<% end %>