Lindenii Project Forge
Login
Commit info
IDbc41933d4f5e8b378ac544d9beaa03b2def925f8
AuthorRunxi Yu<me@runxiyu.org>
Author dateFri, 07 Mar 2025 18:58:05 +0800
CommitterRunxi Yu<me@runxiyu.org>
Committer dateFri, 07 Mar 2025 18:58:05 +0800
Actions
Get patch
index, group: Escape path anchors

Fixes: https://todo.sr.ht/~runxiyu/forge/1
{{/*
	SPDX-License-Identifier: AGPL-3.0-only
	SPDX-FileContributor: Runxi Yu <https://runxiyu.org>
*/}}
{{- define "group_view" -}}
{{ if .subgroups }}
	<table class="wide">
		<thead>
			<tr>
				<th colspan="2" class="title-row">Subgroups</th>
			</tr>
			<tr>
				<th scope="col">Name</th>
				<th scope="col">Description</th>
			</tr>
		</thead>
		<tbody>
			{{- range .subgroups }}
				<tr>
					<td>
						<a href="{{ .Name }}/">{{ .Name }}</a>
						<a href="{{ .Name | path_escape }}/">{{ .Name }}</a>
					</td>
					<td>
						{{ .Description }}
					</td>
				</tr>
			{{- end }}
		</tbody>
	</table>
{{ end }}
{{ if .repos }}
<table class="wide">
	<thead>
		<tr>
			<th colspan="2" class="title-row">Repos</th>
			<tr>
				<th scope="col">Name</th>
				<th scope="col">Description</th>
			</tr>
		</tr>
	</thead>
	<tbody>
		{{- range .repos }}
			<tr>
				<td>
					<a href=":/repos/{{ .Name }}/">{{ .Name }}</a>
					<a href=":/repos/{{ .Name | path_escape }}/">{{ .Name }}</a>
				</td>
				<td>
					{{ .Description }}
				</td>
			</tr>
		{{- end }}
	</tbody>
</table>
{{ end }}
{{- end -}}
{{/*
	SPDX-License-Identifier: AGPL-3.0-only
	SPDX-FileContributor: Runxi Yu <https://runxiyu.org>
*/}}
{{- define "index" -}}
<!DOCTYPE html>
<html lang="en">
	<head>
		{{ template "head_common" . }}
		<title>Index &ndash; {{ .global.forge_title }}</title>
	</head>
	<body class="index">
		{{ template "header" . }}
		<div class="padding-wrapper">
		<table class="wide">
			<thead>
				<tr>
					<th colspan="2" class="title-row">Groups</th>
				</tr>
				<tr>
					<th scope="col">Name</th>
					<th scope="col">Description</th>
				</tr>
			</thead>
			<tbody>
				{{- range .groups }}
					<tr>
						<td>
							<a href="{{ .Name }}/">{{ .Name }}</a>
							<a href="{{ .Name | path_escape }}/">{{ .Name }}</a>
						</td>
						<td>
							{{ .Description }}
						</td>
					</tr>
				{{- end }}
			</tbody>
		</table>
		<div class="padding-wrapper">
			<table class="wide">
				<thead>
					<tr>
						<th colspan="2" class="title-row">
							Info
						</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<th scope="row">SSH public key</th>
						<td><code>{{ .global.server_public_key_string }}</code></td>
					</tr>
					<tr>
						<th scope="row">SSH fingerprint</th>
						<td><code>{{ .global.server_public_key_fingerprint }}</code></td>
					</tr>
				</tbody>
			</table>
		</div>
		<footer>
			{{ template "footer" . }}
		</footer>
	</body>
</html>
{{- end -}}