<% new_record = @cms_contentitem.new_record? %> <% submit_url = (new_record ? create_content_admin_cms_contentitem_path(@current_page) : admin_cms_contentitem_path(@cms_contentitem)) %> <% title = (new_record ? "New Content" : @cms_contentitem.container.capitalize) %> <%= simple_form_for @cms_contentitem, url: submit_url, html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings do |f| %> <%= f.error_notification message: "Please review the problems below" %> <%= f.hidden_field :original_updated_on %> <% toolbar = capture do %> <%= link_to icons(:help), '#', class: 'btn btn-link btn-icon', data: { toggle: 'modal', target: '#tag_reference' } %> <%= link_to icons(:cancel), admin_cms_page_url(@current_page), class: 'btn btn-link btn-icon' %> <% end %> <%= panel title: title, toolbar: toolbar do %> <%= locale_tabs do |locale| %>
<%= f.input "content_#{locale}", label: 'Content', wrapper: :bs3_vertical_form, as: :code_editor, mode: @cms_contentitem.itemtype, required: true, input_html: {style: "height: 400px;"} %>
<% end %>
<%= f.input :itemtype, label: 'Item Type', collection: CmsContentitem::CONTENT_TYPES, include_blank: false, wrapper: :bs3_vertical_form %>
<%= f.input :container, label: 'Content Name', hint: 'This is normally "body" or "sidebar" or something', wrapper: :bs3_vertical_form %>
<%= f.input :enable_cache, as: :boolean, label: 'Cache Content', wrapper: :bs3_vertical_form %>
<%= submit_or_cancel cancel_url: admin_cms_page_url(@current_page), delete_url: ([:admin, @cms_contentitem] unless @cms_contentitem.new_record?), delete_confirm: 'Are you sure you wish to delete this item?' %> <% end %> <% end %> <%= render partial: 'dm_cms/admin/shared/liquid_tags_ref' %>