2014-01-07 22:03:27 -05:00
|
|
|
- project = project || @project
|
2015-12-18 17:12:47 -05:00
|
|
|
|
2016-01-14 11:42:15 -05:00
|
|
|
.git-clone-holder.input-group
|
|
|
|
.input-group-btn
|
2016-12-23 05:27:41 -05:00
|
|
|
- if allowed_protocols_present?
|
2016-06-29 16:26:02 -04:00
|
|
|
.clone-dropdown-btn.btn.btn-static
|
2016-06-15 18:30:55 -04:00
|
|
|
%span
|
2016-06-29 16:26:02 -04:00
|
|
|
= enabled_project_button(project, enabled_protocol)
|
2016-06-15 18:30:55 -04:00
|
|
|
- else
|
2016-12-26 05:47:16 -05:00
|
|
|
%a#clone-dropdown.clone-dropdown-btn.btn{ href: '#', data: { toggle: 'dropdown' } }
|
2016-06-15 18:30:55 -04:00
|
|
|
%span
|
|
|
|
= default_clone_protocol.upcase
|
|
|
|
= icon('caret-down')
|
|
|
|
%ul.dropdown-menu.dropdown-menu-right.clone-options-dropdown
|
|
|
|
%li
|
|
|
|
= ssh_clone_button(project)
|
|
|
|
%li
|
|
|
|
= http_clone_button(project)
|
2015-12-18 17:12:47 -05:00
|
|
|
|
2015-12-23 12:43:27 -05:00
|
|
|
= text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true
|
|
|
|
.input-group-btn
|
|
|
|
= clipboard_button(clipboard_target: '#project_clone')
|
2015-12-18 17:12:47 -05:00
|
|
|
|
|
|
|
:javascript
|
2015-12-23 12:43:27 -05:00
|
|
|
$('ul.clone-options-dropdown a').on('click',function(e){
|
|
|
|
e.preventDefault();
|
|
|
|
var $this = $(this);
|
|
|
|
$('a.clone-dropdown-btn span').text($this.text());
|
2015-12-23 19:57:30 -05:00
|
|
|
$('#project_clone').val($this.attr('href'));
|
2015-12-23 12:43:27 -05:00
|
|
|
});
|