Skip to content

Commit 9f12d5e

Browse files
committed
fix
1 parent 17baf1a commit 9f12d5e

File tree

7 files changed

+14
-6
lines changed

7 files changed

+14
-6
lines changed

public/assets/img/404.png

-4.41 KB
Binary file not shown.

public/assets/img/500.png

-5.11 KB
Binary file not shown.

templates/status/404.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content {{if .IsRepo}}repository{{end}}">
33
{{if .IsRepo}}{{template "repo/header" .}}{{end}}
44
<div class="ui container tw-text-center">
5-
<img class="tw-max-w-[80vw] tw-py-16" src="{{AssetUrlPrefix}}/img/404.png" alt="404">
5+
<div class="status-page-error-code">404 Not Found</div>
66
<p>{{if .NotFoundPrompt}}{{.NotFoundPrompt}}{{else}}{{ctx.Locale.Tr "error404"}}{{end}}</p>
77
{{if .NotFoundGoBackURL}}<a class="ui button" href="{{.NotFoundGoBackURL}}">{{ctx.Locale.Tr "go_back"}}</a>{{end}}
88
</div>

templates/status/500.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
<style> .ui.message.flash-message { text-align: left; } </style>
3535
{{template "base/alert" .}}
3636
</div>
37-
<p class="tw-mt-8 center"><img src="{{AssetUrlPrefix}}/img/500.png" alt="Internal Server Error"></p>
37+
<div class="status-page-error-code">500 Internal Server Error</div>
3838
<div class="divider"></div>
3939
<div class="ui container tw-my-8">
4040
{{if .ErrorMsg}}
4141
<p>{{ctx.Locale.Tr "error.occurred"}}:</p>
4242
<pre class="tw-whitespace-pre-wrap tw-break-all">{{.ErrorMsg}}</pre>
4343
{{end}}
44-
<div class="center tw-mt-8">
44+
<div class="tw-mt-8 tw-text-center">
4545
{{if or .SignedUser.IsAdmin .ShowFooterVersion}}<p>{{ctx.Locale.Tr "admin.config.app_ver"}}: {{AppVer}}</p>{{end}}
4646
{{if .SignedUser.IsAdmin}}<p>{{ctx.Locale.Tr "error.report_message"}}</p>{{end}}
4747
</div>

tests/integration/compare_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"code.gitea.io/gitea/models/db"
1414
"code.gitea.io/gitea/models/unittest"
1515
user_model "code.gitea.io/gitea/models/user"
16+
"code.gitea.io/gitea/modules/test"
1617
repo_service "code.gitea.io/gitea/services/repository"
1718
"code.gitea.io/gitea/tests"
1819

@@ -32,7 +33,7 @@ func TestCompareTag(t *testing.T) {
3233

3334
req = NewRequest(t, "GET", "/user2/repo1/compare/invalid")
3435
resp = session.MakeRequest(t, req, http.StatusNotFound)
35-
assert.False(t, strings.Contains(resp.Body.String(), "/assets/img/500.png"), "expect 404 page not 500")
36+
assert.True(t, test.IsNormalPageCompleted(resp.Body.String()), "expect 404 page not 500")
3637
}
3738

3839
// Compare with inferred default branch (master)

tests/integration/links_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ func TestLinksNoLogin(t *testing.T) {
3737
"/user2/repo1/projects",
3838
"/user2/repo1/projects/1",
3939
"/user2/repo1/releases/tag/delete-tag", // It's the only one existing record on release.yml which has is_tag: true
40-
"/assets/img/404.png",
41-
"/assets/img/500.png",
4240
"/.well-known/security.txt",
4341
}
4442

web_src/css/base.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,15 @@ img.ui.avatar,
477477
padding-bottom: 80px;
478478
}
479479

480+
.status-page-error-code {
481+
font-size: 3em;
482+
line-height: initial;
483+
text-align: center;
484+
padding: 2em 0;
485+
font-weight: var(--font-weight-bold);
486+
color: var(--color-text-light-3);
487+
}
488+
480489
/* add margin below .secondary nav when it is the first child */
481490
.page-content > :first-child.secondary-nav {
482491
margin-bottom: 14px;

0 commit comments

Comments
 (0)