From 5717faed659a9eeb86c528ab56822c42eca1ad3f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 12 Aug 2025 11:01:07 +0800 Subject: Refactor --- forged/templates/_footer.tmpl | 2 +- forged/templates/_group_view.tmpl | 8 ++++---- forged/templates/_header.tmpl | 16 ++++++++-------- forged/templates/group.tmpl | 10 +++++----- forged/templates/index.tmpl | 8 ++++---- forged/templates/login.tmpl | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) (limited to 'forged/templates') diff --git a/forged/templates/_footer.tmpl b/forged/templates/_footer.tmpl index 22a3958..11e2365 100644 --- a/forged/templates/_footer.tmpl +++ b/forged/templates/_footer.tmpl @@ -4,7 +4,7 @@ */}} {{- define "footer" -}} Lindenii Forge -{{ .global.forge_version }} +{{ .BaseData.Global.ForgeVersion }} (upstream, license, support) diff --git a/forged/templates/_group_view.tmpl b/forged/templates/_group_view.tmpl index 92b6639..de5d45d 100644 --- a/forged/templates/_group_view.tmpl +++ b/forged/templates/_group_view.tmpl @@ -3,7 +3,7 @@ SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu */}} {{- define "group_view" -}} -{{- if .subgroups -}} +{{- if .Subgroups -}} @@ -15,7 +15,7 @@ - {{- range .subgroups -}} + {{- range .Subgroups -}}
{{- .Name -}} @@ -28,7 +28,7 @@
{{- end -}} -{{- if .repos -}} +{{- if .Repos -}} @@ -40,7 +40,7 @@ - {{- range .repos -}} + {{- range .Repos -}}
{{- .Name -}} diff --git a/forged/templates/_header.tmpl b/forged/templates/_header.tmpl index 340a2ac..39d3491 100644 --- a/forged/templates/_header.tmpl +++ b/forged/templates/_header.tmpl @@ -5,15 +5,15 @@ {{- define "header" -}}
- {{- if ne .user_id_string "" -}} - {{- .username -}} + {{- if ne .BaseData.UserID "" -}} + {{- .BaseData.Username -}} {{- else -}} Login {{- end -}} diff --git a/forged/templates/group.tmpl b/forged/templates/group.tmpl index 3338f9b..31b7169 100644 --- a/forged/templates/group.tmpl +++ b/forged/templates/group.tmpl @@ -3,23 +3,23 @@ SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu */}} {{- define "group" -}} -{{- $group_path := .group_path -}} +{{- $group_path := .BaseData.GroupPath -}} {{- template "head_common" . -}} - {{- range $i, $s := .group_path -}}{{- $s -}}{{- if ne $i (len $group_path) -}}/{{- end -}}{{- end }} – {{ .global.forge_title -}} + {{- range $i, $s := $group_path -}}{{- $s -}}{{- if ne $i (len $group_path) -}}/{{- end -}}{{- end }} – {{ .BaseData.Global.ForgeTitle -}} {{- template "header" . -}}
- {{- if .description -}} -

{{- .description -}}

+ {{- if .Description -}} +

{{- .Description -}}

{{- end -}} {{- template "group_view" . -}}
- {{- if .direct_access -}} + {{- if .DirectAccess -}}
diff --git a/forged/templates/index.tmpl b/forged/templates/index.tmpl index 66bd177..fa9b6a0 100644 --- a/forged/templates/index.tmpl +++ b/forged/templates/index.tmpl @@ -7,7 +7,7 @@ {{- template "head_common" . -}} - Index – {{ .global.forge_title -}} + Index – {{ .BaseData.Global.ForgeTitle -}} {{- template "header" . -}} @@ -24,7 +24,7 @@ - {{- range .groups -}} + {{- range .Groups -}} - + - +
{{- .Name -}} @@ -47,11 +47,11 @@
SSH public key{{- .global.server_public_key_string -}}{{- .BaseData.Global.SSHPubkey -}}
SSH fingerprint{{- .global.server_public_key_fingerprint -}}{{- .BaseData.Global.SSHFingerprint -}}
diff --git a/forged/templates/login.tmpl b/forged/templates/login.tmpl index 980b863..09cbb61 100644 --- a/forged/templates/login.tmpl +++ b/forged/templates/login.tmpl @@ -7,11 +7,11 @@ {{- template "head_common" . -}} - Login – {{ .global.forge_title -}} + Login – {{ .BaseData.Global.ForgeTitle -}}
- {{- .login_error -}} + {{- .LoginError -}}
-- cgit v1.2.3