From aee5ef00519cd199992bb7dc02b4fa22a392869e Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 1 Apr 2021 00:19:53 +0200 Subject: [PATCH] Diff box fixes (#15214) - 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 368fc2c444..2dcad2ba9d 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}} @@ -145,7 +145,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 0cae8bdf95..f84981c1c6 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 5503c80288..f2234c8558 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; - } } } } @@ -1635,9 +1626,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; } }