- content_for :right_column do #form-save.box %label.checkbox.inline %input{:type => 'checkbox'} = ::Cms::Page.human_attribute_name(:is_published) %button.btn.btn-small.btn-primary.pull-right = render :partial => 'admin/cms/files/index' = render 'admin/cms/partials/page_form_before', :object => form = form.text_field :label, :data => {:slugify => @page.new_record?} - unless @site.pages.count == 0 || @site.pages.root == @page = form.text_field :slug, :data => {:slug => true} - unless @page.new_record? = form.text_field :full_path, :id => 'full-path', :disabled => true - if (options = ::Cms::Layout.options_for_select(@site)).present? = form.select :layout_id, options, {}, 'data-url' => form_blocks_admin_cms_site_page_path(@site, @page.id.to_i) - if (options = ::Cms::Page.options_for_select(@site, @page)).present? = form.select :parent_id, options - if (options = ::Cms::Page.options_for_select(@site, @page, nil, 0, false)).present? = form.select :target_page_id, [["---- #{t('.select_target_page')} ----", nil]] + options = render 'admin/cms/partials/page_form_inner', :object => form = render :partial => 'admin/cms/categories/form', :object => form = render :partial => 'form_blocks' =# form.check_box :is_published, :label => t('.is_published') = form.fields_for :page_workflow do |wf| = wf.select :status_id, Cms::PageWorkflow.statuses_for_select, {}, {class: "status-control"} = wf.text_field :published_date, class: "status-control", :data => {:utc_date => @page.page_workflow.published_date.utc.strftime("%d %B, %Y")} = render 'admin/cms/partials/page_form_after', :object => form .form-actions = form.submit t('.preview'), :name => 'preview', :id => nil, :class => 'btn' = form.submit t(@page.new_record?? '.create' : '.update'), :class => 'btn btn-primary' :coffeescript dateControl = $("#page_page_workflow_attributes_published_date") wkControl = $("#page_page_workflow_attributes_status_id") parentControl = $("#page_page_workflow_attributes_published_date").parents(".control-group:first") dateControl.val(dateControl.data("utcDate")).datepicker(dateFormat: "d MM, yy") if wkControl.val() in ["0","1"] parentControl.hide() wkControl.change -> if $(this).val() in ["0","1"] parentControl.hide() else parentControl.show()