From 3c3c383a9d6dec77e93272483699b3aef2c1dd47 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 13 Mar 2025 20:17:19 +0800 Subject: Partially port templates used by the index page --- templates/_footer.htmpl | 6 ++++++ templates/_head_common.htmpl | 6 ++++-- templates/_header.htmpl | 14 ++++++++++++++ templates/index.htmpl | 46 +++++++++++++++++++++++++++++++++++++++----- 4 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 templates/_footer.htmpl create mode 100644 templates/_header.htmpl (limited to 'templates') diff --git a/templates/_footer.htmpl b/templates/_footer.htmpl new file mode 100644 index 0000000..94fef15 --- /dev/null +++ b/templates/_footer.htmpl @@ -0,0 +1,6 @@ +{{ define _tp_footer(handle: io::handle) (void | io::error | nomem) }} +Lindenii Forge +{{ global.version }} +(source, +upstream) +{{ end }} diff --git a/templates/_head_common.htmpl b/templates/_head_common.htmpl index 6fcfea1..bc14cb6 100644 --- a/templates/_head_common.htmpl +++ b/templates/_head_common.htmpl @@ -1,3 +1,5 @@ -{{ define _tp_head_common(handle: io::handle, title: str = "Untitled") (void | io::error | nomem) }} -{{ title }} +{{ define _tp_head_common(handle: io::handle) (void | io::error | nomem) }} + + + {{ end }} diff --git a/templates/_header.htmpl b/templates/_header.htmpl new file mode 100644 index 0000000..2eb8d19 --- /dev/null +++ b/templates/_header.htmpl @@ -0,0 +1,14 @@ +{{ define _tp_header(handle: io::handle, user_id_str: str, username: str) (void | io::error | nomem) }} +
+ +
+ {{ if user_id_str != "" }} + {{ username }} + {{ else }} + Login + {{ end }} +
+
+{{ end }} diff --git a/templates/index.htmpl b/templates/index.htmpl index 3562c86..e67cc09 100644 --- a/templates/index.htmpl +++ b/templates/index.htmpl @@ -1,14 +1,50 @@ {{ define tp_index(handle: io::handle) (void | io::error | nomem) }} -{! - let title: str = "Test"; -!} -{{ render _tp_head_common(handle, title) }} +{{ render _tp_head_common(handle) }} +Index – {{ global.title }} -

{{ title }}

+{{ render _tp_header(handle, "test", "test") }} +
+ + + + + + + + + + + + +
Groups
NameDescription
+
+ + + + + + + + + + + + + + + + +
+ Info +
SSH public key{{ global.ssh_pubkey }}
SSH fingerprint{{ global.ssh_fp }}
+
+ {{ end }} -- cgit v1.2.3