= inside_layout 'editorial' do
  = content_for :toolbar_actions do
    - if can?(:create_in, @section)
      - if @node
        =link_to 'Edit', new_editorial_node_submission_path(@node)
        =link_to 'New page', prepare_editorial_nodes_path(parent: @node)
      -elsif @section
        =link_to 'New page', prepare_editorial_nodes_path(section: @section.id)

  = yield
= inside_layout 'editorial' do
  = content_for :toolbar_actions do

    - if @node
      - if can?(:update, @node)
        =link_to 'Edit', new_editorial_node_submission_path(@node)
      - if can?(:create_in, @section)
        =link_to 'New page', prepare_editorial_nodes_path(parent: @node)
    -elsif @section && can?(:create_in, @section)
      =link_to 'New page', prepare_editorial_nodes_path(section: @section.id)

  = yield
Change to can? :update @node
Change to can? :update @node
