summaryrefslogtreecommitdiff
path: root/app/views/projects/tree/_tree_header.html.haml
blob: eab6d750a02694e7ae853b787ead1fb1dba5ba02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
- can_collaborate = can_collaborate_with_project?(@project)
- can_create_mr_from_fork = can?(current_user, :fork_project, @project) && can?(current_user, :create_merge_request_in, @project)

.tree-ref-container
  .tree-ref-holder
    = render 'shared/ref_switcher', destination: 'tree', path: @path, show_create: true

  #js-repo-breadcrumb{ data: breadcrumb_data_attributes }

.tree-controls
  .d-block.d-sm-flex.flex-wrap.align-items-start.gl-children-ml-sm-3<
    = render_if_exists 'projects/tree/lock_link'
    #js-tree-history-link.d-inline-block{ data: { history_link: project_commits_path(@project, @ref) } }

    = render 'projects/find_file_link'

    - if can_collaborate || current_user&.already_forked?(@project)
      #js-tree-web-ide-link.d-inline-block
    - elsif can_create_mr_from_fork
      = link_to '#modal-confirm-fork', class: 'btn btn-default qa-web-ide-button', data: { target: '#modal-confirm-fork', toggle: 'modal'} do
        = _('Web IDE')
      = render 'shared/confirm_fork_modal', fork_path: ide_fork_and_edit_path(@project, @ref, @path)

    - if show_xcode_link?(@project)
      .project-action-button.project-xcode.inline<
        = render "projects/buttons/xcode_link"

    = render 'projects/buttons/download', project: @project, ref: @ref

    .project-clone-holder.d-none.d-md-inline-block>
      = render "projects/buttons/clone", dropdown_class: 'dropdown-menu-right'

  .project-clone-holder.d-block.d-md-none.mt-sm-2.mt-md-0.ml-sm-2>
    = render "shared/mobile_clone_panel"