BigW Consortium Gitlab

_project.html.haml 4.52 KB
Newer Older
1 2
- if current_user
  .controls
3
    .dropdown.project-settings-dropdown
4 5 6 7
      %a.dropdown-new.btn.btn-default#project-settings-button{href: '#', 'data-toggle' => 'dropdown'}
        = icon('cog')
        = icon('caret-down')
      %ul.dropdown-menu.dropdown-menu-align-right
8
        - can_edit = can?(current_user, :admin_project, @project)
9

10
        = render 'layouts/nav/project_settings', can_edit: can_edit
11

12
        - if can_edit
13
          %li.divider
14 15 16
          %li
            = link_to edit_project_path(@project) do
              Edit Project
17

18 19
.scrolling-tabs-container{ class: nav_control_class }
  .fade-left
20
    = icon('angle-left')
21
  .fade-right
22
    = icon('angle-right')
23
  %ul.nav-links.scrolling-tabs
24 25
    = nav_link(path: 'projects#show', html_options: {class: 'home'}) do
      = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
26
        %span
27
          Project
28

29 30
    = nav_link(path: 'projects#activity') do
      = link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do
31
        %span
32
          Activity
33

34
    - if project_nav_tab? :files
35
      = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare repositories tags branches releases network)) do
Stan Hu committed
36
        = link_to project_files_path(@project), title: 'Repository',  class: 'shortcuts-tree' do
37
          %span
Stan Hu committed
38
            Repository
Kamil Trzcinski committed
39

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

46 47 48 49
    - if project_nav_tab? :container_registry
      = nav_link(controller: %w(container_registry)) do
        = link_to project_container_registry_path(@project), title: 'Container Registry', class: 'shortcuts-container-registry' do
          %span
50
            Registry
51

52 53 54 55 56
    - if project_nav_tab? :graphs
      = nav_link(controller: %w(graphs)) do
        = link_to namespace_project_graph_path(@project.namespace, @project, current_ref), title: 'Graphs',  class: 'shortcuts-graphs' do
          %span
            Graphs
Kamil Trzcinski committed
57

58
    - if project_nav_tab? :issues
59
      = nav_link(controller: [:issues, :labels, :milestones, :boards]) do
60
        = link_to namespace_project_issues_path(@project.namespace, @project), title: 'Issues', class: 'shortcuts-issues' do
61 62 63
          %span
            Issues
            - if @project.default_issues_tracker?
64
              %span.badge.badge-dark.count.issue_counter= number_with_delimiter(IssuesFinder.new(current_user, project_id: @project.id).execute.opened.count)
65

66 67 68 69 70
    - if project_nav_tab? :merge_requests
      = nav_link(controller: :merge_requests) do
        = link_to namespace_project_merge_requests_path(@project.namespace, @project), title: 'Merge Requests', class: 'shortcuts-merge_requests' do
          %span
            Merge Requests
71
            %span.badge.badge-dark.count.merge_counter= number_with_delimiter(MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened.count)
72

73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
    - 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
        = link_to namespace_project_snippets_path(@project.namespace, @project), title: 'Snippets', class: 'shortcuts-snippets' do
          %span
            Snippets

    -# Global shortcut to network page for compatibility
    - if project_nav_tab? :network
      %li.hidden
        = link_to namespace_project_network_path(@project.namespace, @project, current_ref), title: 'Network', class: 'shortcuts-network' do
          Network
90

91
    -# Shortcut to create a new issue
92
    %li.hidden
93 94
      = link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'shortcuts-new-issue' do
        Create a new issue
95

96 97 98 99 100 101
    -# Shortcut to builds page
    - if project_nav_tab? :builds
      %li.hidden
        = link_to project_builds_path(@project), title: 'Builds', class: 'shortcuts-builds' do
          Builds

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

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