Skip to content

Commit 7319f8d

Browse files
author
Gusted
authored
Merge branch 'main' into improve-dashboard-list
2 parents 3b67a8c + deffe9e commit 7319f8d

File tree

51 files changed

+251
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+251
-131
lines changed

docs/content/doc/developers/guidelines-frontend.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ menu:
2323

2424
Gitea uses [Less CSS](https://lesscss.org), [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue2](https://vuejs.org/v2/guide/) for its frontend.
2525

26-
The HTML pages are rendered by [Go HTML Template](https://pkg.go.dev/html/template)
26+
The HTML pages are rendered by [Go HTML Template](https://pkg.go.dev/html/template).
27+
28+
The source files can be found in the following directories:
29+
* **Less styles:** `web_src/less/`
30+
* **Javascript files:** `web_src/js/`
31+
* **Vue layouts:** `web_src/js/components/`
32+
* **HTML templates:** `templates/`
2733

2834
## General Guidelines
2935

models/admin/main_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import (
1212
)
1313

1414
func TestMain(m *testing.M) {
15-
unittest.MainTest(m, filepath.Join("..", ".."),
16-
"notice.yml",
17-
)
15+
unittest.MainTest(m, &unittest.TestOptions{
16+
GiteaRootPath: filepath.Join("..", ".."),
17+
FixtureFiles: []string{"notice.yml"},
18+
})
1819
}

models/asymkey/main_test.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ func init() {
1818
}
1919

2020
func TestMain(m *testing.M) {
21-
unittest.MainTest(m, filepath.Join("..", ".."),
22-
"gpg_key.yml",
23-
"public_key.yml",
24-
"deploy_key.yml",
25-
"gpg_key_import.yml",
26-
"user.yml",
27-
"email_address.yml",
28-
)
21+
unittest.MainTest(m, &unittest.TestOptions{
22+
GiteaRootPath: filepath.Join("..", ".."),
23+
FixtureFiles: []string{
24+
"gpg_key.yml",
25+
"public_key.yml",
26+
"deploy_key.yml",
27+
"gpg_key_import.yml",
28+
"user.yml",
29+
"email_address.yml",
30+
},
31+
})
2932
}

models/auth/main_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ import (
1212
)
1313

1414
func TestMain(m *testing.M) {
15-
unittest.MainTest(m, filepath.Join("..", ".."),
16-
"login_source.yml",
17-
"oauth2_application.yml",
18-
"oauth2_authorization_code.yml",
19-
"oauth2_grant.yml",
20-
"webauthn_credential.yml",
21-
)
15+
unittest.MainTest(m, &unittest.TestOptions{
16+
GiteaRootPath: filepath.Join("..", ".."),
17+
FixtureFiles: []string{
18+
"login_source.yml",
19+
"oauth2_application.yml",
20+
"oauth2_authorization_code.yml",
21+
"oauth2_grant.yml",
22+
"webauthn_credential.yml",
23+
},
24+
})
2225
}

models/db/paginator/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ import (
1212
)
1313

1414
func TestMain(m *testing.M) {
15-
unittest.MainTest(m, filepath.Join("..", "..", ".."))
15+
unittest.MainTest(m, &unittest.TestOptions{
16+
GiteaRootPath: filepath.Join("..", "..", ".."),
17+
})
1618
}

models/issues/main_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ func init() {
1818
}
1919

2020
func TestMain(m *testing.M) {
21-
unittest.MainTest(m, filepath.Join("..", ".."),
22-
"reaction.yml",
23-
"user.yml",
24-
"repository.yml",
25-
"milestone.yml",
26-
)
21+
unittest.MainTest(m, &unittest.TestOptions{
22+
GiteaRootPath: filepath.Join("..", ".."),
23+
FixtureFiles: []string{
24+
"reaction.yml",
25+
"user.yml",
26+
"repository.yml",
27+
"milestone.yml",
28+
},
29+
})
2730
}

models/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@ func TestFixturesAreConsistent(t *testing.T) {
3737
}
3838

3939
func TestMain(m *testing.M) {
40-
unittest.MainTest(m, "..")
40+
unittest.MainTest(m, &unittest.TestOptions{
41+
GiteaRootPath: "..",
42+
})
4143
}

models/organization/main_test.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ import (
1212
)
1313

1414
func TestMain(m *testing.M) {
15-
unittest.MainTest(m, filepath.Join("..", ".."),
16-
"user.yml",
17-
"org_user.yml",
18-
"team.yml",
19-
"team_repo.yml",
20-
"team_unit.yml",
21-
"team_user.yml",
22-
"repository.yml",
23-
)
15+
unittest.MainTest(m, &unittest.TestOptions{
16+
GiteaRootPath: filepath.Join("..", ".."),
17+
FixtureFiles: []string{
18+
"user.yml",
19+
"org_user.yml",
20+
"team.yml",
21+
"team_repo.yml",
22+
"team_unit.yml",
23+
"team_user.yml",
24+
"repository.yml",
25+
},
26+
})
2427
}

models/project/main_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ import (
1414
)
1515

1616
func TestMain(m *testing.M) {
17-
unittest.MainTest(m, filepath.Join("..", ".."),
18-
"project.yml",
19-
"project_board.yml",
20-
"project_issue.yml",
21-
"repository.yml",
22-
)
17+
unittest.MainTest(m, &unittest.TestOptions{
18+
GiteaRootPath: filepath.Join("..", ".."),
19+
FixtureFiles: []string{
20+
"project.yml",
21+
"project_board.yml",
22+
"project_issue.yml",
23+
"repository.yml",
24+
},
25+
})
2326
}

models/repo/main_test.go

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ import (
1212
)
1313

1414
func TestMain(m *testing.M) {
15-
unittest.MainTest(m, filepath.Join("..", ".."),
16-
"attachment.yml",
17-
"repo_archiver.yml",
18-
"repository.yml",
19-
"repo_unit.yml",
20-
"repo_indexer_status.yml",
21-
"repo_redirect.yml",
22-
"watch.yml",
23-
"star.yml",
24-
"topic.yml",
25-
"repo_topic.yml",
26-
"user.yml",
27-
)
15+
unittest.MainTest(m, &unittest.TestOptions{
16+
GiteaRootPath: filepath.Join("..", ".."),
17+
FixtureFiles: []string{
18+
"attachment.yml",
19+
"repo_archiver.yml",
20+
"repository.yml",
21+
"repo_unit.yml",
22+
"repo_indexer_status.yml",
23+
"repo_redirect.yml",
24+
"watch.yml",
25+
"star.yml",
26+
"topic.yml",
27+
"repo_topic.yml",
28+
"user.yml",
29+
},
30+
})
2831
}

0 commit comments

Comments
 (0)