From 14326ba9be276d2649b4681d3ebed1c32f65013f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 13 Feb 2025 01:28:35 +0800 Subject: _header.html: Add header --- templates/_header.html.tmpl | 12 ++++++++++++ templates/_repo_header.html.tmpl | 1 - templates/group_repos.html.tmpl | 3 +++ templates/index.html.tmpl | 3 +++ templates/repo_commit.html.tmpl | 3 +++ templates/repo_index.html.tmpl | 3 +++ templates/repo_log.html.tmpl | 3 +++ templates/repo_raw_dir.html.tmpl | 3 +++ templates/repo_tree_dir.html.tmpl | 3 +++ templates/repo_tree_file.html.tmpl | 3 +++ 10 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 templates/_header.html.tmpl (limited to 'templates') diff --git a/templates/_header.html.tmpl b/templates/_header.html.tmpl new file mode 100644 index 0000000..bfe386a --- /dev/null +++ b/templates/_header.html.tmpl @@ -0,0 +1,12 @@ +{{- define "header" -}} +
+ Lindenii Forge +
+
+ {{ if ne .user_id "" }} + {{ .username }} + {{ else }} + Login + {{ end }} +
+{{- end -}} diff --git a/templates/_repo_header.html.tmpl b/templates/_repo_header.html.tmpl index 8e5baa8..8a7fd4b 100644 --- a/templates/_repo_header.html.tmpl +++ b/templates/_repo_header.html.tmpl @@ -1,5 +1,4 @@ {{- define "repo_header" -}} -Lindenii Forge / {{ .group_name }} / diff --git a/templates/group_repos.html.tmpl b/templates/group_repos.html.tmpl index f24ce97..1050ce4 100644 --- a/templates/group_repos.html.tmpl +++ b/templates/group_repos.html.tmpl @@ -6,6 +6,9 @@ Repos in {{ .group_name }} – Lindenii Forge +
+ {{ template "header" . }} +

Repos in {{ .group_name }} diff --git a/templates/index.html.tmpl b/templates/index.html.tmpl index e88b568..a8ef445 100644 --- a/templates/index.html.tmpl +++ b/templates/index.html.tmpl @@ -6,6 +6,9 @@ Index – Lindenii Forge +
+ {{ template "header" . }} +

Lindenii Forge

diff --git a/templates/repo_commit.html.tmpl b/templates/repo_commit.html.tmpl index f219d2e..6c064fc 100644 --- a/templates/repo_commit.html.tmpl +++ b/templates/repo_commit.html.tmpl @@ -6,6 +6,9 @@ {{ .group_name }}/repos/{{ .repo_name }} – Lindenii Forge +
+ {{ template "header" . }} +
{{ template "repo_header" . }}
diff --git a/templates/repo_index.html.tmpl b/templates/repo_index.html.tmpl index 6bc3253..f77e10b 100644 --- a/templates/repo_index.html.tmpl +++ b/templates/repo_index.html.tmpl @@ -6,6 +6,9 @@ {{ .group_name }}/repos/{{ .repo_name }} – Lindenii Forge +
+ {{ template "header" . }} +
{{ template "repo_header" . }}
diff --git a/templates/repo_log.html.tmpl b/templates/repo_log.html.tmpl index a24138c..3cc719e 100644 --- a/templates/repo_log.html.tmpl +++ b/templates/repo_log.html.tmpl @@ -6,6 +6,9 @@ Log of {{ .group_name }}/repos/{{ .repo_name }} – Lindenii Forge +
+ {{ template "header" . }} +
{{ template "repo_header" . }}
diff --git a/templates/repo_raw_dir.html.tmpl b/templates/repo_raw_dir.html.tmpl index 055445d..a005a32 100644 --- a/templates/repo_raw_dir.html.tmpl +++ b/templates/repo_raw_dir.html.tmpl @@ -6,6 +6,9 @@ {{ .group_name }}/repos/{{ .repo_name }}/{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} – Lindenii Forge +
+ {{ template "header" . }} +
{{ template "repo_header" . }}
diff --git a/templates/repo_tree_dir.html.tmpl b/templates/repo_tree_dir.html.tmpl index dd5ecaf..5d2f632 100644 --- a/templates/repo_tree_dir.html.tmpl +++ b/templates/repo_tree_dir.html.tmpl @@ -6,6 +6,9 @@ {{ .group_name }}/repos/{{ .repo_name }}/{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} – Lindenii Forge +
+ {{ template "header" . }} +
{{ template "repo_header" . }}
diff --git a/templates/repo_tree_file.html.tmpl b/templates/repo_tree_file.html.tmpl index 00547d2..7b184e3 100644 --- a/templates/repo_tree_file.html.tmpl +++ b/templates/repo_tree_file.html.tmpl @@ -7,6 +7,9 @@ {{ .group_name }}/repos/{{ .repo_name }}/{{ .path_spec }} – Lindenii Forge +
+ {{ template "header" . }} +
{{ template "repo_header" . }}
-- cgit v1.2.3