engine/app/views/locomotive/pages/_form.html.haml

50 lines
2.2 KiB
Plaintext
Raw Normal View History

- content_for :head do
= render '/locomotive/content_assets/picker'
= render '/locomotive/theme_assets/picker'
= render 'editable_elements'
- if @page.persisted?
- content_for :backbone_view_data do
:plain
{ page: #{@page.to_presenter.as_json_for_html_view.to_json} }
- if can?(:manage, @page)
= f.inputs :name => :information do
= f.input :title, :wrapper_html => { :class => 'highlighted' }
- if not @page.index? and not @page.not_found?
= f.input :parent_id, :as => :select, :collection => parent_pages_options, :include_blank => false
= f.input :slug, :required => false, :hint => @page.slug.blank? ? t('.empty_slug') : public_page_url(@page), :input_html => { :'data-url' => get_path_pages_url, :disabled => @page.index? || @page.not_found? }, :wrapper_html => { :style => "#{'display: none' if @page.templatized?};", :class => 'em-inline-hints' }
= f.inputs :name => :seo, :class => "inputs foldable #{'folded' if inputs_folded?(@page)}" do
2011-06-23 12:57:52 +00:00
= f.input :seo_title
= f.input :meta_keywords
= f.input :meta_description
- if can?(:manage, @page)
= f.inputs :name => :advanced_options, :id => 'advanced-options', :class => "inputs foldable #{'folded' if inputs_folded?(@page)}" do
= f.input :content_type_id, :as => :select, :collection => current_site.content_types.all.to_a, :include_blank => false, :wrapper_html => { :style => "#{'display: none' unless @page.templatized?}" }
= f.input :templatized, :as => :'Locomotive::Toggle', :style => "#{'display: none' if @page.redirect?}"
= f.input :published, :as => :'Locomotive::Toggle'
= f.input :listed, :as => :'Locomotive::Toggle'
= f.input :redirect, :as => :'Locomotive::Toggle', :style => "#{'display: none' if @page.templatized?}"
= f.input :cache_strategy, :as => :select, :collection => options_for_page_cache_strategy, :include_blank => false, :wrapper_html => { :style => "#{'display: none' if @page.redirect?}" }
= f.input :redirect_url, :required => true, :wrapper_html => { :style => "#{'display: none' unless @page.redirect?}" }
= f.inputs :name => :raw_template, :class => "inputs foldable #{'folded' if inputs_folded?(@page)}" do
= f.input :raw_template, :as => :'Locomotive::Code'