aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-13 09:05:01 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-13 09:05:01 +0800
commit053efe176ee241c87c9e31c4e2bbd999f9f77bf2 (patch)
tree3c068149ef1bd82ac4dd0b9d4d9c3a185635e2f0
parenthandle_user: Stub (diff)
downloadforge-053efe176ee241c87c9e31c4e2bbd999f9f77bf2.tar.gz
forge-053efe176ee241c87c9e31c4e2bbd999f9f77bf2.tar.zst
forge-053efe176ee241c87c9e31c4e2bbd999f9f77bf2.zip
_header.html: Format the main header
Diffstat (limited to '')
-rw-r--r--static/style.css19
-rw-r--r--templates/_header.html.tmpl22
-rw-r--r--templates/group_repos.html.tmpl4
-rw-r--r--templates/index.html.tmpl4
-rw-r--r--templates/repo_commit.html.tmpl4
-rw-r--r--templates/repo_index.html.tmpl4
-rw-r--r--templates/repo_log.html.tmpl4
-rw-r--r--templates/repo_raw_dir.html.tmpl4
-rw-r--r--templates/repo_tree_dir.html.tmpl4
-rw-r--r--templates/repo_tree_file.html.tmpl4
10 files changed, 39 insertions, 34 deletions
diff --git a/static/style.css b/static/style.css
index 4ebcdfd..043da38 100644
--- a/static/style.css
+++ b/static/style.css
@@ -29,6 +29,9 @@ html {
--lighter-box-background-color: hsl(0, 0%, 15%);
}
}
+body {
+ margin: 0;
+}
html, code, pre {
font-size: 1rem; /* TODO: Not always correct */
}
@@ -235,3 +238,19 @@ input[type=file]::file-selector-button {
a.btn, a.btn-white, a.btn-danger, a.btn-normal, a.btn-primary {
text-decoration: none;
}
+header#main-header {
+ background-color: var(--lighter-box-background-color);
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 10px;
+}
+
+header#main-header > div#main-header-forge-title {
+ flex-grow: 1; /* Allows title to take up remaining space */
+}
+
+header#main-header > div#main-header-user {
+ display: flex;
+ align-items: center; /* Ensures user section is vertically aligned */
+}
diff --git a/templates/_header.html.tmpl b/templates/_header.html.tmpl
index 7c0e4ea..7aebfbc 100644
--- a/templates/_header.html.tmpl
+++ b/templates/_header.html.tmpl
@@ -1,12 +1,14 @@
{{- define "header" -}}
-<div>
- <a href="/">Lindenii Forge</a>
-</div>
-<div>
- {{ if ne .user_id "" }}
- <a href="/:/users/{{ .user_id }}">{{ .username }}</a>
- {{ else }}
- <a href="/:/login/">Login</a>
- {{ end }}
-</div>
+<header id="main-header">
+ <div id="main-header-forge-title">
+ <a href="/">Lindenii Forge</a>
+ </div>
+ <div id="main-header-user">
+ {{ if ne .user_id "" }}
+ <a href="/:/users/{{ .user_id }}">{{ .username }}</a>
+ {{ else }}
+ <a href="/:/login/">Login</a>
+ {{ end }}
+ </div>
+</header>
{{- end -}}
diff --git a/templates/group_repos.html.tmpl b/templates/group_repos.html.tmpl
index 1050ce4..c9c12fd 100644
--- a/templates/group_repos.html.tmpl
+++ b/templates/group_repos.html.tmpl
@@ -6,9 +6,7 @@
<title>Repos in {{ .group_name }} &ndash; Lindenii Forge</title>
</head>
<body class="group-repos">
- <header>
- {{ template "header" . }}
- </header>
+ {{ template "header" . }}
<div class="padding-wrapper">
<h1>
Repos in {{ .group_name }}
diff --git a/templates/index.html.tmpl b/templates/index.html.tmpl
index a8ef445..50cd489 100644
--- a/templates/index.html.tmpl
+++ b/templates/index.html.tmpl
@@ -6,9 +6,7 @@
<title>Index &ndash; Lindenii Forge</title>
</head>
<body class="index">
- <header>
- {{ template "header" . }}
- </header>
+ {{ template "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 6c064fc..4965d6e 100644
--- a/templates/repo_commit.html.tmpl
+++ b/templates/repo_commit.html.tmpl
@@ -6,9 +6,7 @@
<title>{{ .group_name }}/repos/{{ .repo_name }} &ndash; Lindenii Forge</title>
</head>
<body class="repo-commit">
- <header>
- {{ template "header" . }}
- </header>
+ {{ template "header" . }}
<header>
{{ template "repo_header" . }}
</header>
diff --git a/templates/repo_index.html.tmpl b/templates/repo_index.html.tmpl
index f77e10b..d799a22 100644
--- a/templates/repo_index.html.tmpl
+++ b/templates/repo_index.html.tmpl
@@ -6,9 +6,7 @@
<title>{{ .group_name }}/repos/{{ .repo_name }} &ndash; Lindenii Forge</title>
</head>
<body class="repo-index">
- <header>
- {{ template "header" . }}
- </header>
+ {{ template "header" . }}
<header>
{{ template "repo_header" . }}
</header>
diff --git a/templates/repo_log.html.tmpl b/templates/repo_log.html.tmpl
index 3cc719e..34b7c45 100644
--- a/templates/repo_log.html.tmpl
+++ b/templates/repo_log.html.tmpl
@@ -6,9 +6,7 @@
<title>Log of {{ .group_name }}/repos/{{ .repo_name }} &ndash; Lindenii Forge</title>
</head>
<body class="repo-log">
- <header>
- {{ template "header" . }}
- </header>
+ {{ template "header" . }}
<header>
{{ template "repo_header" . }}
</header>
diff --git a/templates/repo_raw_dir.html.tmpl b/templates/repo_raw_dir.html.tmpl
index a005a32..dc7bb98 100644
--- a/templates/repo_raw_dir.html.tmpl
+++ b/templates/repo_raw_dir.html.tmpl
@@ -6,9 +6,7 @@
<title>{{ .group_name }}/repos/{{ .repo_name }}/{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} &ndash; Lindenii Forge</title>
</head>
<body class="repo-raw-dir">
- <header>
- {{ template "header" . }}
- </header>
+ {{ template "header" . }}
<header>
{{ template "repo_header" . }}
</header>
diff --git a/templates/repo_tree_dir.html.tmpl b/templates/repo_tree_dir.html.tmpl
index 5d2f632..73ea4cf 100644
--- a/templates/repo_tree_dir.html.tmpl
+++ b/templates/repo_tree_dir.html.tmpl
@@ -6,9 +6,7 @@
<title>{{ .group_name }}/repos/{{ .repo_name }}/{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} &ndash; Lindenii Forge</title>
</head>
<body class="repo-tree-dir">
- <header>
- {{ template "header" . }}
- </header>
+ {{ template "header" . }}
<header>
{{ template "repo_header" . }}
</header>
diff --git a/templates/repo_tree_file.html.tmpl b/templates/repo_tree_file.html.tmpl
index 7b184e3..9f705c9 100644
--- a/templates/repo_tree_file.html.tmpl
+++ b/templates/repo_tree_file.html.tmpl
@@ -7,9 +7,7 @@
<title>{{ .group_name }}/repos/{{ .repo_name }}/{{ .path_spec }} &ndash; Lindenii Forge</title>
</head>
<body class="repo-tree-file">
- <header>
- {{ template "header" . }}
- </header>
+ {{ template "header" . }}
<header>
{{ template "repo_header" . }}
</header>