From e68b9d00a6e05b3a941f63ffb696f91e554ac5ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.3. Signed-off-by: Daniel Baumann --- templates/status/404.tmpl | 14 ++++++++++ templates/status/413.tmpl | 11 ++++++++ templates/status/500.tmpl | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 templates/status/404.tmpl create mode 100644 templates/status/413.tmpl create mode 100644 templates/status/500.tmpl (limited to 'templates/status') diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl new file mode 100644 index 0000000..f9a6e18 --- /dev/null +++ b/templates/status/404.tmpl @@ -0,0 +1,14 @@ +{{template "base/head" .}} +
+ {{if .IsRepo}}{{template "repo/header" .}}{{end}} +
+

404

+

{{if .NotFoundPrompt}}{{.NotFoundPrompt}}{{else}}{{ctx.Locale.Tr "error404"}}{{end}}

+ {{if .NotFoundGoBackURL}}{{ctx.Locale.Tr "go_back"}}{{end}} + +
+
+ {{if .ShowFooterVersion}}

{{ctx.Locale.Tr "admin.config.app_ver"}}: {{AppVer}}

{{end}} +
+
+{{template "base/footer" .}} diff --git a/templates/status/413.tmpl b/templates/status/413.tmpl new file mode 100644 index 0000000..75cb3d0 --- /dev/null +++ b/templates/status/413.tmpl @@ -0,0 +1,11 @@ +{{template "base/head" .}} +
+ {{if .IsRepo}}{{template "repo/header" .}}{{end}} +
+

413

+

{{ctx.Locale.Tr "error413"}}

+
+
+
+
+{{template "base/footer" .}} diff --git a/templates/status/500.tmpl b/templates/status/500.tmpl new file mode 100644 index 0000000..59f7c25 --- /dev/null +++ b/templates/status/500.tmpl @@ -0,0 +1,71 @@ +{{/* This page should only depend the minimal template functions/variables, to avoid triggering new panics. +* base template functions: AppName, AssetUrlPrefix, AssetVersion, AppSubUrl, ThemeName +* ctx.Locale +* .Flash +* .ErrorMsg +* .SignedUser (optional) +*/}} + + + + + {{ctx.Locale.Tr "error.server_internal"}} - {{AppDisplayName}} + + + {{template "base/head_style" .}} + + +
+ +
+
+
+ + {{template "base/alert" .}} +
+
+

500

+

{{ctx.Locale.Tr "error.server_internal"}}

+
+
+
+ {{if .ErrorMsg}} +

{{ctx.Locale.Tr "error.occurred"}}:

+
{{.ErrorMsg}}
+ {{end}} +
+ {{if or .SignedUser.IsAdmin .ShowFooterVersion}}

{{ctx.Locale.Tr "admin.config.app_ver"}}: {{AppVer}}

{{end}} + {{if .SignedUser.IsAdmin}}

{{ctx.Locale.Tr "error.report_message" "https://codeberg.org/forgejo/forgejo/issues"}}

{{end}} +
+
+
+
+ + {{/* When a sub-template triggers an 500 error, its parent template has been partially rendered, then the 500 page + will be rendered after that partially rendered page, the HTML/JS are totally broken. Use this inline script to try to move it to main viewport. + And this page shouldn't include any other JS file, avoid duplicate JS execution (still due to the partial rendering).*/}} + + + -- cgit v1.2.3