<div id="modal_merge_node" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
  <%= form_tag project_node_merge_path(current_project, @node), class: 'form-horizontal modal-node-selection-form', data: { node_id: @node.id, hidden_field: '#target_id' } do |f| %>
    <%= hidden_field_tag :target_id %>
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="modal-title">Merge <%= @node.label %> node</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-hidden="true">
            <span class="visually-hidden">Close modal</span>
          </button>
        </div>
        <div class="modal-body">
          <p>Which node do you want to merge <strong><%= @node.label %></strong> into?</p>

          <div class="tree-modal-box">
            <%= render "layouts/hera/nodes" %>
          </div>
          <p id="merge-under">
            <span>This will merge <strong><%= @node.label %></strong> into: <strong><span id="current-selection"></span></strong></span>
          </p>
          <div class="alert alert-warning mb-0">
            <p>Note that this node's methodology will not be copied over. You can find it in the Trash and recover it after if needed.</p>
          </div>
        </div>
        <div class="modal-footer">
          <button class="btn btn-primary">Merge</button>
          <button class="btn" type="button" data-bs-dismiss="modal" aria-hidden="true">Close</button>
        </div>
      </div>
    </div>
  <% end %>
</div>
