- @pagetitle = "Staging for #{@project}"

.row
  .col-xl-10
    .card.mb-3
      = render(partial: 'webui/project/tabs', locals: { project: @project })
      .card-body
        %h3
          = @pagetitle
          - if policy(@staging_workflow).update?
            - content_for(:actions) do
              %li.nav-item
                = link_to(edit_staging_workflow_path(@staging_workflow.project), title: 'Edit Staging', class: 'nav-link') do
                  %i.fas.fa-edit.fa-fw.me-2
                  %span.nav-item-name Edit Staging
          - if policy(@staging_workflow).destroy?
            - content_for(:actions) do
              %li.nav-item
                = link_to('#', title: 'Delete Staging', data: { 'bs-toggle': 'modal', 'bs-target': '#delete-staging-workflow' }, class: 'nav-link') do
                  %i.fas.fa-fw.me-2.fa-times-circle
                  %span.nav-item-name Delete Staging
        - if policy(@staging_workflow).destroy? # This is outside of the h3 to prevent the font in the modal to be oversized
          = render(partial: 'delete', locals: { staging_workflow: @staging_workflow, project: @project })

        = render(partial: 'staging_projects_table',
                 locals: { staging_workflow: @staging_workflow, staging_projects: @staging_projects,
                           users_hash: @users_hash, groups_hash: @groups_hash })

  .col-xl-2
    = render partial: 'webui/staging/shared/legend'
    = render partial: 'infos', locals: { staging_workflow: @staging_workflow, empty_projects: @empty_projects,
                                         unassigned_requests: @unassigned_requests, more_unassigned_requests: @more_unassigned_requests,
                                         ready_requests: @ready_requests, more_ready_requests: @more_ready_requests,
                                         excluded_requests: @excluded_requests, more_excluded_requests: @more_excluded_requests,
                                         project: @project, managers: @managers }
