From 6cceade2da5425a2a1c46ac032263c961e81affb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 12 Aug 2025 08:41:09 +0800 Subject: [PATCH] Sticky footer --- forged/static/style.css | 17 +++++++++++++++-- forged/templates/400.tmpl | 10 ++++++---- forged/templates/400_colon.tmpl | 12 +++++++----- forged/templates/403.tmpl | 10 ++++++---- forged/templates/404.tmpl | 8 +++++--- forged/templates/451.tmpl | 10 ++++++---- forged/templates/500.tmpl | 10 ++++++---- forged/templates/501.tmpl | 8 +++++--- forged/templates/group.tmpl | 118 +++++++++++++++++++++++++++-------------------------- forged/templates/index.tmpl | 86 +++++++++++++++++++++++++++-------------------------- forged/templates/login.tmpl | 82 +++++++++++++++++++++++++++-------------------------- forged/templates/repo_branches.tmpl | 111 ++++++++++++++++++++++++++++------------------------- forged/templates/repo_commit.tmpl | 186 +++++++++++++++++++++++++++-------------------------- forged/templates/repo_contrib_index.tmpl | 120 +++++++++++++++++++++++++++-------------------------- forged/templates/repo_contrib_one.tmpl | 200 +++++++++++++++++++++++++++-------------------------- forged/templates/repo_index.tmpl | 144 +++++++++++++++++++++++++++-------------------------- forged/templates/repo_log.tmpl | 136 +++++++++++++++++++++++++++-------------------------- forged/templates/repo_raw_dir.tmpl | 130 +++++++++++++++++++++++++++-------------------------- forged/templates/repo_tree_dir.tmpl | 142 +++++++++++++++++++++++++++-------------------------- forged/templates/repo_tree_file.tmpl | 88 +++++++++++++++++++++++++++-------------------------- diff --git a/forged/static/style.css b/forged/static/style.css index 51846a27ecae1ad47fa1e0514c370dc43ca21939..13a2c8eb5f199fbc2d5de2ad9fe0dcbc7a232744 100644 --- a/forged/static/style.css +++ b/forged/static/style.css @@ -86,10 +86,8 @@ } /* Footer styles */ footer { - margin-top: 1rem; margin-left: auto; margin-right: auto; - margin-bottom: 1rem; display: block; padding: 0 5px; width: fit-content; @@ -102,6 +100,21 @@ } .padding { padding: 0 1rem; +} + +/* Sticky footer */ +body { + position: relative; + min-height: 100vh; +} +main { + padding-bottom: 2.5rem; +} +footer { + position: absolute; + bottom: 0; + width: 100%; + height: 2rem; } /* Link styles */ diff --git a/forged/templates/400.tmpl b/forged/templates/400.tmpl index 9c96ca5dbb920c5686d6aaa01d3a383d791c0790..5bb2185a11a9c20ed4fba504810b9e55a6b42b3f 100644 --- a/forged/templates/400.tmpl +++ b/forged/templates/400.tmpl @@ -11,10 +11,12 @@ 400 Bad Request – {{ .global.forge_title }} {{- template "header" . -}} -
-

400 Bad Request

-

{{- .complete_error_msg -}}

-
+
+
+

400 Bad Request

+

{{- .complete_error_msg -}}

+
+
diff --git a/forged/templates/400_colon.tmpl b/forged/templates/400_colon.tmpl index c5f72a340f46829195a7b390757b20b8f6757318..6509c0f690f74082938ba9ca11353151c8e3f29b 100644 --- a/forged/templates/400_colon.tmpl +++ b/forged/templates/400_colon.tmpl @@ -11,11 +11,13 @@ 400 Bad Request – {{ .global.forge_title }} {{- template "header" . -}} -
-

400 Bad Request

-

We recently switched URL schemes. Previously “:” was used as our URL group separator, but because OpenSMTPD does not implement local-part address quoting properly, we’re unable to include “:” in URLs properly, hence we use “-” now.

-

As a precaution in case visitors get confused, this page was set up. You should probably replace the “:”s with “-”s in the URL bar. If there are colons in the URL that is not the group separator—that’s an edge case that we’ll fix later.

-
+
+
+

400 Bad Request

+

We recently switched URL schemes. Previously “:” was used as our URL group separator, but because OpenSMTPD does not implement local-part address quoting properly, we’re unable to include “:” in URLs properly, hence we use “-” now.

