From f428d408227b0ab3fe87e6ccb445fd77ba26640c Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Wed, 3 Jun 2020 10:29:19 +0200 Subject: [PATCH] Fix styling for commiter on diff view (#11715) (#11744) * Fix styling for commiter on diff view * Update options/locale/locale_en-US.ini * Update templates/repo/commit_page.tmpl Co-authored-by: silverwind * Update templates/repo/commit_page.tmpl Co-authored-by: silverwind * Apply suggestions from code review Co-authored-by: silverwind Co-authored-by: silverwind Co-authored-by: techknowlogick (cherry picked from commit 8e035f81c01ba6c1ccf8952ffad37bef063aad2d) --- options/locale/locale_en-US.ini | 1 + templates/repo/commit_page.tmpl | 27 +++++++++++++++------------ web_src/less/_repository.less | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index d10f4c247..365b598ac 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1647,6 +1647,7 @@ diff.review.placeholder = Review comment diff.review.comment = Comment diff.review.approve = Approve diff.review.reject = Request changes +diff.committed_by = committed by releases.desc = Track project versions and downloads. release.releases = Releases diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index f884bee7b..dde87c08d 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -31,7 +31,7 @@
-
+
{{if .Author}} {{if .Author.FullName}} @@ -43,19 +43,22 @@ {{.Commit.Author.Name}} {{end}} - {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} - - {{if ne .Verification.CommittingUser.ID 0}} - - {{.Commit.Committer.Name}} <{{.Commit.Committer.Email}}> - {{else}} - - {{.Commit.Committer.Name}} - {{end}} - {{end}} {{TimeSince .Commit.Author.When $.Lang}} + {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} +
+ {{svg "octicon-git-commit" 16}}{{.i18n.Tr "repo.diff.committed_by"}} + {{if ne .Verification.CommittingUser.ID 0}} + + {{.Commit.Committer.Name}} <{{.Commit.Committer.Email}}> + {{else}} + + {{.Commit.Committer.Name}} + {{end}} +
+ {{end}} +
-
+
{{if .Parents}}
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index b1e1d6634..7437ac8fe 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -2293,6 +2293,24 @@ } } } + + &.diff .committed-by { + padding-top: .5rem; + + .ui.avatar { + width: 20px; + height: 20px; + } + + span { + margin-right: .25rem; + + svg { + vertical-align: text-bottom; + margin-right: 2px; + } + } + } } // End of .repository