BigW Consortium Gitlab

_clone_panel.html.haml 1018 Bytes
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 10 11 12 13 14 15 16 17 18
    - else
      %a#clone-dropdown.clone-dropdown-btn.btn{href: '#', data: { toggle: 'dropdown' }}
        %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 22
  = 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')
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
  });