From 275c49817dc02014f9585f5f1de418156df66a0e Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 03 Apr 2025 18:16:19 +0800 Subject: [PATCH] HTML: Don't use for the repo index page's commit list References: https://todo.sr.ht/~runxiyu/forge/9 --- static/style.css | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++- templates/repo_index.tmpl | 49 ++++++++++++++++++++----------------------------- diff --git a/static/style.css b/static/style.css index d31e0fcca229f03b09612a5f1aee3daada96bb3b..077f2f699d2736bdcd158e3138767023408df316 100644 --- a/static/style.css +++ b/static/style.css @@ -546,7 +546,7 @@ padding-top: 0.3rem; padding-bottom: 0.2rem; } -.repo-header, .padding-wrapper, .repo-header-extension-content, #main-header, .readingwidth { +.repo-header, .padding-wrapper, .repo-header-extension-content, #main-header, .readingwidth, .commit-list-small { padding-left: 1rem; padding-right: 1rem; max-width: 60rem; @@ -558,3 +558,55 @@ .padding-wrapper { margin-bottom: 1rem; } + +/* TODO */ + +.commit-list-small .event { + border: 1px solid var(--lighter-border-color); + background-color: var(--lighter-box-background-color); + padding: 0.5rem; + margin-bottom: 1rem; + max-width: 30rem; +} + +.commit-list-small .event:last-child { + margin-bottom: 1rem; +} + +.commit-list-small a { + color: var(--link-color); + text-decoration: none; + font-weight: 500; +} + +.commit-list-small a:hover { + text-decoration: underline; + text-decoration-color: var(--text-decoration-color); +} + +.commit-list-small .event > div { + font-size: 0.95rem; + line-height: 1.4; +} + +.commit-list-small .pull-right { + float: right; + font-size: 0.85em; + color: var(--light-text-color); + margin-left: 1rem; +} + +.commit-list-small pre.commit { + margin: 0.25rem 0 0 0; + padding: 0; + font-family: inherit; + font-size: 0.95rem; + color: var(--text-color); + white-space: pre-wrap; +} + +.commit-list-small .commit-error { + color: var(--danger-color); + font-weight: bold; + margin-top: 1rem; +} diff --git a/templates/repo_index.tmpl b/templates/repo_index.tmpl index 666eaeb0eb7b7180d76c4f0a86829460cbe4eef0..21eb5f60c14f4da0a68e0bea4a313f576c5ce9e8 100644 --- a/templates/repo_index.tmpl +++ b/templates/repo_index.tmpl @@ -52,35 +52,26 @@ {{- end -}}

{{- .ssh_clone_url -}}

{{- if .commits -}} -
-
- - - - - - - - - - - - {{- range .commits -}} - - - - - - {{- end -}} - {{- if dereference_error .commits_err -}} - Error while obtaining commit log: {{ .commits_err }} - {{- end -}} - -
Recent commits (see all)
TitleAuthorAuthor date
{{- .Message | first_line -}} - - - {{- .Date -}} -
+
+ {{- range .commits -}} +
+
+ + {{- .Hash | printf "%.8s" -}} + +  — {{- .Author -}} + + {{- .Date -}} + +
+
{{- .Message | first_line -}}
+
+ {{- end -}} + {{- if dereference_error .commits_err -}} +
+ Error while obtaining commit log: {{ .commits_err }} +
+ {{- end -}}
{{- end -}} {{- if .readme -}} -- 2.48.1