BigW Consortium Gitlab

_project.html.haml 4.74 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
        -# We don't use @project.team.find_member because it searches for group members too...
10
        - member = @project.members.find_by(user_id: current_user.id)
11
        - can_leave = member && can?(current_user, :destroy_project_member, member)
12

13
        = render 'layouts/nav/project_settings', can_edit: can_edit
14

15
        - if can_edit || can_leave
16 17 18 19 20
          %li.divider
          - if can_edit
            %li
              = link_to edit_project_path(@project) do
                Edit Project
21
          - if can_leave
22 23
            %li
              = link_to polymorphic_path([:leave, @project, :members]),
24
                data: { confirm: leave_confirmation_message(@project) }, method: :delete, title: 'Leave project' do
25
                Leave Project
26

27 28
.scrolling-tabs-container{ class: nav_control_class }
  .fade-left
29
    = icon('angle-left')
30
  .fade-right
31
    = icon('angle-right')
32
  %ul.nav-links.scrolling-tabs
33 34
    = nav_link(path: 'projects#show', html_options: {class: 'home'}) do
      = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
35
        %span
36
          Project
37

38 39
    = nav_link(path: 'projects#activity') do
      = link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do
40
        %span
41
          Activity
42

43
    - if project_nav_tab? :files
44
      = 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
45
        = link_to project_files_path(@project), title: 'Repository',  class: 'shortcuts-tree' do
46
          %span
Stan Hu committed
47
            Repository
Kamil Trzcinski committed
48

49
    - if project_nav_tab? :pipelines
50
      = nav_link(controller: [:pipelines, :builds, :environments]) do
51 52 53
        = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do
          %span
            Pipelines
54

55 56 57 58
    - 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
59
            Registry
60

61 62 63 64 65
    - 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
66

67
    - if project_nav_tab? :issues
68
      = nav_link(controller: [:issues, :labels, :milestones]) do
69 70 71 72 73
        = link_to url_for_project_issues(@project, only_path: true), title: 'Issues', class: 'shortcuts-issues' do
          %span
            Issues
            - if @project.default_issues_tracker?
              %span.badge.count.issue_counter= number_with_delimiter(@project.issues.visible_to_user(current_user).opened.count)
74

75 76 77 78 79 80
    - 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
            %span.badge.count.merge_counter= number_with_delimiter(@project.merge_requests.opened.count)
81

82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    - 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
99

100
    -# Shortcut to create a new issue
101
    %li.hidden
102 103
      = link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'shortcuts-new-issue' do
        Create a new issue
104

105 106 107 108 109 110
    -# Shortcut to builds page
    - if project_nav_tab? :builds
      %li.hidden
        = link_to project_builds_path(@project), title: 'Builds', class: 'shortcuts-builds' do
          Builds

111 112 113 114 115
    -# Shortcut to commits page
    - if project_nav_tab? :commits
      %li.hidden
        = link_to project_commits_path(@project), title: 'Commits', class: 'shortcuts-commits' do
          Commits