mirror of
https://github.com/go-gitea/gitea
synced 2024-06-08 22:28:10 +02:00
Merge branch 'main' into lunny/fix_move_column
This commit is contained in:
commit
75d10316a1
|
@ -763,6 +763,8 @@ manage_themes=Escolher o tema padrão
|
|||
manage_openid=Gerir endereços OpenID
|
||||
email_desc=O seu endereço de email principal irá ser usado para notificações, recuperação de senha e, desde que não esteja oculto, operações Git baseados na web.
|
||||
theme_desc=Este será o seu tema padrão em todo o sítio.
|
||||
theme_colorblindness_help=Suporte a temas para daltónicos
|
||||
theme_colorblindness_prompt=O Gitea acabou de obter alguns temas com suporte básico para daltónicos que têm apenas algumas cores definidas. O trabalho ainda está em andamento. Poderiam ser feitos mais melhoramentos se fossem definidas mais cores nos ficheiros CSS do tema.
|
||||
primary=Principal
|
||||
activated=Em uso
|
||||
requires_activation=Tem que ser habilitado
|
||||
|
|
|
@ -68,6 +68,6 @@
|
|||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{if .ReadmeExist}}
|
||||
{{if and .ReadmeExist (or .IsMarkup .IsPlainText)}}
|
||||
{{template "repo/view_file" .}}
|
||||
{{end}}
|
||||
|
|
|
@ -5,8 +5,14 @@ package integration
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
repo_service "code.gitea.io/gitea/services/repository"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -32,4 +38,33 @@ func TestPullCompare(t *testing.T) {
|
|||
doc := NewHTMLParser(t, resp.Body)
|
||||
editButtonCount := doc.doc.Find(".diff-file-header-actions a[href*='/_edit/']").Length()
|
||||
assert.Greater(t, editButtonCount, 0, "Expected to find a button to edit a file in the PR diff view but there were none")
|
||||
|
||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
session := loginUser(t, "user1")
|
||||
testRepoFork(t, session, "user2", "repo1", "user1", "repo1")
|
||||
testCreateBranch(t, session, "user1", "repo1", "branch/master", "master1", http.StatusSeeOther)
|
||||
testEditFile(t, session, "user1", "repo1", "master1", "README.md", "Hello, World (Edited)\n")
|
||||
resp = testPullCreate(t, session, "user1", "repo1", false, "master", "master1", "This is a pull title")
|
||||
|
||||
// the max value on issue_index.yml for repo_id=1 is 5
|
||||
req = NewRequest(t, "GET", "/user2/repo1/pulls/6/files")
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
doc := NewHTMLParser(t, resp.Body)
|
||||
editButtonCount := doc.doc.Find(".diff-file-header-actions a[href*='/_edit/']").Length()
|
||||
assert.Greater(t, editButtonCount, 0, "Expected to find a button to edit a file in the PR diff view but there were none")
|
||||
|
||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||
repoForked := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user1", Name: "repo1"})
|
||||
// delete the head repository and revisit the PR diff view
|
||||
err := repo_service.DeleteRepositoryDirectly(db.DefaultContext, user2, repoForked.ID)
|
||||
assert.NoError(t, err)
|
||||
|
||||
req = NewRequest(t, "GET", "/user2/repo1/pulls/6/files")
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
doc = NewHTMLParser(t, resp.Body)
|
||||
editButtonCount = doc.doc.Find(".diff-file-header-actions a[href*='/_edit/']").Length()
|
||||
assert.EqualValues(t, editButtonCount, 0, "Expected not to find a button to edit a file in the PR diff view because head repository has been deleted")
|
||||
})
|
||||
}
|
||||
|
|
|
@ -151,6 +151,11 @@
|
|||
border-top: none;
|
||||
}
|
||||
|
||||
.ui.attached.segment:has(+ .ui[class*="top attached"].header),
|
||||
.ui.attached.segment:last-child {
|
||||
border-radius: 0 0 0.28571429rem 0.28571429rem;
|
||||
}
|
||||
|
||||
.ui[class*="top attached"].segment {
|
||||
bottom: 0;
|
||||
margin-bottom: 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user