From a39fe6282b2b67b3014f7e8c335f82834694a7e3 Mon Sep 17 00:00:00 2001 From: Michael Gnehr Date: Thu, 4 Jul 2019 16:11:10 +0200 Subject: [PATCH 1/2] cut timeline length with last element on issue view fix #7304 - lightly enlight dark theme issue timeline color Signed-off-by: Michael Gnehr --- public/css/index.css | 4 +- public/css/theme-arc-green.css | 2 +- public/less/_repository.less | 20 ++- public/less/themes/arc-green.less | 5 +- templates/repo/issue/view_content.tmpl | 192 +++++++++++++------------ 5 files changed, 123 insertions(+), 100 deletions(-) diff --git a/public/css/index.css b/public/css/index.css index f4f95ce08193c..6c4af6adf257e 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -524,7 +524,9 @@ footer .ui.left,footer .ui.right{line-height:40px} .repository.view.issue .pull .review-item .type-icon{float:right;margin-right:1em} .repository.view.issue .pull .review-item .divider{margin:.5rem 0} .repository.view.issue .pull .review-item .review-content{padding:1em 0 1em 3.8em} -.repository.view.issue .comment-list:before{display:block;content:"";position:absolute;margin-top:12px;margin-bottom:14px;top:0;bottom:0;left:96px;width:2px;background-color:#f3f3f3;z-index:-1} +.repository.view.issue .comment-list:not(.prevent-before-timeline):before{display:block;content:"";position:absolute;margin-top:12px;margin-bottom:14px;top:0;bottom:0;left:96px;width:2px;background-color:#f3f3f3;z-index:-1} +.repository.view.issue .comment-list .timeline-line{position:relative} +.repository.view.issue .comment-list .timeline-line:before{display:block;content:"";position:absolute;margin-top:12px;margin-bottom:14px;top:0;bottom:0;left:82px;width:2px;background-color:#f3f3f3;z-index:-1} .repository.view.issue .comment-list .comment .avatar{width:3em} .repository.view.issue .comment-list .comment .tag{color:#767676;margin-top:3px;padding:2px 5px;font-size:12px;border:1px solid rgba(0,0,0,.1);border-radius:3px} .repository.view.issue .comment-list .comment .actions .item{float:left} diff --git a/public/css/theme-arc-green.css b/public/css/theme-arc-green.css index a93404cad097f..2a7836efc8264 100644 --- a/public/css/theme-arc-green.css +++ b/public/css/theme-arc-green.css @@ -118,7 +118,7 @@ footer{background:#2e323e;border-top:1px solid #313131} .repository.new.issue .comment.form .content:after{border-right-color:#353945} .repository.view.issue .comment-list .comment .content .header:before{border-right-color:#404552} .repository.new.issue .comment.form .content:before{border-right-color:#353945} -.repository.view.issue .comment-list:before{background-color:#313c47} +.repository.view.issue .comment-list .timeline-line:before,.repository.view.issue .comment-list:not(.prevent-before-timeline):before{background-color:#3b4954} .repository .comment.form .content .form:after{border-right-color:#313c47} .repository .comment.form .content .form:before{border-right-color:#313c47} .ui .text.grey a:hover{color:#dbdbdb!important} diff --git a/public/less/_repository.less b/public/less/_repository.less index 5a57f5db71975..8a1146562e36e 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -749,7 +749,7 @@ } .comment-list { - &:before { + &:not(.prevent-before-timeline):before { display: block; content: ""; position: absolute; @@ -763,6 +763,24 @@ z-index: -1; } + .timeline-line { + position: relative; + + &:before { + display: block; + content: ""; + position: absolute; + margin-top: 12px; + margin-bottom: 14px; + top: 0; + bottom: 0; + left: 82px; + width: 2px; + background-color: #f3f3f3; + z-index: -1; + } + } + .comment { .avatar { width: @comment-avatar-width; diff --git a/public/less/themes/arc-green.less b/public/less/themes/arc-green.less index 4780756bce22c..d4200b5162269 100644 --- a/public/less/themes/arc-green.less +++ b/public/less/themes/arc-green.less @@ -619,8 +619,9 @@ a.ui.basic.green.label:hover { border-right-color: #353945; } -.repository.view.issue .comment-list:before { - background-color: #313c47; +.repository.view.issue .comment-list:not(.prevent-before-timeline):before, +.repository.view.issue .comment-list .timeline-line:before { + background-color: #3b4954; } .repository .comment.form .content .form:after { diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index cb85c5be9782f..eb9b5827e39a7 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -9,109 +9,69 @@ {{end}} {{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }} -
+
-
- - - -
-
- {{.Issue.Poster.GetDisplayName}} {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}} - {{if not $.Repository.IsArchived}} -
- {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} - {{if or .IsIssueWriter .IsIssuePoster}} -
- -
- {{end}} -
- {{end}} -
-
-
- {{if .Issue.RenderedContent}} - {{.Issue.RenderedContent|Str2html}} - {{else}} - {{.i18n.Tr "repo.issues.no_content"}} +
+
+ + + +
+
+ {{.Issue.Poster.GetDisplayName}} {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}} + {{if not $.Repository.IsArchived}} +
+ {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} + {{if or .IsIssueWriter .IsIssuePoster}} +
+ +
+ {{end}} +
{{end}}
-
{{.Issue.Content}}
-
-
- {{$reactions := .Issue.Reactions.GroupByType}} - {{if $reactions}} -
- {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }} -
- {{end}} - {{if .Issue.Attachments}} -
-
- {{range .Issue.Attachments}} - - {{if FilenameIsImage .Name}} - - {{else}} - - {{end}} - +
+
+ {{if .Issue.RenderedContent}} + {{.Issue.RenderedContent|Str2html}} + {{else}} + {{.i18n.Tr "repo.issues.no_content"}} {{end}}
+
{{.Issue.Content}}
+
- {{end}} -
-
- - {{ template "repo/issue/view_content/comments" . }} - - {{if and .Issue.IsPull (not $.Repository.IsArchived)}} - {{ template "repo/issue/view_content/pull". }} - {{end}} - {{if .IsSigned}} - {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} -
- - - -
-
- {{template "repo/issue/comment_tab" .}} - {{.CsrfTokenHtml}} - -
- {{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}} - {{if .Issue.IsClosed}} -
- {{.i18n.Tr "repo.issues.reopen_issue"}} -
- {{else}} -
- {{.i18n.Tr "repo.issues.close_issue"}} -
+ {{$reactions := .Issue.Reactions.GroupByType}} + {{if $reactions}} +
+ {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }} +
+ {{end}} + {{if .Issue.Attachments}} +
+
+ {{range .Issue.Attachments}} + + {{if FilenameIsImage .Name}} + + {{else}} + + {{end}} + {{end}} - {{end}} - +
- + {{end}}
- {{ end }} - {{else}} - {{if .Repository.IsArchived}} -
- {{if .Issue.IsPull}} - {{.i18n.Tr "repo.archive.pull.nocomment"}} - {{else}} - {{.i18n.Tr "repo.archive.issue.nocomment"}} - {{end}} -
- {{else}} + + {{ template "repo/issue/view_content/comments" . }} + + {{if and .Issue.IsPull (not $.Repository.IsArchived)}} + {{ template "repo/issue/view_content/pull". }} + {{end}} {{if .IsSigned}} - {{if .Repository.IsArchived}} + {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
- {{end}} + {{ end }} {{else}} + {{if .Repository.IsArchived}}
- {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}} + {{if .Issue.IsPull}} + {{.i18n.Tr "repo.archive.pull.nocomment"}} + {{else}} + {{.i18n.Tr "repo.archive.issue.nocomment"}} + {{end}}
+ {{else}} + {{if .IsSigned}} + {{if .Repository.IsArchived}} +
+ + + +
+
+ {{template "repo/issue/comment_tab" .}} + {{.CsrfTokenHtml}} + +
+ {{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}} + {{if .Issue.IsClosed}} +
+ {{.i18n.Tr "repo.issues.reopen_issue"}} +
+ {{else}} +
+ {{.i18n.Tr "repo.issues.close_issue"}} +
+ {{end}} + {{end}} + +
+
+
+
+ {{end}} + {{else}} +
+ {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}} +
+ {{end}} {{end}} {{end}} - {{end}} +
From 370341aee908cceff0bbe971e021ad30341c14e9 Mon Sep 17 00:00:00 2001 From: Michael Gnehr Date: Sat, 6 Jul 2019 04:16:07 +0200 Subject: [PATCH 2/2] remove new container Signed-off-by: Michael Gnehr --- public/css/index.css | 2 +- public/less/_repository.less | 3 + templates/repo/issue/view_content.tmpl | 192 ++++++++++++------------- 3 files changed, 99 insertions(+), 98 deletions(-) diff --git a/public/css/index.css b/public/css/index.css index 6c4af6adf257e..8af38e4825152 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -525,7 +525,7 @@ footer .ui.left,footer .ui.right{line-height:40px} .repository.view.issue .pull .review-item .divider{margin:.5rem 0} .repository.view.issue .pull .review-item .review-content{padding:1em 0 1em 3.8em} .repository.view.issue .comment-list:not(.prevent-before-timeline):before{display:block;content:"";position:absolute;margin-top:12px;margin-bottom:14px;top:0;bottom:0;left:96px;width:2px;background-color:#f3f3f3;z-index:-1} -.repository.view.issue .comment-list .timeline-line{position:relative} +.repository.view.issue .comment-list .timeline-line{position:relative;display:block;width:100%;max-width:100%} .repository.view.issue .comment-list .timeline-line:before{display:block;content:"";position:absolute;margin-top:12px;margin-bottom:14px;top:0;bottom:0;left:82px;width:2px;background-color:#f3f3f3;z-index:-1} .repository.view.issue .comment-list .comment .avatar{width:3em} .repository.view.issue .comment-list .comment .tag{color:#767676;margin-top:3px;padding:2px 5px;font-size:12px;border:1px solid rgba(0,0,0,.1);border-radius:3px} diff --git a/public/less/_repository.less b/public/less/_repository.less index 8a1146562e36e..dd986c88323f7 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -765,6 +765,9 @@ .timeline-line { position: relative; + display: block; + width: 100%; + max-width: 100%; &:before { display: block; diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index eb9b5827e39a7..16700a8dc19a0 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -10,68 +10,108 @@ {{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }}
- -
-
- - - -
-
- {{.Issue.Poster.GetDisplayName}} {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}} - {{if not $.Repository.IsArchived}} -
- {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} - {{if or .IsIssueWriter .IsIssuePoster}} -
- -
- {{end}} -
+ +
+ + + +
+
+ {{.Issue.Poster.GetDisplayName}} {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}} + {{if not $.Repository.IsArchived}} +
+ {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} + {{if or .IsIssueWriter .IsIssuePoster}} +
+ +
+ {{end}} +
+ {{end}} +
+
+
+ {{if .Issue.RenderedContent}} + {{.Issue.RenderedContent|Str2html}} + {{else}} + {{.i18n.Tr "repo.issues.no_content"}} {{end}}
-
-
- {{if .Issue.RenderedContent}} - {{.Issue.RenderedContent|Str2html}} - {{else}} - {{.i18n.Tr "repo.issues.no_content"}} +
{{.Issue.Content}}
+
+
+ {{$reactions := .Issue.Reactions.GroupByType}} + {{if $reactions}} +
+ {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }} +
+ {{end}} + {{if .Issue.Attachments}} +
+
+ {{range .Issue.Attachments}} + + {{if FilenameIsImage .Name}} + + {{else}} + + {{end}} + {{end}}
-
{{.Issue.Content}}
-
- {{$reactions := .Issue.Reactions.GroupByType}} - {{if $reactions}} -
- {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }} -
- {{end}} - {{if .Issue.Attachments}} -
-
- {{range .Issue.Attachments}} - - {{if FilenameIsImage .Name}} - - {{else}} - - {{end}} - + {{end}} +
+
+ + {{ template "repo/issue/view_content/comments" . }} + + {{if and .Issue.IsPull (not $.Repository.IsArchived)}} + {{ template "repo/issue/view_content/pull". }} + {{end}} + {{if .IsSigned}} + {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} +
+ + + +
+
+ {{template "repo/issue/comment_tab" .}} + {{.CsrfTokenHtml}} + +
+ {{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}} + {{if .Issue.IsClosed}} +
+ {{.i18n.Tr "repo.issues.reopen_issue"}} +
+ {{else}} +
+ {{.i18n.Tr "repo.issues.close_issue"}} +
{{end}} -
+ {{end}} +
- {{end}} +
- - {{ template "repo/issue/view_content/comments" . }} - - {{if and .Issue.IsPull (not $.Repository.IsArchived)}} - {{ template "repo/issue/view_content/pull". }} - {{end}} + {{ end }} + {{else}} + {{if .Repository.IsArchived}} +
+ {{if .Issue.IsPull}} + {{.i18n.Tr "repo.archive.pull.nocomment"}} + {{else}} + {{.i18n.Tr "repo.archive.issue.nocomment"}} + {{end}} +
+ {{else}} {{if .IsSigned}} - {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} + {{if .Repository.IsArchived}}
- {{ end }} + {{end}} {{else}} - {{if .Repository.IsArchived}}
- {{if .Issue.IsPull}} - {{.i18n.Tr "repo.archive.pull.nocomment"}} - {{else}} - {{.i18n.Tr "repo.archive.issue.nocomment"}} - {{end}} + {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}
- {{else}} - {{if .IsSigned}} - {{if .Repository.IsArchived}} -
- - - -
-
- {{template "repo/issue/comment_tab" .}} - {{.CsrfTokenHtml}} - -
- {{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}} - {{if .Issue.IsClosed}} -
- {{.i18n.Tr "repo.issues.reopen_issue"}} -
- {{else}} -
- {{.i18n.Tr "repo.issues.close_issue"}} -
- {{end}} - {{end}} - -
-
-
-
- {{end}} - {{else}} -
- {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}} -
- {{end}} {{end}} {{end}} -
+ {{end}}