mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-27 23:49:44 +08:00
Rearrange Clone Panel (#31142)
Rearrange the clone panel to use less horizontal space. The following changes have been made to achieve this: - Moved everything into the dropdown menu - Moved the HTTPS/SSH Switch to a separate line - Moved the "Clone in VS Code"-Button up and added a divider - Named the dropdown button "Code", added appropriate icon --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -127,10 +127,10 @@ func TestViewRepo1CloneLinkAnonymous(t *testing.T) {
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
link, exists := htmlDoc.doc.Find("#repo-clone-https").Attr("data-link")
|
||||
link, exists := htmlDoc.doc.Find(".repo-clone-https").Attr("data-link")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
assert.Equal(t, setting.AppURL+"user2/repo1.git", link)
|
||||
_, exists = htmlDoc.doc.Find("#repo-clone-ssh").Attr("data-link")
|
||||
_, exists = htmlDoc.doc.Find(".repo-clone-ssh").Attr("data-link")
|
||||
assert.False(t, exists)
|
||||
}
|
||||
|
||||
@ -143,10 +143,10 @@ func TestViewRepo1CloneLinkAuthorized(t *testing.T) {
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
link, exists := htmlDoc.doc.Find("#repo-clone-https").Attr("data-link")
|
||||
link, exists := htmlDoc.doc.Find(".repo-clone-https").Attr("data-link")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
assert.Equal(t, setting.AppURL+"user2/repo1.git", link)
|
||||
link, exists = htmlDoc.doc.Find("#repo-clone-ssh").Attr("data-link")
|
||||
link, exists = htmlDoc.doc.Find(".repo-clone-ssh").Attr("data-link")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
sshURL := fmt.Sprintf("ssh://%s@%s:%d/user2/repo1.git", setting.SSH.User, setting.SSH.Domain, setting.SSH.Port)
|
||||
assert.Equal(t, sshURL, link)
|
||||
|
Reference in New Issue
Block a user