:ruby
  content_for(:meta_title, @project.title.presence || @project)
  content_for(:meta_description, @project.description)
  @pagetitle = "Show #{@project}"
  render partial: 'webui/project/show_actions', locals: { project: @project,
                                                          packages: @packages,
                                                          open_release_requests: @open_release_requests,
                                                          release_targets: @release_targets }

.card.mb-3
  = render partial: 'tabs', locals: { project: @project }
  .card-body
    .d-flex.justify-content-between.mb-2
      %h3#project-title
        = @project.title.presence || @project
      - if User.session
        .d-inline.ms-1#watchlist-icon-wrapper
          = render WatchlistIconComponent.new(user: User.session,
                                              project: @project,
                                              current_object: @project)
    .row
      .col-md-8
        = render partial: 'basic_info', locals: { project: @project }
      .col-md-4
        = render partial: 'side_links', locals: { open_maintenance_incidents: @open_maintenance_incidents,
                                                  project: @project,
                                                  maintained_projects: @maintained_projects,
                                                  nr_of_problem_packages: @nr_of_problem_packages,
                                                  open_release_requests: @open_release_requests,
                                                  release_targets: @release_targets,
                                                  requests: @requests,
                                                  package: @package,
                                                  linking_projects: @linking_projects,
                                                  project_maintenance_project: @project_maintenance_project,
                                                  incoming_requests_size: @incoming_requests_size,
                                                  outgoing_requests_size: @outgoing_requests_size }
.overview
  .build-results
    = render partial: 'webui/shared/buildresult_box', locals: { project: @project.name }
  .list
    .card
      %ul.card-header.nav.nav-tabs.pt-2.px-3.pb-0.flex-nowrap#packages-tabs{ role: 'tablist' }
        %li.nav-item
          %a.nav-link#packages-tab{ href: '#packages', role: 'tab', data: { 'bs-toggle': 'tab' },
          aria: { controls: 'packages', selected: 'false' } }
            Packages
            %span.badge.text-bg-primary
              = @packages.length
        - if @inherited_packages.present?
          %li.nav-item
            %a.nav-link#inherited-packages-tab{ href: '#inherited-packages', role: 'tab', data: { 'bs-toggle': 'tab' },
            aria: { controls: 'inherited-packages', selected: 'false' } }
              Inherited Packages
              %span.badge.text-bg-primary
                = @inherited_packages.length
      .tab-content#packages-tabs-content
        .tab-pane.fade#packages{ role: 'tabpanel', aria: { labelledby: 'packages-tab' } }
          = render partial: 'project_packages', locals: { project: @project, packages: @packages }
        .tab-pane.fade#inherited-packages{ role: 'tabpanel', aria: { labelledby: 'inherited-packages-tab' } }
          = render partial: 'project_inherited_packages', locals: { project: @project, inherited_packages: @inherited_packages }
  .comments
    .card#comments-list
      %h5.card-header.text-word-break-all
        Comments
        %span.badge.text-bg-primary{ id: "comment-counter-project-#{@project.id}" }
          = @comments.length
      .card-body#comments
        = render partial: 'webui/comment/show', locals: { commentable: @project,
          comment_counter_id: "#comment-counter-project-#{@project.id}" }

= render partial: 'linking_projects_dialog', locals: { project: @project, linking_projects: @linking_projects }
- if User.session
  - if @project.locked? && User.session.can_modify?(@project, true)
    = render partial: 'unlock_project_dialog', locals: { project: @project }
  - elsif User.session.can_modify?(@project)
    = render partial: 'edit_project_dialog', locals: { project: @project }
    = render DeleteConfirmationDialogComponent.new(modal_id: 'delete-project-modal',
                                                   method: :delete,
                                                   options: { modal_title: 'Do you really want to remove this project?',
                                                              confirmation_text: "Please confirm deletion of the project '#{@project}'",
                                                              action: project_destroy_path(project: @project) })

- if Flipper.enabled?(:content_moderation, User.possibly_nobody)
  = render partial: 'webui/shared/report_modal'
  = render partial: 'webui/shared/locking_dialog', locals: { commentable: @project, entity_type: 'project' }

- content_for :ready_function do
  initializeDataTable('#inherited-packages-table');
