Skip to content

Commit 8839549

Browse files
committed
Add default value for clone URLs
Default clone URLs to HTTP(S) in DOM rendering. JS will immediately replace this if the user preference is SSH. Fixes: go-gitea#20558
1 parent 4f14c6d commit 8839549

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

templates/repo/clone_buttons.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
SSH
1010
</button>
1111
{{end}}
12-
<input id="repo-clone-url" class="js-clone-url" value="" size="1" readonly>
12+
<input id="repo-clone-url" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" size="1" readonly>
1313
<button class="ui basic icon button tooltip" id="clipboard-btn" data-content="{{.locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.locale.Tr "copy_url"}}">
1414
{{svg "octicon-paste"}}
1515
</button>

templates/repo/empty.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ git init
3737
{{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
3838
git add README.md
3939
git commit -m "first commit"
40-
git remote add origin <span class="js-clone-url"></span>
40+
git remote add origin <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
4141
git push -u origin {{.Repository.DefaultBranch}}</code></pre>
4242
</div>
4343
</div>
@@ -46,7 +46,7 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre>
4646
<div class="item">
4747
<h3>{{.locale.Tr "repo.push_exist_repo"}}</h3>
4848
<div class="markup">
49-
<pre><code>git remote add origin <span class="js-clone-url"></span>
49+
<pre><code>git remote add origin <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
5050
git push -u origin {{.Repository.DefaultBranch}}</code></pre>
5151
</div>
5252
</div>

0 commit comments

Comments
 (0)