diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-15 00:32:39 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-15 00:32:39 +0800 |
commit | d5416d850c9b697bc8fb189841e1c1e622494f5e (patch) | |
tree | b877df54a6fbef112b0d32796f514b66177c9976 /templates/repo_tree_dir.tmpl | |
parent | Makefile, resources.go: Add vendor directory to serve library source (diff) | |
download | forge-d5416d850c9b697bc8fb189841e1c1e622494f5e.tar.gz forge-d5416d850c9b697bc8fb189841e1c1e622494f5e.tar.zst forge-d5416d850c9b697bc8fb189841e1c1e622494f5e.zip |
templates: *.html.tmpl -> *.tmpl
Diffstat (limited to 'templates/repo_tree_dir.tmpl')
-rw-r--r-- | templates/repo_tree_dir.tmpl | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/templates/repo_tree_dir.tmpl b/templates/repo_tree_dir.tmpl new file mode 100644 index 0000000..5e0fdcc --- /dev/null +++ b/templates/repo_tree_dir.tmpl @@ -0,0 +1,60 @@ +{{- define "repo_tree_dir" -}} +<!DOCTYPE html> +<html lang="en"> + <head> + {{ template "head_common" . }} + <title>{{ .group_name }}/repos/{{ .repo_name }}/{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} – {{ .global.forge_title }}</title> + </head> + <body class="repo-tree-dir"> + {{ template "header" . }} + <div class="padding-wrapper scroll"> + <table id="file-tree" class="wide"> + <thead> + <tr class="title-row"> + <th colspan="3"> + /{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }}{{ if .ref_name }} on {{ .ref_name }}{{ end }} + </th> + </tr> + </thead> + <tbody> + {{- $path_spec := .path_spec }} + {{- $ref := .ref_name }} + {{- $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 }}{{ if $ref_type }}?{{ $ref_type }}={{ $ref }}{{ end }}">{{ .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 class="wide"> + <thead> + <tr class="title-row"> + <th>{{ .readme_filename }}</th> + </tr> + </thead> + <tbody> + <tr> + <td id="readme"> + {{ .readme -}} + </td> + </tr> + </tbody> + </table> + {{ end }} + </div> + <footer> + {{ template "footer" . }} + </footer> + </body> +</html> +{{- end -}} |