+

As a precaution in case visitors get confused, this page was set up. You should probably replace the “:”s with “-”s in the URL bar. If there are colons in the URL that is not the group separator—that’s an edge case that we’ll fix later.

+
+
diff --git a/forged/templates/403.tmpl b/forged/templates/403.tmpl index 4908c388c81f5bd89af0ee9af4b456730d020fb3..5090c60bd0982216b8b2f09901210b8b7b542efa 100644 --- a/forged/templates/403.tmpl +++ b/forged/templates/403.tmpl @@ -11,10 +11,12 @@ 403 Forbidden – {{ .global.forge_title }} {{- template "header" . -}} -
-

403 Forbidden

-

{{- .complete_error_msg -}}

-
+
+
+

403 Forbidden

+

{{- .complete_error_msg -}}

+
+
diff --git a/forged/templates/404.tmpl b/forged/templates/404.tmpl index d9485ef192292a7ffd72fbcb06ac49fccd374aa4..10ee1b33527e409eb872b1d1ed73079f1c311e50 100644 --- a/forged/templates/404.tmpl +++ b/forged/templates/404.tmpl @@ -11,9 +11,11 @@ 404 Not Found – {{ .global.forge_title }} {{- template "header" . -}} -
-

404 Not Found

-
+
+
+

404 Not Found

+
+
diff --git a/forged/templates/451.tmpl b/forged/templates/451.tmpl index 510f96c500ed7cede4092edf678a642f132230bd..962fd90c8421248f3bccdc109849e8022dc0d132 100644 --- a/forged/templates/451.tmpl +++ b/forged/templates/451.tmpl @@ -11,10 +11,12 @@ 451 Unavailable For Legal Reasons – {{ .global.forge_title }} {{- template "header" . -}} -
-

451 Unavailable For Legal Reasons

-

{{- .complete_error_msg -}}

-
+
+
+

451 Unavailable For Legal Reasons

+

{{- .complete_error_msg -}}

+
+
diff --git a/forged/templates/500.tmpl b/forged/templates/500.tmpl index b1dc15dbc889f8e3c9c5dfdd124016d66f3cf625..38603d58057bf35f17d405f3f41fdcac40c61f70 100644 --- a/forged/templates/500.tmpl +++ b/forged/templates/500.tmpl @@ -11,10 +11,12 @@ 500 Internal Server Error – {{ .global.forge_title }} {{- template "header" . -}} -
-

500 Internal Server Error

-

{{- .complete_error_msg -}}

-
+
+
+

500 Internal Server Error

+

{{- .complete_error_msg -}}

+
+
diff --git a/forged/templates/501.tmpl b/forged/templates/501.tmpl index d982bfcfd8a0199eb24dfaad8e691e0a26a90c8a..f17b62ef26fb3f37c9acd4d9018a21126cf46411 100644 --- a/forged/templates/501.tmpl +++ b/forged/templates/501.tmpl @@ -11,9 +11,11 @@ 501 Not Implemented – {{ .global.forge_title }} {{- template "header" . -}} -
-

501 Not Implemented

-
+
+
+

501 Not Implemented

+
+
diff --git a/forged/templates/group.tmpl b/forged/templates/group.tmpl index b15c3160c56b51899306d790acf4e47d9d90b6e0..3338f9b0c1b19ee53b60d4e5df86131b5c9a3be2 100644 --- a/forged/templates/group.tmpl +++ b/forged/templates/group.tmpl @@ -12,66 +12,68 @@ {{- range $i, $s := .group_path -}}{{- $s -}}{{- if ne $i (len $group_path) -}}/{{- end -}}{{- end }} – {{ .global.forge_title -}} {{- template "header" . -}} -
- {{- if .description -}} -

{{- .description -}}

- {{- end -}} - {{- template "group_view" . -}} -
- {{- if .direct_access -}} +
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
- Create repo -
Name - -
Description - -
Contrib - -
-
-
-
-
- -
-
-
-
+ {{- if .description -}} +

{{- .description -}}

