aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-13 01:28:35 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-13 01:28:35 +0800
commit14326ba9be276d2649b4681d3ebed1c32f65013f (patch)
tree9bd8717b6968b5a977d925d193042a92bc68f311 /templates
parentssh_{server,utils}: Swap filenames (diff)
downloadforge-14326ba9be276d2649b4681d3ebed1c32f65013f.tar.gz
forge-14326ba9be276d2649b4681d3ebed1c32f65013f.tar.zst
forge-14326ba9be276d2649b4681d3ebed1c32f65013f.zip
_header.html: Add header
Diffstat (limited to '')
-rw-r--r--templates/_header.html.tmpl12
-rw-r--r--templates/_repo_header.html.tmpl1
-rw-r--r--templates/group_repos.html.tmpl3
-rw-r--r--templates/index.html.tmpl3
-rw-r--r--templates/repo_commit.html.tmpl3
-rw-r--r--templates/repo_index.html.tmpl3
-rw-r--r--templates/repo_log.html.tmpl3
-rw-r--r--templates/repo_raw_dir.html.tmpl3
-rw-r--r--templates/repo_tree_dir.html.tmpl3
-rw-r--r--templates/repo_tree_file.html.tmpl3
10 files changed, 36 insertions, 1 deletions
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" -}}
+<div>
+ <a href="/">Lindenii Forge</a>
+</div>
+<div>
+ {{ if ne .user_id "" }}
+ <a href="/:/user/{{ .user_id }}">{{ .username }}</a>
+ {{ else }}
+ <a href="/:/login/">Login</a>
+ {{ end }}
+</div>
+{{- 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" -}}
-<a href="/">Lindenii Forge</a>
/
<a href="/{{ .group_name }}/">{{ .group_name }}</a>
/
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 @@
<title>Repos in {{ .group_name }} &ndash; Lindenii Forge</title>
</head>
<body class="group-repos">
+ <header>
+ {{ template "header" . }}
+ </header>
<div class="padding-wrapper">
<h1>
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 @@
<title>Index &ndash; Lindenii Forge</title>
</head>
<body class="index">
+ <header>
+ {{ template "header" . }}
+ </header>
<div class="padding-wrapper">
<h1>Lindenii Forge</h1>
<h2>
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
@@ -7,6 +7,9 @@
</head>
<body class="repo-commit">
<header>
+ {{ template "header" . }}
+ </header>
+ <header>
{{ template "repo_header" . }}
</header>
<div class="padding-wrapper scroll">
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
@@ -7,6 +7,9 @@
</head>
<body class="repo-index">
<header>
+ {{ template "header" . }}
+ </header>
+ <header>
{{ template "repo_header" . }}
</header>
<div class="padding-wrapper">
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
@@ -7,6 +7,9 @@
</head>
<body class="repo-log">
<header>
+ {{ template "header" . }}
+ </header>
+ <header>
{{ template "repo_header" . }}
</header>
<table id="commits" class="wide">
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
@@ -7,6 +7,9 @@
</head>
<body class="repo-raw-dir">
<header>
+ {{ template "header" . }}
+ </header>
+ <header>
{{ template "repo_header" . }}
</header>
<div class="padding-wrapper scroll">
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
@@ -7,6 +7,9 @@
</head>
<body class="repo-tree-dir">
<header>
+ {{ template "header" . }}
+ </header>
+ <header>
{{ template "repo_header" . }}
</header>
<div class="padding-wrapper scroll">
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
@@ -8,6 +8,9 @@
</head>
<body class="repo-tree-file">
<header>
+ {{ template "header" . }}
+ </header>
+ <header>
{{ template "repo_header" . }}
</header>
<p>