BigW Consortium Gitlab

_clone_panel.html.haml 1.02 KB
Newer Older
1
- project = project || @project
2

3 4
.git-clone-holder.input-group
  .input-group-btn
5
    - if allowed_protocols_present?
6
      .clone-dropdown-btn.btn.btn-static
7
        %span
8
          = enabled_project_button(project, enabled_protocol)
9
    - else
10
      %a#clone-dropdown.clone-dropdown-btn.btn{ href: '#', data: { toggle: 'dropdown' } }
11 12 13 14 15 16 17 18
        %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)
19

20 21
  = text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true
  .input-group-btn
22
    = clipboard_button(target: '#project_clone', title: "Copy URL to clipboard")
23 24

:javascript
25 26 27 28
  $('ul.clone-options-dropdown a').on('click',function(e){
    e.preventDefault();
    var $this = $(this);
    $('a.clone-dropdown-btn span').text($this.text());
29
    $('#project_clone').val($this.attr('href'));
30
  });