summaryrefslogtreecommitdiff
path: root/app/views/projects/buttons/_clone.html.haml
blob: ee195e69a98fbcef62ce6c5e7907485be73259f7 (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
35
36
37
38
39
- project = project || @project
- dropdown_class = local_assigns.fetch(:dropdown_class, '')

.git-clone-holder.js-git-clone-holder
  %a#clone-dropdown.gl-button.btn.btn-confirm.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } }
    %span.gl-mr-2.js-clone-dropdown-label
      = _('Clone')
    = sprite_icon("chevron-down", css_class: "icon")
  %ul.dropdown-menu.dropdown-menu-large.dropdown-menu-selectable.clone-options-dropdown.qa-clone-options{ class: dropdown_class }
    - if ssh_enabled?
      %li{ class: 'gl-px-4!' }
        %label.label-bold
          = _('Clone with SSH')
        .input-group.btn-group
          = text_field_tag :ssh_project_clone, project.ssh_url_to_repo, class: "js-select-on-focus form-control qa-ssh-clone-url", readonly: true, aria: { label: _('Repository clone URL') }
          .input-group-append
            = clipboard_button(target: '#ssh_project_clone', title: _("Copy URL"), class: "input-group-text gl-button btn btn-icon btn-default")
            = render_if_exists 'projects/buttons/geo'
    - if http_enabled?
      %li.pt-2{ class: 'gl-px-4!' }
        %label.label-bold
          = _('Clone with %{http_label}') % { http_label: gitlab_config.protocol.upcase }
        .input-group.btn-group
          = text_field_tag :http_project_clone, project.http_url_to_repo, class: "js-select-on-focus form-control qa-http-clone-url", readonly: true, aria: { label: _('Repository clone URL') }
          .input-group-append
            = clipboard_button(target: '#http_project_clone', title: _("Copy URL"), class: "input-group-text gl-button btn btn-icon btn-default")
            = render_if_exists 'projects/buttons/geo'
      %li.divider.mt-2
      %li.pt-2.gl-new-dropdown-item
        %label.label-bold{ class: 'gl-px-4!' }
          = _('Open in your IDE')
        %a.dropdown-item.open-with-link{ href: 'vscode://vscode.git/clone?url=' + CGI.escape(project.http_url_to_repo) }
          .gl-new-dropdown-item-text-wrapper
            = _('Visual Studio Code')
        - if show_xcode_link?(@project)
          %a.dropdown-item.open-with-link{ href: xcode_uri_to_repo(@project) }
            .gl-new-dropdown-item-text-wrapper
              = _("Xcode")
    = render_if_exists 'projects/buttons/kerberos_clone_field'