Sha256: 649513fa38affb243ade5678b266b9c434ed76e99ee112f71efd998546c74323

Contents?: true

Size: 807 Bytes

Versions: 3

Compression:

Stored size: 807 Bytes

Contents

/ -# TODO: put the parent and slug side by side and name the new field URL
/ -#       also maybe change the dropdown to an autocomplete
/ -# f.input :parent_url, :collection => Cardboard::Page.preordered.all.inject(["/"]){|result, elm| result << elm.url unless elm.id == @page.id; result}, include_blank: false

= f.input :url, required: true, wrapper_html:{class: f.object.errors.messages[:slug] ? "error" : nil}, hint: f.object.root? ? "This page is your home page" : nil do
  - if f.object.root?
    .btn(disabled)=> "/" 
    ' or
  .input-prepend style="display:inline"
    .add-on
      - if @page.new_record?
        = f.select :parent_url, options_for_select(@page.parent_url_options, f.object.parent_url)
      - else
        = f.object.parent_url

    = f.text_field :slug

  br
  = f.error :slug

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cardboard_cms-0.1.8 app/views/cardboard/pages/_url_field.html.slim
cardboard_cms-0.1.6 app/views/cardboard/pages/_url_field.html.slim
cardboard_cms-0.1.4 app/views/cardboard/pages/_url_field.html.slim