Lindenii Project Forge
Login
Commit info
ID8933705a095c7804c8d5b7c29d42ec7ec1e62c6c
AuthorRunxi Yu<me@runxiyu.org>
Author dateMon, 10 Feb 2025 19:57:46 +0800
CommitterRunxi Yu<me@runxiyu.org>
Committer dateMon, 10 Feb 2025 19:57:46 +0800
Actions
Get patch
repo_{index,tree_dir}.html, style.css: Darker table title row
html {
	font-family: sans-serif;
	--link-color: hsl(320, 50%, 36%);
	--border-color: hsl(0, 0%, 72%);
	--text-decoration-color: hsl(0, 0%, 72%);
	--darker-box-background-color: hsl(0, 0%, 92%);
	--lighter-box-background-color: hsl(0, 0%, 95%);
}
html, code, pre {
	font-size: 1rem; /* TODO: Not always correct */
}

.padding-wrapper {
	padding: 0 1rem;
	max-width: 50em;
	margin: 1rem auto;
}
.padding-wrapper > * {
	width: 100%;
}
a:link, a:visited {
	text-decoration-color: var(--text-decoration-color);
	color: var(--link-color);
}
code:not(pre > code) {
	background-color: var(--lighter-box-background-color);
	border-radius: 2px;
	padding: 2px;
}
table {
	border: var(--border-color) solid 1px;
	border-spacing: 0px;
	border-collapse: collapse;
}
td, th {
	padding: 3px 5px;
	border: var(--border-color) solid 1px;
}
th {
	background-color: var(--lighter-box-background-color);
}
tr.title-row > th {
	background-color: var(--darker-box-background-color);
}
{{- define "repo_index" -}}
<!DOCTYPE html>
<html>
	<head>
		{{ template "head_common" . }}
		<title>{{ .category_name }}/repos/{{ .repo_name }} &ndash; Lindenii Forge</title>
	</head>
	<body class="repo-index">
		<div class="padding-wrapper">
			<table id="recent-commits">
				<thead>
					<tr>
					<tr class="title-row">
						<th colspan="4">Recent Commits</th>
					</tr>
					<tr>
						<th scope="col">ID</th>
						<th scope="col">Title</th>
						<th scope="col">Author</th>
						<th scope="col">Time</th>
					</tr>
				</thead>
				<tbody>
					{{- range .commits }}
						<tr>
							<td class="commit-id">{{ slice .Hash.String 0 8 }}</td>
							<td class="commit-title">{{ .Message | first_line }}</td>
							<td class="commit-author">
								<a class="email-name" href="mailto:{{ .Author.Email }}">{{ .Author.Name }}</a>
							</td>
							<td class="commit-time">
								{{ .Author.When.Format "2006-01-02 15:04:05 -0700" }}
							</td>
						</tr>
					{{- end }}
				</tbody>
			</table>
		</div>
		<div class="padding-wrapper">
			<table id="file-tree">
				<thead>
					<tr>
					<tr class="title-row">
						<th colspan="3">/ on {{ .ref }}</th>
					</tr>
					<tr>
						<th scope="col">Mode</th>
						<th scope="col">Name</th>
						<th scope="col">Size</th>
					</tr>
				</thead>
				<tbody>
					{{- $ref := .ref }}
					{{- range .files }}
						<tr>
							<td class="file-mode">{{ .Mode }}</td>
							<td class="file-name"><a href="tree/{{ $ref }}/{{ .Name }}">{{ .Name }}</a>{{ if not .Is_file }}/{{ end }}</td>
							<td class="file-size">{{ .Size }}</td>
						</tr>
					{{- end }}
				</tbody>
			</table>
		</div>
		<div class="padding-wrapper">
			<div id="refs">
			</div>
		</div>
		<div class="padding-wrapper">
			{{ if .readme }}
				<table id="readme">
					<thead>
						<tr>
						<tr class="title-row">
							<th>
								README.md
							</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td>
								{{ .readme -}}
							</td>
						</tr>
					</tbody>
				</table>
			{{ end }}
		</div>
	</body>
</html>
{{- end -}}
{{- define "repo_tree_dir" -}}
<!DOCTYPE html>
<html>
	<head>
		{{ template "head_common" . }}
		<title>{{ .category_name }}/repos/{{ .repo_name }}/{{ .path_spec }} &ndash; Lindenii Forge</title>
	</head>
	<body class="repo-tree-dir">
		<div class="padding-wrapper">
			<table id="file-tree">
				<thead>
					<tr>
					<tr class="title-row">
						<th colspan="3">
							/{{ .path_spec }}/ on {{ .ref }}
						</th>
					</tr>
					<tr>
						<th scope="col">Mode</th>
						<th scope="col">Name</th>
						<th scope="col">Size</th>
					</tr>
				</thead>
				<tbody>
					{{- $path_spec := .path_spec }}
					{{- range .files }}
						<tr>
							<td class="file-mode">{{ .Mode }}</td>
							<td class="file-name"><a href="{{ $path_spec }}/{{ .Name }}">{{ .Name }}</a>{{ if not .Is_file }}/{{ end }}</td>
							<td class="file-size">{{ .Size }}</td>
						</tr>
					{{- end }}
				</tbody>
			</table>
		</div>
		<div class="padding-wrapper">
			<div id="refs">
			</div>
		</div>
		<div class="padding-wrapper">
			{{ if .readme }}
				<table id="readme">
					<thead>
						<tr>
						<tr class="title-row">
							<th>
								README.md
							</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td>
								{{ .readme -}}
							</td>
						</tr>
					</tbody>
				</table>
			{{ end }}
		</div>
	</body>
</html>
{{- end -}}