2010-08-28 00:00:05 +00:00
|
|
|
- grouped_editable_elements = @page.editable_elements_grouped_by_blocks
|
|
|
|
|
|
|
|
= semantic_fields_for(@page) do |f|
|
|
|
|
- unless grouped_editable_elements.empty?
|
|
|
|
#editable-elements
|
|
|
|
.nav
|
|
|
|
- grouped_editable_elements.keys.each_with_index do |name, index|
|
2011-11-19 23:54:33 +00:00
|
|
|
= link_to (name.try(:humanize) || t('locomotive.pages.form.default_block')).gsub('\'', ''), "#block-#{index}", :id => "block-nav-#{index}", :class => "#{'on' if index == 0}"
|
2010-08-28 00:00:05 +00:00
|
|
|
.clear
|
|
|
|
|
|
|
|
.wrapper
|
|
|
|
%ul{ :id => "blocks" }
|
|
|
|
- grouped_editable_elements.keys.each_with_index do |name, index|
|
|
|
|
- elements = grouped_editable_elements[name]
|
|
|
|
%li{ :id => "block-#{index}", :class => 'block', :style => "display: #{index == 0 ? 'block' : 'none' }" }
|
|
|
|
%fieldset.inputs
|
|
|
|
%ol
|
2011-08-25 16:27:43 +00:00
|
|
|
- elements.each do |el|
|
2010-08-28 00:00:05 +00:00
|
|
|
= f.fields_for 'editable_elements', el, :child_index => el._index do |g|
|
2010-08-31 21:53:30 +00:00
|
|
|
- case el
|
2011-11-17 17:05:51 +00:00
|
|
|
- when ::Locomotive::EditableLongText
|
2010-08-31 21:53:30 +00:00
|
|
|
= g.input :content, :label => el.slug.humanize, :hint => el.hint, :as => :text, :input_html => { :class => 'html' }
|
2011-11-17 17:05:51 +00:00
|
|
|
- when ::Locomotive::EditableShortText
|
2010-08-31 21:53:30 +00:00
|
|
|
= g.input :content, :label => el.slug.humanize, :hint => el.hint
|
2011-11-17 17:05:51 +00:00
|
|
|
- when ::Locomotive::EditableFile
|
2010-08-31 21:53:30 +00:00
|
|
|
= g.custom_input :source, :label => el.slug.humanize, :hint => el.hint, :css => 'file' do
|
|
|
|
= g.file_field :source
|
|
|
|
- if el.source?
|
|
|
|
%p.remove
|
|
|
|
%strong
|
|
|
|
= link_to File.basename(el.source.url), el.source.url
|
|
|
|
%span
|
|
|
|
/
|
2011-10-30 23:02:41 +00:00
|
|
|
!= t('locomotive.pages.form.delete_file')
|
2010-08-31 21:53:30 +00:00
|
|
|
= g.check_box :remove_source
|