diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl new file mode 100644 index 000000000000..92195283ca03 --- /dev/null +++ b/templates/repo/clone_buttons.tmpl @@ -0,0 +1,35 @@ +{{if not $.DisableHTTP}} + +{{end}} +{{if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} + +{{end}} +{{if not $.DisableHTTP}} + +{{else if and (not .DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} + +{{end}} +{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}} + +{{end}} +{{if not (and $.DisableHTTP $.DisableSSH)}} + +{{end}} diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index b5a39d0a9b18..7dae7c012166 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -18,26 +18,7 @@

{{.i18n.Tr "repo.clone_this_repo"}} {{.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}

- {{if not $.DisableHTTP}} - - {{end}} - {{if not $.DisableSSH}} - - {{end}} - {{if not $.DisableHTTP}} - - {{else}} - - {{end}} - {{if not (and $.DisableHTTP $.DisableSSH)}} - - {{end}} + {{template "repo/clone_buttons" .}}
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 80187a2fbf29..4d8d28921172 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -106,43 +106,10 @@ {{end}}
- {{if eq $n 0}}
- {{if not $.DisableHTTP}} - - {{end}} - {{if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} - - {{end}} - {{if not $.DisableHTTP}} - - {{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} - - {{end}} - - {{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}} - - {{end}} + {{template "repo/clone_buttons" .}}