2022-03-29 11:21:30 +08:00
|
|
|
<!-- there is always at least one button (by context/repo.go) -->
|
|
|
|
{{if $.CloneButtonShowHTTPS}}
|
|
|
|
<button class="ui basic clone button no-transition" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">
|
2020-12-29 02:30:06 +08:00
|
|
|
{{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
|
|
|
|
</button>
|
|
|
|
{{end}}
|
2022-03-29 11:21:30 +08:00
|
|
|
{{if $.CloneButtonShowSSH}}
|
|
|
|
<button class="ui basic clone button no-transition" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">
|
2020-12-29 02:30:06 +08:00
|
|
|
SSH
|
|
|
|
</button>
|
|
|
|
{{end}}
|
2022-03-29 11:21:30 +08:00
|
|
|
<!-- the value will be updated by initRepoCloneLink, the code below is used to avoid UI flicking -->
|
2022-04-27 07:22:11 +08:00
|
|
|
<input id="repo-clone-url" value="" size="1" readonly>
|
2022-03-29 11:21:30 +08:00
|
|
|
<script>
|
|
|
|
(() => {
|
|
|
|
const proto = localStorage.getItem('repo-clone-protocol') || 'https';
|
|
|
|
const btn = document.getElementById(`repo-clone-${proto}`);
|
|
|
|
// it's ok if we don't find the btn here, initRepoCloneLink will take care of it
|
|
|
|
document.getElementById('repo-clone-url').value = btn ? btn.getAttribute('data-link') : '';
|
|
|
|
})();
|
|
|
|
</script>
|
2022-07-29 04:21:36 +08:00
|
|
|
<button class="ui basic icon button tooltip" id="clipboard-btn" data-content="{{.i18n.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.i18n.Tr "copy_url"}}">
|
2022-03-29 11:21:30 +08:00
|
|
|
{{svg "octicon-paste"}}
|
|
|
|
</button>
|