diff options
author | Gustavo Paes <gustavo.paes@gmail.com> | 2015-08-09 14:38:26 -0300 |
---|---|---|
committer | Gustavo Paes <gustavo.paes@gmail.com> | 2015-08-09 15:03:46 -0300 |
commit | 4564d1349615c1d976b812acb4d7451852a6fbd2 (patch) | |
tree | 98843004aa760de33b5cd83d3330de85b4f8efd4 /templates/repo/bare.tmpl | |
parent | 8a3ee795d2d069bbb57b3d134367078c8e8391d5 (diff) | |
download | gitea-4564d1349615c1d976b812acb4d7451852a6fbd2.tar.gz gitea-4564d1349615c1d976b812acb4d7451852a6fbd2.zip |
Remove SSH button when SSH is disabled
Diffstat (limited to 'templates/repo/bare.tmpl')
-rw-r--r-- | templates/repo/bare.tmpl | 12 |
1 files changed, 7 insertions, 5 deletions
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 @@ <div class="panel-content"> <div id="repo-clone" class="clear text-center"> <h2>{{.i18n.Tr "repo.clone_this_repo"}}</h2> - <button class="btn btn-blue current left btn-left-radius" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">SSH</button> - <button class="btn btn-gray left" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">HTTPS</button> - <input id="repo-clone-url" type="text" class="ipt ipt-disabled left" value="{{.CloneLink.SSH}}" onclick="this.select()" readonly /> + {{if not $.DisableSSH}} + <button class="btn btn-blue btn-first current left btn-left-radius" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">SSH</button> + {{end}} + <button class="btn {{if $.DisableSSH}}btn-first btn-blue current{{else}}btn-gray{{end}} left" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">HTTPS</button> + <input id="repo-clone-url" type="text" class="ipt ipt-disabled left" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" onclick="this.select()" readonly /> <button class="btn btn-black left btn-right-radius" id="repo-clone-copy" data-copy-val="val" data-copy-from="#repo-clone-url">{{.i18n.Tr "repo.copy_link"}}</button> <p class="text-center" id="repo-clone-help">{{.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</p> <hr/> @@ -34,14 +36,14 @@ git init git add README.md git commit -m "first commit" -git remote add origin <span class="clone-url">{{.CloneLink.SSH}}</span> +git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span> git push -u origin master</code></pre> <br/> <hr/> </div> <div id="repo-bare-remote" class="text-center"> <h2>{{.i18n.Tr "repo.push_exist_repo"}}</h2> - <pre class="text-left radius"><code>git remote add origin <span class="clone-url">{{.CloneLink.SSH}}</span> + <pre class="text-left radius"><code>git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span> git push -u origin master</code></pre> <br/> </div> |