summaryrefslogtreecommitdiff
path: root/app/views/shared/_clone_panel.html.haml
blob: 687a59c270f9f35d5b940aa740ac60b18f453839 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
- project = project || @project

.git-clone-holder
  .btn-group.clone-options
    %a#clone-dropdown.clone-dropdown-btn.btn{href: '#', 'data-toggle' => 'dropdown'}
      %span
        = default_clone_protocol.upcase
      = icon('angle-down')
    %ul.dropdown-menu.dropdown-menu-right.clone-options-dropdown
      %li
        %a#ssh-selector{href: @project.ssh_url_to_repo}
          SSH
      %li
        %a#http-selector{href: @project.http_url_to_repo}
          HTTPS

  = 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')

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