Files
Gitea/templates/repo/clone_buttons.tmpl
T
TowyTowy 8a3daef525 fix(repo): stop advertising HTTP clone URLs when DISABLE_HTTP_GIT is set (#38378)
Fixes #38339

---------

Signed-off-by: TowyTowy <towy@airreps.link>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-07-17 05:17:28 +00:00

17 lines
902 B
Handlebars

<!-- render the clone combo only when a git protocol is available; the URL input would otherwise be empty -->
{{$cloneLink := $.CloneButtonOriginLink}}
{{if or $cloneLink.SupportHTTPS $cloneLink.SupportSSH}}
<div class="ui action small input clone-buttons-combo" data-global-init="initRepoCloneButtonsCombo">
{{if $cloneLink.SupportHTTPS}}
<button class="ui small button repo-clone-https" data-link="{{$cloneLink.HTTPS}}">HTTPS</button>
{{end}}
{{if $cloneLink.SupportSSH}}
<button class="ui small button repo-clone-ssh" data-link="{{$cloneLink.SSH}}">SSH</button>
{{end}}
<input size="10" class="repo-clone-url js-clone-url" value="{{Iif $cloneLink.SupportHTTPS $cloneLink.HTTPS $cloneLink.SSH}}" readonly>
<button class="ui small icon button" data-clipboard-target=".repo-clone-url" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}">
{{svg "octicon-copy" 14}}
</button>
</div>
{{end}}