mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Add default value for clone URLs (#20600)
Default clone URLs to HTTP(S) in DOM rendering. JS will immediately replace this if the user preference is SSH. Fixes: https://github.com/go-gitea/gitea/issues/20558 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		@@ -9,7 +9,7 @@
 | 
				
			|||||||
		SSH
 | 
							SSH
 | 
				
			||||||
	</button>
 | 
						</button>
 | 
				
			||||||
{{end}}
 | 
					{{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="{{.locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.locale.Tr "copy_url"}}">
 | 
					<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"}}">
 | 
				
			||||||
	{{svg "octicon-paste"}}
 | 
						{{svg "octicon-paste"}}
 | 
				
			||||||
</button>
 | 
					</button>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,7 @@ git init
 | 
				
			|||||||
{{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
 | 
					{{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
 | 
				
			||||||
git add README.md
 | 
					git add README.md
 | 
				
			||||||
git commit -m "first commit"
 | 
					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>
 | 
					git push -u origin {{.Repository.DefaultBranch}}</code></pre>
 | 
				
			||||||
								</div>
 | 
													</div>
 | 
				
			||||||
							</div>
 | 
												</div>
 | 
				
			||||||
@@ -46,7 +46,7 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre>
 | 
				
			|||||||
							<div class="item">
 | 
												<div class="item">
 | 
				
			||||||
								<h3>{{.locale.Tr "repo.push_exist_repo"}}</h3>
 | 
													<h3>{{.locale.Tr "repo.push_exist_repo"}}</h3>
 | 
				
			||||||
								<div class="markup">
 | 
													<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>
 | 
					git push -u origin {{.Repository.DefaultBranch}}</code></pre>
 | 
				
			||||||
								</div>
 | 
													</div>
 | 
				
			||||||
							</div>
 | 
												</div>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user