Skip to content

Commit

Permalink
Add default value for clone URLs
Browse files Browse the repository at this point in the history
Default clone URLs to HTTP(S) in DOM rendering. JS will immediately
replace this if the user preference is SSH.

Fixes: go-gitea#20558
  • Loading branch information
silverwind committed Aug 1, 2022
1 parent 03a32cd commit 7b7dca2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/repo/clone_buttons.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
SSH
</button>
{{end}}
<input id="repo-clone-url" class="js-clone-url" value="" size="1" readonly>
<input id="repo-clone-url" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" size="1" readonly>
<button class="ui basic icon button tooltip" id="clipboard-btn" data-content="{{.i18n.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.i18n.Tr "copy_url"}}">
{{svg "octicon-paste"}}
</button>
4 changes: 2 additions & 2 deletions templates/repo/empty.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ git init
{{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
git add README.md
git commit -m "first commit"
git remote add origin <span class="js-clone-url"></span>
git remote add origin <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
git push -u origin {{.Repository.DefaultBranch}}</code></pre>
</div>
</div>
Expand All @@ -46,7 +46,7 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre>
<div class="item">
<h3>{{.i18n.Tr "repo.push_exist_repo"}}</h3>
<div class="markup">
<pre><code>git remote add origin <span class="js-clone-url"></span>
<pre><code>git remote add origin <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
git push -u origin {{.Repository.DefaultBranch}}</code></pre>
</div>
</div>
Expand Down

0 comments on commit 7b7dca2

Please # to comment.