gitea

Development moved to Codeberg

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
<!-- 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}}">
		{{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
	</button>
{{end}}
{{if $.CloneButtonShowSSH}}
	<button class="ui basic clone button no-transition" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">
		SSH
	</button>
{{end}}
<!-- the value will be updated by initRepoCloneLink, the code below is used to avoid UI flicking  -->
<input id="repo-clone-url" value="" size="1" readonly>
<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>
<button class="ui basic icon button tooltip" id="clipboard-btn" data-content="{{.i18n.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url">
	{{svg "octicon-paste"}}
</button>