diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-11 12:36:50 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-11 12:36:50 +0800 |
commit | 0adba4532cb15fe139378c574473fae888cded09 (patch) | |
tree | 76570a6db1e473be1353345f92d65b909c57448f /templates | |
parent | group_{index,repos}: Rename files too (diff) | |
download | forge-0adba4532cb15fe139378c574473fae888cded09.tar.gz forge-0adba4532cb15fe139378c574473fae888cded09.tar.zst forge-0adba4532cb15fe139378c574473fae888cded09.zip |
repo_raw: Serve raw files
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo_raw_dir.html.tmpl | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/templates/repo_raw_dir.html.tmpl b/templates/repo_raw_dir.html.tmpl new file mode 100644 index 0000000..d2a280c --- /dev/null +++ b/templates/repo_raw_dir.html.tmpl @@ -0,0 +1,44 @@ +{{- define "repo_raw_dir" -}} +<!DOCTYPE html> +<html lang="en"> + <head> + {{ template "head_common" . }} + <title>{{ .group_name }}/repos/{{ .repo_name }}/{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} – Lindenii Forge</title> + </head> + <body class="repo-tree-dir"> + <div class="padding-wrapper"> + <table id="file-tree"> + <thead> + <tr class="title-row"> + <th colspan="3"> + (Raw) /{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} 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="{{ .Name }}{{ if not .Is_file }}/{{ 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> + <footer> + {{ template "footer" . }} + </footer> + </body> +</html> +{{- end -}} |