- if @page.errors.any?
- content_for :notifications do
.notification.notification-danger.animated.fadeInRight
= icon('exclamation')
.notification-message
=t 'spina.notifications.alert'
%small= @page.errors.full_messages.join('
').html_safe
= link_to '#', data: {close_notification: true} do
= icon('cross')
= form_for [spina, :admin, @page], html: {id: 'page_form', autocomplete: "off"} do |f|
%header#header
.breadcrumbs
= render_breadcrumbs separator: '
'
%span{style: 'margin-left: 10px'}
- unless @page.new_record?
- if Spina.config.locales.size > 1
%div{style: "display: inline-block", data: {dropdown: true}}
= link_to '#', class: 'button button-hollow button-small', style: 'margin-left: 0; margin-right: 0', data: {trigger: 'dropdown', target: '#locales'} do
= icon('comment')
=t "languages.#{@locale}"
%i.icon.icon-chevron-down{style: 'font-size: 9px; margin-right: 0'}
%ul#locales
- Spina.config.locales.each do |locale|
%li
= link_to t("languages.#{locale}"), "?locale=#{locale}", style: ('font-weight: 600' if @locale.to_s == locale.to_s).to_s
= link_to @page.materialized_path, target: :blank, class: 'button button-hollow button-small', style: 'margin-left: 0' do
%i.icon.icon-export{style: 'margin: 0'}
#header_actions
%button.button.button-primary{type: 'submit', style: 'margin-right: 0', data: {disable_with: t('spina.pages.saving')}}
= icon('check')
=t 'spina.pages.save'
%nav#secondary.tabs
%ul
- @tabs.each_with_index do |tab, i|
%li{class: (i==0 ? 'active' : '')}
= link_to t("spina.pages.#{tab}"), "##{tab}"
= hidden_field_tag :locale, @locale
- Mobility.with_locale(@locale) do
- @tabs.each do |tab|
= render "spina/admin/pages/form_#{tab}", f: f
- unless @page.new_record? || !@page.deletable
.pull-right= link_to t('spina.permanently_delete'), spina.admin_page_path(@page), method: :delete, data: {confirm: t('spina.pages.delete_confirmation', subject: @page.menu_title)}, class: 'button button-link button-danger'