+ {{- end -}} + {{- template "group_view" . -}}
- {{- end -}} + {{- if .direct_access -}} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Create repo +
Name + +
Description + +
Contrib + +
+
+
+
+
+ +
+
+
+
+
+ {{- end -}} +
diff --git a/forged/templates/index.tmpl b/forged/templates/index.tmpl index bd81f04624e287cc0055ff59b8bcce990ca621d0..66bd17712fac0cd217298dd9ae894d4c9c6a7090 100644 --- a/forged/templates/index.tmpl +++ b/forged/templates/index.tmpl @@ -11,50 +11,52 @@ Index – {{ .global.forge_title -}} {{- template "header" . -}} -
- - - - - - - - - - - - {{- range .groups -}} +
+
+
Groups
NameDescription
+ - - + - {{- end -}} - -
- {{- .Name -}} - - {{- .Description -}} - Groups
- - - - - - - - - - - - - - - - -
- Info -
SSH public key{{- .global.server_public_key_string -}}
SSH fingerprint{{- .global.server_public_key_fingerprint -}}
-
+ + Name + Description + + + + {{- range .groups -}} + + + {{- .Name -}} + + + {{- .Description -}} + + + {{- end -}} + + + + + + + + + + + + + + + + + + +
+ Info +
SSH public key{{- .global.server_public_key_string -}}
SSH fingerprint{{- .global.server_public_key_fingerprint -}}
+ + diff --git a/forged/templates/login.tmpl b/forged/templates/login.tmpl index 1e26c82709184fc6baf137ea489b2e99b5dc0df7..980b8631430dccedf83b995ac6b9a4f0773a6871 100644 --- a/forged/templates/login.tmpl +++ b/forged/templates/login.tmpl @@ -10,47 +10,49 @@ {{- template "head_common" . -}} Login – {{ .global.forge_title -}} - {{- .login_error -}} -
-
- - - - - - - - - - - - - - - - - - - + + +
- Password authentication -
Username - -
Password - -
-
-
-
-
- +
+ {{- .login_error -}} +
+ + + + + + + + + + + + + + + + + + + + - - -
+ Password authentication +
Username + +
Password + +
+
+
+
+
+ +
- -
- -
+
+ +
+ diff --git a/forged/templates/repo_branches.tmpl b/forged/templates/repo_branches.tmpl index 55ea0a65f8826a5673901002dee3d1c500e96a84..c32519daea1e0e6a3e7c69516e36152350e8a034 100644 --- a/forged/templates/repo_branches.tmpl +++ b/forged/templates/repo_branches.tmpl @@ -12,60 +12,65 @@ {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} {{- template "header" . -}} -
-

{{- .repo_name -}}

- -
-
-
- {{- .repo_description -}} +
+
+

{{- .repo_name -}}

+ +
+
+
+ {{- .repo_description -}} +
+
+
+

+ + Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. + +

+ + + + + + + + {{- range .branches -}} + + + + {{- end -}} + +
Branches
+ {{ . }} +
-
-
-

- - Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. - -

- - - - - - - - {{- range .branches -}} - - - - {{- end -}} - -
Branches
- {{ . }} -
-
+ +
+ {{- template "footer" . -}} +
{{- end -}} diff --git a/forged/templates/repo_commit.tmpl b/forged/templates/repo_commit.tmpl index 470bba91f7bfff7da94d3fafdf88d53d351c385e..42f2bcdc4d254b737b34673ca0c0d68e676bbdbc 100644 --- a/forged/templates/repo_commit.tmpl +++ b/forged/templates/repo_commit.tmpl @@ -12,103 +12,105 @@ Commit {{ .commit_id }} – {{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}} {{- template "header" . -}} -
-

{{- .repo_name -}}

- -
-
-
- {{- .repo_description -}} +
+
+

{{- .repo_name -}}

+
-
-
-
-
-
Commit info
-
ID
-
{{- .commit_id -}}
-
Author
-
- {{- .commit_object.Author.Name -}} <{{- .commit_object.Author.Email -}}> -
-
Author date
-
{{- .commit_object.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
-
Committer
-
- {{- .commit_object.Committer.Name -}} <{{- .commit_object.Committer.Email -}}> -
-
Committer date
-
{{- .commit_object.Committer.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
-
Actions
-
- Get patch -
-
+
+
+ {{- .repo_description -}} +
-
- -
-
{{- .commit_object.Message -}}
-
-
- {{- $parent_commit_hash := .parent_commit_hash -}} - {{- $commit_object := .commit_object -}} - {{- range .file_patches -}} -
- -