aboutsummaryrefslogtreecommitdiff
path: root/templates/repo_tree_dir.html.tmpl
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-13 12:06:36 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-13 12:06:36 +0800
commit9b20ef637095413a8e7bde6701b8ad2379b4e7aa (patch)
treebc02623d8963b9b28429c49e0f14a532e259b612 /templates/repo_tree_dir.html.tmpl
parentrepo_{raw,tree}_dir: Only display "on $ref" if necessary (diff)
downloadforge-9b20ef637095413a8e7bde6701b8ad2379b4e7aa.tar.gz
forge-9b20ef637095413a8e7bde6701b8ad2379b4e7aa.tar.zst
forge-9b20ef637095413a8e7bde6701b8ad2379b4e7aa.zip
repo_*_{dir,file}: Add ref params if not head
Diffstat (limited to '')
-rw-r--r--templates/repo_tree_dir.html.tmpl4
1 files changed, 3 insertions, 1 deletions
diff --git a/templates/repo_tree_dir.html.tmpl b/templates/repo_tree_dir.html.tmpl
index d7fbb10..5e56dc9 100644
--- a/templates/repo_tree_dir.html.tmpl
+++ b/templates/repo_tree_dir.html.tmpl
@@ -18,10 +18,12 @@
</thead>
<tbody>
{{- $path_spec := .path_spec }}
+ {{- $ref := .ref }}
+ {{- $ref_type := .ref_type }}
{{- range .files }}
<tr>
<td class="file-mode">{{ .Mode }}</td>
- <td class="file-name"><a href="{{ .Name }}{{ if not .Is_file }}/{{ end }}">{{ .Name }}</a>{{ if not .Is_file }}/{{ end }}</td>
+ <td class="file-name"><a href="{{ .Name }}{{ if not .Is_file }}/{{ end }}{{ if $ref }}?{{ $ref_type }}={{ $ref }}{{ end }}">{{ .Name }}</a>{{ if not .Is_file }}/{{ end }}</td>
<td class="file-size">{{ .Size }}</td>
</tr>
{{- end }}