diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-02 03:12:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-02 03:12:29 +0300 |
commit | 88ce9b624561a2a5836c623bdd07a81ffc611da7 (patch) | |
tree | 01288a1f7b54888b677548173697e8c20a344cb0 /app/views | |
parent | d170c7eeef81debb74afa518c256358ccb7e231c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/buttons/_clone.html.haml | 99 |
1 files changed, 50 insertions, 49 deletions
diff --git a/app/views/projects/buttons/_clone.html.haml b/app/views/projects/buttons/_clone.html.haml index a755cb9f5b0..a8a911adb7d 100644 --- a/app/views/projects/buttons/_clone.html.haml +++ b/app/views/projects/buttons/_clone.html.haml @@ -1,54 +1,55 @@ - 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{ href: '#', data: { toggle: 'dropdown', qa_selector: 'clone_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{ class: dropdown_class, data: { qa_selector: 'clone_dropdown_content' } } - - 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", readonly: true, aria: { label: _('Repository clone URL') }, data: { qa_selector: 'ssh_clone_url_content' } - .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", readonly: true, aria: { label: _('Repository clone URL') }, data: { qa_selector: 'http_clone_url_content' } - .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' - = render_if_exists 'projects/buttons/kerberos_clone_field' - %li.divider.mt-2 - %li.pt-2.gl-dropdown-item - %label.label-bold{ class: 'gl-px-4!' } - = _('Open in your IDE') +- if can?(current_user, :download_code, @project) + .git-clone-holder.js-git-clone-holder + %a#clone-dropdown.gl-button.btn.btn-confirm.clone-dropdown-btn{ href: '#', data: { toggle: 'dropdown', qa_selector: 'clone_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{ class: dropdown_class, data: { qa_selector: 'clone_dropdown_content' } } - if ssh_enabled? - - escaped_ssh_url_to_repo = CGI.escape(project.ssh_url_to_repo) - %a.dropdown-item.open-with-link{ href: 'vscode://vscode.git/clone?url=' + escaped_ssh_url_to_repo } - .gl-dropdown-item-text-wrapper - = _('Visual Studio Code (SSH)') + %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", readonly: true, aria: { label: _('Repository clone URL') }, data: { qa_selector: 'ssh_clone_url_content' } + .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? - - escaped_http_url_to_repo = CGI.escape(project.http_url_to_repo) - %a.dropdown-item.open-with-link{ href: 'vscode://vscode.git/clone?url=' + escaped_http_url_to_repo } - .gl-dropdown-item-text-wrapper - = _('Visual Studio Code (HTTPS)') - - if ssh_enabled? - %a.dropdown-item.open-with-link{ href: 'jetbrains://idea/checkout/git?idea.required.plugins.id=Git4Idea&checkout.repo=' + escaped_ssh_url_to_repo } - .gl-dropdown-item-text-wrapper - = _('IntelliJ IDEA (SSH)') - - if http_enabled? - %a.dropdown-item.open-with-link{ href: 'jetbrains://idea/checkout/git?idea.required.plugins.id=Git4Idea&checkout.repo=' + escaped_http_url_to_repo } - .gl-dropdown-item-text-wrapper - = _('IntelliJ IDEA (HTTPS)') - - if show_xcode_link?(@project) - %a.dropdown-item.open-with-link{ href: xcode_uri_to_repo(@project) } - .gl-dropdown-item-text-wrapper - = _("Xcode") + %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", readonly: true, aria: { label: _('Repository clone URL') }, data: { qa_selector: 'http_clone_url_content' } + .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' + = render_if_exists 'projects/buttons/kerberos_clone_field' + %li.divider.mt-2 + %li.pt-2.gl-dropdown-item + %label.label-bold{ class: 'gl-px-4!' } + = _('Open in your IDE') + - if ssh_enabled? + - escaped_ssh_url_to_repo = CGI.escape(project.ssh_url_to_repo) + %a.dropdown-item.open-with-link{ href: 'vscode://vscode.git/clone?url=' + escaped_ssh_url_to_repo } + .gl-dropdown-item-text-wrapper + = _('Visual Studio Code (SSH)') + - if http_enabled? + - escaped_http_url_to_repo = CGI.escape(project.http_url_to_repo) + %a.dropdown-item.open-with-link{ href: 'vscode://vscode.git/clone?url=' + escaped_http_url_to_repo } + .gl-dropdown-item-text-wrapper + = _('Visual Studio Code (HTTPS)') + - if ssh_enabled? + %a.dropdown-item.open-with-link{ href: 'jetbrains://idea/checkout/git?idea.required.plugins.id=Git4Idea&checkout.repo=' + escaped_ssh_url_to_repo } + .gl-dropdown-item-text-wrapper + = _('IntelliJ IDEA (SSH)') + - if http_enabled? + %a.dropdown-item.open-with-link{ href: 'jetbrains://idea/checkout/git?idea.required.plugins.id=Git4Idea&checkout.repo=' + escaped_http_url_to_repo } + .gl-dropdown-item-text-wrapper + = _('IntelliJ IDEA (HTTPS)') + - if show_xcode_link?(@project) + %a.dropdown-item.open-with-link{ href: xcode_uri_to_repo(@project) } + .gl-dropdown-item-text-wrapper + = _("Xcode") |