fieldset.page-metadata

legend Metadata

= labeled_field f, :title, class: 'page-title'
  = f.text_field :title, placeholder: 'Enter the page\'s title...'

= labeled_field f, :keywords, class: 'page-meta'
  = f.text_field :keywords

= labeled_field f, :description, class: 'page-meta'
  = f.text_field :description

fieldset.page-options

legend Options

= labeled_field f, :template, class: 'control'
  = f.select :template, options: BoltonCms::TEMPLATES.collect { |v| [v.first.to_s.titleize, v.first] }

= labeled_field f, :chronological, swap: true
  = f.check_box :chronological

.accordion-container

fieldset.page-content.collapsible
  legend.collapsible-header Body

  .collapsible-content
    = labeled_field f, :body, label: 'Content', class: 'content-field'
      = f.text_area :body, rows: 8

    = labeled_field f, :filter, class: 'control'
      = f.select :filter, options: BoltonCms::RENDERERS.collect { |v| [v.to_s.titleize, v] }

- f.fields_for :fragments do |pf|
  - if pf.object.active
    fieldset.page-fragment.collapsible.collapsed
      legend.collapsible-header = pf.object.label

      .collapsible-content
        = pf.hidden_field :label

        = labeled_field pf, :body, label: 'Content', class: "content-field"
          = pf.text_area :body, rows: 8

        = labeled_field pf, :filter, class: 'control'
          = pf.select :filter, options: BoltonCms::RENDERERS.collect { |v| [v.to_s.titleize, v] }
  - else # Padrino fields_for is broken in the case there's no content passed in the block
    = nil

partial ‘pages/asset_form’, locals: { f: f }

p.form-actions

= f.submit 'Save', class: 'btn btn-primary'
= f.submit 'Save & Continue', class: 'btn', name: 'save_and_continue'
= link_to 'Cancel', url(:pages, :index), class: 'btn btn-cancel'