gitlab-org--gitlab-foss/app/views/shared/_clone_panel.html.haml
Dmitry Medvinsky 92544df8da Fix auto-selection of URL field with X11 selection
We use `focusin` event instead of `click` because when using the latter,
when the selection is created it isn't put into X11 PRIMARY selection.
And as a Linux user I'm very used to such behaviour that when something
gets selected, it's ready for pasting, which is the primary purpose of
the clone URL field.

When `focusin` is used, the selection is copied to X11 buffer
automatically, so it works as expected (tested in Firefox and Chrome).
2015-04-17 10:16:18 +03:00

23 lines
1.3 KiB
Text

- project = project || @project
.git-clone-holder.input-group
.input-group-btn
%button{ |
class: "btn #{ 'active' if default_clone_protocol == 'ssh' }#{ ' has_tooltip' if current_user && current_user.require_ssh_key? }", |
:"data-clone" => project.ssh_url_to_repo, |
:"data-title" => "Add an SSH key to your profile<br> to pull or push via SSH",
:"data-html" => "true",
:"data-container" => "body"}
SSH
%button{ |
class: "btn #{ 'active' if default_clone_protocol == 'http' }#{ ' has_tooltip' if current_user && current_user.require_password? }", |
:"data-clone" => project.http_url_to_repo, |
:"data-title" => "Set a password on your account<br> to pull or push via #{gitlab_config.protocol.upcase}",
:"data-html" => "true",
:"data-container" => "body"}
= gitlab_config.protocol.upcase
= text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true
- if project.kind_of?(Project)
.input-group-addon
.visibility-level-label.has_tooltip{'data-title' => "#{visibility_level_label(project.visibility_level)} project" }
= visibility_level_icon(project.visibility_level)
= visibility_level_label(project.visibility_level).downcase