BigW Consortium Gitlab

_project.html.haml 4.73 KB
Newer Older
1
- can_edit = can?(current_user, :admin_project, @project)
2 3
.scrolling-tabs-container{ class: nav_control_class }
  .fade-left
4
    = icon('angle-left')
5
  .fade-right
6
    = icon('angle-right')
7
  %ul.nav-links.scrolling-tabs
8
    = nav_link(path: ['projects#show', 'projects#activity', 'cycle_analytics#show'], html_options: { class: 'home' }) do
9
      = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
10
        %span
11
          Project
12

13
    - if project_nav_tab? :files
14
      = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare projects/repositories tags branches releases graphs network)) do
15
        = link_to project_tree_path(@project), title: 'Repository',  class: 'shortcuts-tree' do
16
          %span
Stan Hu committed
17
            Repository
Kamil Trzcinski committed
18

19
    - if project_nav_tab? :container_registry
20
      = nav_link(controller: %w[projects/registry/repositories]) do
21
        = link_to project_container_registry_index_path(@project), title: 'Container Registry', class: 'shortcuts-container-registry' do
22
          %span
23
            Registry
24

25
    - if project_nav_tab? :issues
26
      = nav_link(controller: @project.issues_enabled? ? [:issues, :labels, :milestones, :boards] : :issues) do
27
        = link_to project_issues_path(@project), title: 'Issues', class: 'shortcuts-issues' do
28 29
          %span
            Issues
30
            - if @project.issues_enabled?
31
              %span.badge.count.issue_counter= number_with_delimiter(issuables_count_for_state(:issues, :opened, finder: IssuesFinder.new(current_user, project_id: @project.id)))
32

33
    - if project_nav_tab? :merge_requests
34
      - controllers = [:merge_requests, 'projects/merge_requests/conflicts']
35
      - controllers.push(:merge_requests, :labels, :milestones) unless @project.issues_enabled?
36
      = nav_link(controller: controllers) do
37
        = link_to project_merge_requests_path(@project), title: 'Merge Requests', class: 'shortcuts-merge_requests' do
38 39
          %span
            Merge Requests
40
            %span.badge.count.merge_counter.js-merge-counter= number_with_delimiter(issuables_count_for_state(:merge_requests, :opened, finder: MergeRequestsFinder.new(current_user, project_id: @project.id)))
41

42
    - if project_nav_tab? :pipelines
43
      = nav_link(controller: [:pipelines, :builds, :environments, :artifacts]) do
44 45 46 47
        = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do
          %span
            Pipelines

48 49 50 51 52 53 54 55
    - if project_nav_tab? :wiki
      = nav_link(controller: :wikis) do
        = link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki' do
          %span
            Wiki

    - if project_nav_tab? :snippets
      = nav_link(controller: :snippets) do
56
        = link_to project_snippets_path(@project), title: 'Snippets', class: 'shortcuts-snippets' do
57 58 59
          %span
            Snippets

60 61 62 63 64 65
    - if project_nav_tab? :project_members
      = nav_link(controller: :project_members) do
        = link_to project_project_members_path(@project), title: 'Members', class: 'shortcuts-members' do
          %span
            Members

66
    - if project_nav_tab? :settings
67
      = nav_link(path: %w[projects#edit members#show integrations#show services#edit repository#show ci_cd#show pages#show]) do
68 69 70
        = link_to edit_project_path(@project), title: 'Settings', class: 'shortcuts-tree' do
          %span
            Settings
71

72 73 74 75 76 77 78
    -# Shortcut to Project > Activity
    %li.hidden
      = link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do
        %span
          Activity

    -# Shortcut to Repository > Graph (formerly, Network)
79 80
    - if project_nav_tab? :network
      %li.hidden
81
        = link_to project_network_path(@project, current_ref), title: 'Network', class: 'shortcuts-network' do
82 83 84 85 86
          Graph

    -# Shortcut to Repository > Charts (formerly, top-nav item "Graphs")
    - unless @project.empty_repo?
      %li.hidden
87
        = link_to charts_project_graph_path(@project, current_ref), title: 'Charts', class: 'shortcuts-repository-charts' do
88
          Charts
89

90
    -# Shortcut to Issues > New Issue
91
    %li.hidden
92
      = link_to new_project_issue_path(@project), class: 'shortcuts-new-issue' do
93
        Create a new issue
94

95
    -# Shortcut to Pipelines > Jobs
96 97
    - if project_nav_tab? :builds
      %li.hidden
98
        = link_to project_jobs_path(@project), title: 'Jobs', class: 'shortcuts-builds' do
Filipa Lacerda committed
99
          Jobs
100

101 102 103 104 105
    -# Shortcut to commits page
    - if project_nav_tab? :commits
      %li.hidden
        = link_to project_commits_path(@project), title: 'Commits', class: 'shortcuts-commits' do
          Commits
106 107 108

    -# Shortcut to issue boards
    %li.hidden
109
      = link_to 'Issue Boards', project_boards_path(@project), title: 'Issue Boards', class: 'shortcuts-issue-boards'