From 5331af1854db92f1b29c16ee50b63199d43573e0 Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Tue, 26 May 2020 04:33:57 +0200 Subject: [PATCH] Backport various styling fixes (#11619) * Fix inconsistent font size for markdown preview on new PR view (#11565) We use same method for new issue form and issue view, but was missing from new PR view making it one place where markdown preview is inconsistent in font size. (cherry picked from commit 04afd9d1e2399d61978fdeeab7e7ac8ff9057a93) * Fix margin on PR form (#11566) (cherry picked from commit f2a0be1683daf3330a7c94fa65300e7056e9bc98) * Fix margin for attached top header on code review (#11571) Introduced naively by #11463 The margin was being applied too widely. (cherry picked from commit e682a922957ebb1d40843be4da902fe13b15adde) * Fix styling for PR merge section when no checks (#11609) Makes styling consistent between two cases. Also removed unnecessary double border. * Normalize avatar radius --- integrations/pull_merge_test.go | 2 +- templates/repo/issue/view_content/pull.tmpl | 2 +- web_src/less/_base.less | 7 ++++++- web_src/less/_repository.less | 22 ++++++++++++++++++++- web_src/less/_review.less | 5 ++++- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/integrations/pull_merge_test.go b/integrations/pull_merge_test.go index b5ac9406a..04e68ff3d 100644 --- a/integrations/pull_merge_test.go +++ b/integrations/pull_merge_test.go @@ -194,7 +194,7 @@ func TestCantMergeWorkInProgress(t *testing.T) { req := NewRequest(t, "GET", resp.Header().Get("Location")) resp = session.MakeRequest(t, req, http.StatusOK) htmlDoc := NewHTMLParser(t, resp.Body) - text := strings.TrimSpace(htmlDoc.doc.Find(".attached.header > .text.grey").Last().Text()) + text := strings.TrimSpace(htmlDoc.doc.Find(".attached.merge-section.no-header > .text.grey").Last().Text()) assert.NotEmpty(t, text, "Can't find WIP text") // remove from lang diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 3aee0773f..a5d753ac0 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -75,7 +75,7 @@ {{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}
{{template "repo/pulls/status" .}} -
+
{{if .Issue.PullRequest.HasMerged}}
{{if .Issue.PullRequest.MergedCommitID}} diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 2faedf3ef..f12b204d9 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -576,7 +576,12 @@ code, font-weight: normal; } - .avatar.image { + .avatar.image, + .avatar.image img, + .avatar.image svg, + .avatar.images .image, + .avatar.images img, + .avatar.images svg { border-radius: 3px; } diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 3f014103c..b1e1d6634 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -898,8 +898,20 @@ } > .merge-section { - border-top: 1px solid #d4d4d5; background-color: #f7f7f7; + + .item + .item { + padding-top: .5rem; + } + + .divider { + margin-left: -1rem; + margin-right: -1rem; + } + + &.no-header { + #avatar-arrow; + } } .markdown { @@ -1234,6 +1246,14 @@ } } } + + .pullrequest-form { + margin-bottom: 1.5rem; + } + + .markdown { + font-size: 14px; + } } .filter.dropdown .menu { diff --git a/web_src/less/_review.less b/web_src/less/_review.less index 38e5c6279..172a38d72 100644 --- a/web_src/less/_review.less +++ b/web_src/less/_review.less @@ -19,8 +19,11 @@ .add-comment-left.add-comment-right .ui.attached.header { border: 1px solid #d4d4d5; - margin-bottom: .5em; margin-top: .5em; + + &:not(.top) { + margin-bottom: .5em; + } } .focus-lines-new .ui.button.add-code-comment.add-code-comment-right,