aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-14 11:22:17 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-14 11:22:17 +0800
commit21c667435ab5394fe0dd86314c61256ea9b44711 (patch)
tree13325aebe9a94e909393c14ae60961d8c01673c8 /templates
parenthttp_server.go: Rename dir_mode to trailing_slash (diff)
downloadforge-21c667435ab5394fe0dd86314c61256ea9b44711.tar.gz
forge-21c667435ab5394fe0dd86314c61256ea9b44711.tar.zst
forge-21c667435ab5394fe0dd86314c61256ea9b44711.zip
repo_index: Allow refspecs
Diffstat (limited to 'templates')
-rw-r--r--templates/repo_index.html.tmpl5
1 files changed, 3 insertions, 2 deletions
diff --git a/templates/repo_index.html.tmpl b/templates/repo_index.html.tmpl
index 7faea1e..80300d2 100644
--- a/templates/repo_index.html.tmpl
+++ b/templates/repo_index.html.tmpl
@@ -60,15 +60,16 @@
<table id="file-tree" class="wide">
<thead>
<tr class="title-row">
- <th colspan="3"><label for="toggle-table-file-tree">/ on {{ .ref_name }}</label></th>
+ <th colspan="3"><label for="toggle-table-file-tree">/{{ if .ref_name }} on {{ .ref_name }}{{ end }}</label></th>
</tr>
</thead>
<tbody>
+ {{- $ref_type := .ref_type }}
{{- $ref := .ref_name }}
{{- range .files }}
<tr>
<td class="file-mode">{{ .Mode }}</td>
- <td class="file-name"><a href="tree/{{ .Name }}">{{ .Name }}</a>{{ if not .Is_file }}/{{ end }}</td>
+ <td class="file-name"><a href="tree/{{ .Name }}{{ if not .Is_file }}/{{ end }}{{ if $ref_type }}?{{ $ref_type }}={{ $ref }}{{ end }}">{{ .Name }}</a>{{ if not .Is_file }}/{{ end }}</td>
<td class="file-size">{{ .Size }}</td>
</tr>
{{- end }}