diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-06 09:33:11 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-06 09:34:06 +0800 |
commit | c9b4eee4c589b8b40c02d0c96f887ec991580a24 (patch) | |
tree | 0ab3f2a22e9c4ca430573559d5712a4a7a6903a3 /forged/templates/repo_index.tmpl | |
parent | Move the Go stuff to ./forged/ (diff) | |
download | forge-c9b4eee4c589b8b40c02d0c96f887ec991580a24.tar.gz forge-c9b4eee4c589b8b40c02d0c96f887ec991580a24.tar.zst forge-c9b4eee4c589b8b40c02d0c96f887ec991580a24.zip |
Restructure static/templates into forged
Diffstat (limited to 'forged/templates/repo_index.tmpl')
-rw-r--r-- | forged/templates/repo_index.tmpl | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/forged/templates/repo_index.tmpl b/forged/templates/repo_index.tmpl new file mode 100644 index 0000000..d040f3a --- /dev/null +++ b/forged/templates/repo_index.tmpl @@ -0,0 +1,94 @@ +{{/* + SPDX-License-Identifier: AGPL-3.0-only + SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org> +*/}} +{{- define "repo_index" -}} +{{- $root := . -}} +<!DOCTYPE html> +<html lang="en"> + <head> + {{- template "head_common" . -}} + <title>{{ .repo_name }} – {{ template "group_path_plain" .group_path }} – {{ .global.forge_title -}}</title> + </head> + <body class="repo-index"> + {{- template "header" . -}} + <div class="repo-header"> + <h2>{{- .repo_name -}}</h2> + <ul class="nav-tabs-standalone"> + <li class="nav-item"> + <a class="nav-link active" href="./{{- template "ref_query" $root -}}">Summary</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="tree/{{- template "ref_query" $root -}}">Tree</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="log/{{- template "ref_query" $root -}}">Log</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="branches/">Branches</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="tags/">Tags</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="contrib/">Merge requests</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="settings/">Settings</a> + </li> + </ul> + </div> + <div class="repo-header-extension"> + <div class="repo-header-extension-content"> + {{- .repo_description -}} + </div> + </div> + {{- if .notes -}} + <div id="notes">Notes</div> + <ul> + {{- range .notes -}}<li>{{- . -}}</li>{{- end -}} + </ul> + </div> + {{- end -}} + <p class="readingwidth"><code>{{- .ssh_clone_url -}}</code></p> + {{- if .ref_name -}} + <p class="readingwidth"> + <strong> + Warning: Due to various recent migrations, viewing non-HEAD refs may be broken. + </strong> + </p> + {{- end -}} + {{- if .commits -}} + <div class="commit-list-small"> + {{- range .commits -}} + <div class="event"> + <div> + <a href="commit/{{- .Hash -}}" title="{{- .Hash -}}" rel="nofollow"> + {{- .Hash | printf "%.8s" -}} + </a> + — <a href="mailto:{{- .Email -}}">{{- .Author -}}</a> + <small class="pull-right"> + <span title="{{- .Date -}}">{{- .Date -}}</span> + </small> + </div> + <pre class="commit">{{- .Message | first_line -}}</pre> + </div> + {{- end -}} + {{- if dereference_error .commits_err -}} + <div class="commit-error"> + Error while obtaining commit log: {{ .commits_err }} + </div> + {{- end -}} + </div> + {{- end -}} + {{- if .readme -}} + <div class="padding-wrapper" id="readme"> + {{- .readme -}} + </div> + {{- end -}} + <footer> + {{- template "footer" . -}} + </footer> + </body> +</html> +{{- end -}} |