From 682552378f974f2ca2373951fbc86512bfb32ead Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 4 Sep 2023 21:38:59 +0800 Subject: [PATCH] More fixes for the "commit-body" (#26898) The changes for "commit-body" in #26877 are not ideal. The reason is: the "commit-body" is usually a `
`, it has default
margins. In most cases, we do not need that large margin. So, this PR
introduces a general but small margin for all "commit-body" elements.
Then these `gt-m-0` could be removed.

The `:not` selector is not needed, because the `.timeline-item` selector
is already clear enough.
---
 templates/repo/commit_page.tmpl  | 2 +-
 templates/repo/commits_list.tmpl | 2 +-
 web_src/css/repo.css             | 5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl
index 06b8f1ba1..612c0f94c 100644
--- a/templates/repo/commit_page.tmpl
+++ b/templates/repo/commit_page.tmpl
@@ -135,7 +135,7 @@
 				{{end}}
 			
 			{{if IsMultilineCommitMessage .Commit.Message}}
-				
{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
+
{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}
{{end}} {{template "repo/commit_load_branches_and_tags" .}} diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index b9d0e6171..a06c425b7 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -68,7 +68,7 @@ {{end}} {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}} {{if IsMultilineCommitMessage .Message}} -
{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}
+
{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}
{{end}} {{if .Committer}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 242682593..fb85a53ab 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -2620,13 +2620,14 @@ tbody.commit-list { } .commit-body { + margin: 0.25em 0; white-space: pre-wrap; line-height: initial; } /* PR-comment */ -.repository:not(.diff) .timeline-item .commit-body { - margin-left: 40px; +.repository .timeline-item .commit-body { + margin-left: 45px; } .git-notes.top {