- if @resource.errors.any?
- content_for :notifications do
.notification.notification-danger.animated.fadeInRight
= icon('exclamation')
.notification-message
=t 'spina.notifications.alert'
%small= @resource.errors.full_messages.join('
').html_safe
= link_to '#', data: {close_notification: true} do
= icon('cross')
= form_with model: @resource, url: spina.admin_resource_path(@resource) do |f|
%header#header
.breadcrumbs= render_breadcrumbs separator: '
'
#header_actions
%button.button.button-primary{type: 'submit', style: 'margin-right: 0'}
= icon('check')
=t 'spina.save'
.well
.horizontal-form
.horizontal-form-group
.horizontal-form-label
= Spina::Resource.human_attribute_name :label
.horizontal-form-content
= f.text_field :label, placeholder: Spina::Resource.human_attribute_name(:label)
.horizontal-form-group
.horizontal-form-label
= Spina::Resource.human_attribute_name :order_by
.horizontal-form-content
.select-dropdown
- options = [[Spina::Page.human_attribute_name(:title), 'title']]
= f.select :order_by, options_for_select(options, f.object.order_by), include_blank: Spina::Page.human_attribute_name(:created_at)
.horizontal-form-group
.horizontal-form-label
= Spina::Resource.human_attribute_name :view_template
.horizontal-form-content
.select-dropdown
- options = options_for_select(current_theme.view_templates.map { |template| [template[:title], template[:name]] }, @resource.view_template)
= f.select :view_template, options, include_blank: true
.horizontal-form-group
.horizontal-form-label
= Spina::Resource.human_attribute_name :parent_page
.horizontal-form-content
.select-dropdown
= f.select :parent_page_id, page_ancestry_options(f.object), include_blank: Spina::Resource.human_attribute_name(:no_parent)