From 5c7d30cf521a66ecab7aa95ee2713785957604c1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 1 Apr 2021 07:04:47 +0200 Subject: [PATCH] Diff box fixes (#15214) (#15227) - Fix misaligned "Show Outdated" buttons via flexbox - Add hover effect to "Show Outdated" buttons - Remove overreaching margin from selector .diff-file-box and handle cases individually. Fixes: https://github.com/go-gitea/gitea/issues/15097 Co-authored-by: Lunny Xiao Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath Co-authored-by: techknowlogick --- templates/repo/diff/box.tmpl | 6 +-- templates/repo/diff/conversation.tmpl | 26 ++++++---- .../repo/issue/view_content/comments.tmpl | 50 ++++++++++--------- web_src/less/_repository.less | 12 ----- web_src/less/_review.less | 12 +++-- 5 files changed, 53 insertions(+), 53 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index f93dac9b4d..32e21202ff 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -43,7 +43,7 @@ {{range $i, $file := .Diff.Files}} {{if $file.IsIncomplete}} -
+ {{else}} -
+

{{$isImage := false}} @@ -128,7 +128,7 @@ {{end}} {{if .Diff.IsIncomplete}} -
+

{{$.i18n.Tr "repo.diff.too_many_files"}}

diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl index 4dd7de0fc1..7b447d01bf 100644 --- a/templates/repo/diff/conversation.tmpl +++ b/templates/repo/diff/conversation.tmpl @@ -3,16 +3,20 @@ {{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}}
{{if $resolved}} -
- {{$resolveDoer.Name}} {{$.i18n.Tr "repo.issues.review.resolved_by"}} - - +
+
+ {{$resolveDoer.Name}} {{$.i18n.Tr "repo.issues.review.resolved_by"}} +
+
+ + +
{{end}}
@@ -32,4 +36,4 @@ {{end}}
-
\ No newline at end of file +
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 0aaa806450..2231b39ec2 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -459,35 +459,39 @@ {{ range $filename, $lines := .Review.CodeComments}} {{range $line, $comms := $lines}}
- {{$diff := (CommentMustAsDiff (index $comms 0))}} {{if $diff}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index fde20b986e..42eb5f8f5a 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1107,15 +1107,6 @@ .segments { box-shadow: none; - - .show-outdated, - .hide-outdated { - display: block; - } - - .label { - margin-left: 6px; - } } } } @@ -1576,9 +1567,6 @@ } .diff-file-box { - margin-top: 1rem; - margin-bottom: 1rem; - .header { background-color: var(--color-box-header); } diff --git a/web_src/less/_review.less b/web_src/less/_review.less index 059e3d0ff5..f6f5df20a2 100644 --- a/web_src/less/_review.less +++ b/web_src/less/_review.less @@ -35,11 +35,15 @@ &:not(.top) { margin-bottom: .5em; } +} - .show-outdated, - .hide-outdated { - display: block; - margin-left: auto; +.show-outdated, +.hide-outdated { + display: block !important; + user-select: none !important; + + &:hover { + text-decoration: underline; } }