BigW Consortium Gitlab

_clone_panel.html.haml 836 Bytes
Newer Older
1
- project = project || @project
2

3 4
.git-clone-holder.input-group
  .input-group-btn
5
    %a#clone-dropdown.clone-dropdown-btn.btn{href: '#', 'data-toggle' => 'dropdown'}
6 7
      %span
        = default_clone_protocol.upcase
8
      = icon('caret-down')
9 10
    %ul.dropdown-menu.dropdown-menu-right.clone-options-dropdown
      %li
11
        = ssh_clone_button(project)
12
      %li
13
        = http_clone_button(project)
14

15 16 17
  = 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')
18 19

:javascript
20 21 22 23
  $('ul.clone-options-dropdown a').on('click',function(e){
    e.preventDefault();
    var $this = $(this);
    $('a.clone-dropdown-btn span').text($this.text());
24
    $('#project_clone').val($this.attr('href'));
25
  });