_project.html.haml 4.75 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 11
        -# We don't use @project.team.find_member because it searches for group members too...
        - member = @project.members.non_request.find_by(user_id: current_user.id)
        - 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
%div{ class: nav_control_class }
Annabel Dunstone's avatar
Annabel Dunstone committed
28
  %ul.nav-links.scrolling-tabs
29
    %li.fade-left
30
      = icon('arrow-left')
31 32
    = nav_link(path: 'projects#show', html_options: {class: 'home'}) do
      = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
33
        %span
34
          Project
35

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

41
    - if project_nav_tab? :files
42
      = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare repositories tags branches releases network)) do
43
        = link_to project_files_path(@project), title: 'Repository',  class: 'shortcuts-tree' do
44
          %span
45
            Repository
Kamil Trzcinski's avatar
WIP  
Kamil Trzcinski committed
46

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

53 54 55 56
    - 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
57
            Registry
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
58

59 60 61 62 63
    - 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's avatar
Kamil Trzcinski committed
64

65
    - if project_nav_tab? :issues
66
      = nav_link(controller: [:issues, :labels, :milestones]) do
67 68 69 70 71
        = 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)
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
72

73 74 75 76 77 78
    - 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)
79

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

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

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

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