From 4564d1349615c1d976b812acb4d7451852a6fbd2 Mon Sep 17 00:00:00 2001 From: Gustavo Paes Date: Sun, 9 Aug 2015 14:38:26 -0300 Subject: [PATCH] Remove SSH button when SSH is disabled --- public/ng/css/gogs.css | 2 +- public/ng/less/gogs/repository.less | 2 +- templates/repo/bare.tmpl | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css index 17c8af909a..16b287a2c4 100644 --- a/public/ng/css/gogs.css +++ b/public/ng/css/gogs.css @@ -1496,7 +1496,7 @@ The register and sign-in page style .repo-bare #repo-header-meta { display: none; } -.repo-bare #repo-clone-ssh { +.repo-bare .btn-first { margin-left: 200px; } .repo-bare #repo-clone-copy { diff --git a/public/ng/less/gogs/repository.less b/public/ng/less/gogs/repository.less index 63c25d06b6..6b0a927e8f 100644 --- a/public/ng/less/gogs/repository.less +++ b/public/ng/less/gogs/repository.less @@ -345,7 +345,7 @@ #repo-header-meta { display: none; } - #repo-clone-ssh { + .btn-first { margin-left: 200px; } #repo-clone-copy { diff --git a/templates/repo/bare.tmpl b/templates/repo/bare.tmpl index d258c60f57..704baa7572 100644 --- a/templates/repo/bare.tmpl +++ b/templates/repo/bare.tmpl @@ -21,9 +21,11 @@

{{.i18n.Tr "repo.clone_this_repo"}}

- - - + {{if not $.DisableSSH}} + + {{end}} + +

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


@@ -34,14 +36,14 @@ git init git add README.md git commit -m "first commit" -git remote add origin {{.CloneLink.SSH}} +git remote add origin {{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}} git push -u origin master

{{.i18n.Tr "repo.push_exist_repo"}}

-
git remote add origin {{.CloneLink.SSH}}
+                        
git remote add origin {{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}
 git push -u origin master