- @pagetitle = "Repositories of #{@project.name}"
- @metarobots = "noindex"
- project_bread_crumb
- if @package
  - @crumb_list << link_to(@package, package_show_path(package: @package))
- @crumb_list << "Repositories"

- if @package
  = render partial: "webui/package/tabs"
- else
  = render partial: "webui/project/tabs"

- if @package
  - if @package.project == @project
    %p
      You can configure individual flags for this package here. The repositories are inherited from the project
      = link_to @project, controller: :repositories, action: :index, project: @project
    = render partial: 'shared/repositories', locals: { obj: @package }
  - else
    %p
      This package is inherited from the project
      = link_to @package.project, action: :index, controller: :repositories, project: @package.project
      and changing repository flags has no effect.
- else
  %h3
    = @pagetitle
  %p
    You can configure individual flags for this project here.

  #repository-list
    - @project.repositories.each do |repository|
      = render partial: "repository_entry", locals: { repository: repository }

  - if User.current.is_admin?
    %div.hidden.add-dod-repository-form
      = render partial: "dod_repository_form", locals: { project: @project, download_on_demand: DownloadRepository.new }
    %p
      = link_to(sprite_tag("drive_add", title: "Add DoD repository") + " Add DoD repository", "#", id: "add-dod-repository-link")
  - if User.current.can_modify_project?(@project)
    %p
      = link_to(sprite_tag("drive_add", title: "Add repository") + " Add repositories", action: :distributions, project: @project)

  = render partial: "shared/repositories", locals: { obj: @project }
