mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-08 16:22:51 +02:00
Code review UI improvements and bugfixes (#4682)
* Code review UI improvements * More fixes to dark theme * Style fix * Fix to allow add code review comments only on review files tab * More readability dark style fixes * Fix commenting on deleted files. Fixes #4752 * Fix line blame getting for multiple corner cases
This commit is contained in:
1 parent
756eafaaf6
commit
4befec242a
11 files changed
+100
-32
No files matched your search
+6
-2
@@ -273,7 +273,7 @@ func (diff *Diff) NumFiles() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Example: @@ -1,8 +1,9 @@ => [..., 1, 8, 1, 9]
|
// Example: @@ -1,8 +1,9 @@ => [..., 1, 8, 1, 9]
|
||||||
var hunkRegex = regexp.MustCompile(`^@@ -([0-9]+),([0-9]+) \+([0-9]+),([0-9]+) @@`)
|
var hunkRegex = regexp.MustCompile(`^@@ -([0-9]+),([0-9]+) \+([0-9]+)(,([0-9]+))? @@`)
|
||||||
|
|
||||||
func isHeader(lof string) bool {
|
func isHeader(lof string) bool {
|
||||||
return strings.HasPrefix(lof, cmdDiffHead) || strings.HasPrefix(lof, "---") || strings.HasPrefix(lof, "+++")
|
return strings.HasPrefix(lof, cmdDiffHead) || strings.HasPrefix(lof, "---") || strings.HasPrefix(lof, "+++")
|
||||||
@@ -319,7 +319,11 @@ func CutDiffAroundLine(originalDiff io.Reader, line int64, old bool, numbersOfLi
|
|||||||
otherLine = com.StrTo(groups[3]).MustInt64()
|
otherLine = com.StrTo(groups[3]).MustInt64()
|
||||||
} else {
|
} else {
|
||||||
begin = com.StrTo(groups[3]).MustInt64()
|
begin = com.StrTo(groups[3]).MustInt64()
|
||||||
end = com.StrTo(groups[4]).MustInt64()
|
if groups[5] != "" {
|
||||||
|
end = com.StrTo(groups[5]).MustInt64()
|
||||||
|
} else {
|
||||||
|
end = 0
|
||||||
|
}
|
||||||
// init otherLine with begin of opposite side
|
// init otherLine with begin of opposite side
|
||||||
otherLine = com.StrTo(groups[1]).MustInt64()
|
otherLine = com.StrTo(groups[1]).MustInt64()
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -392,7 +392,7 @@ func (c *Comment) checkInvalidation(e Engine, doer *User, repo *git.Repository,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if c.CommitSHA != commit.ID.String() {
|
if c.CommitSHA != "" && c.CommitSHA != commit.ID.String() {
|
||||||
c.Invalidated = true
|
c.Invalidated = true
|
||||||
return UpdateComment(doer, c, "")
|
return UpdateComment(doer, c, "")
|
||||||
}
|
}
|
||||||
@@ -824,17 +824,18 @@ func CreateCodeComment(doer *User, repo *Repository, issue *Issue, content, tree
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("OpenRepository: %v", err)
|
return nil, fmt.Errorf("OpenRepository: %v", err)
|
||||||
}
|
}
|
||||||
// FIXME differentiate between previous and proposed line
|
|
||||||
var gitLine = line
|
|
||||||
if gitLine < 0 {
|
|
||||||
gitLine *= -1
|
|
||||||
}
|
|
||||||
// FIXME validate treePath
|
// FIXME validate treePath
|
||||||
// Get latest commit referencing the commented line
|
// Get latest commit referencing the commented line
|
||||||
commit, err := gitRepo.LineBlame(pr.GetGitRefName(), gitRepo.Path, treePath, uint(gitLine))
|
// No need for get commit for base branch changes
|
||||||
if err != nil {
|
if line > 0 {
|
||||||
return nil, fmt.Errorf("LineBlame[%s, %s, %s, %d]: %v", pr.GetGitRefName(), gitRepo.Path, treePath, gitLine, err)
|
commit, err := gitRepo.LineBlame(pr.GetGitRefName(), gitRepo.Path, treePath, uint(line))
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("LineBlame[%s, %s, %s, %d]: %v", pr.GetGitRefName(), gitRepo.Path, treePath, line, err)
|
||||||
|
}
|
||||||
|
commitID = commit.ID.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only fetch diff if comment is review comment
|
// Only fetch diff if comment is review comment
|
||||||
if reviewID != 0 {
|
if reviewID != 0 {
|
||||||
headCommitID, err := gitRepo.GetRefCommitID(pr.GetGitRefName())
|
headCommitID, err := gitRepo.GetRefCommitID(pr.GetGitRefName())
|
||||||
@@ -846,7 +847,6 @@ func CreateCodeComment(doer *User, repo *Repository, issue *Issue, content, tree
|
|||||||
return nil, fmt.Errorf("GetRawDiffForLine[%s, %s, %s, %s]: %v", err, gitRepo.Path, pr.MergeBase, headCommitID, treePath)
|
return nil, fmt.Errorf("GetRawDiffForLine[%s, %s, %s, %s]: %v", err, gitRepo.Path, pr.MergeBase, headCommitID, treePath)
|
||||||
}
|
}
|
||||||
patch = CutDiffAroundLine(strings.NewReader(patchBuf.String()), int64((&Comment{Line: line}).UnsignedLine()), line < 0, setting.UI.CodeCommentLines)
|
patch = CutDiffAroundLine(strings.NewReader(patchBuf.String()), int64((&Comment{Line: line}).UnsignedLine()), line < 0, setting.UI.CodeCommentLines)
|
||||||
commitID = commit.ID.String()
|
|
||||||
}
|
}
|
||||||
return CreateComment(&CreateCommentOptions{
|
return CreateComment(&CreateCommentOptions{
|
||||||
Type: CommentTypeCode,
|
Type: CommentTypeCode,
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
.tribute-container{box-shadow:0 1px 3px 1px #c7c7c7}.tribute-container ul{background:#fff}.tribute-container li{padding:8px 12px;border-bottom:1px solid #dcdcdc}.tribute-container li img{display:inline-block;vertical-align:middle;width:28px;height:28px;margin-right:5px}.tribute-container li span.fullname{font-weight:400;font-size:.8rem;margin-left:3px}.tribute-container li.highlight,.tribute-container li:hover{background:#2185D0;color:#fff}.emoji{width:1.5em;height:1.5em;display:inline-block;background-size:contain}body{font-family:Lato,"Segoe UI","Microsoft YaHei",Arial,Helvetica,sans-serif!important;background-color:#fff;overflow-y:scroll;-webkit-font-smoothing:antialiased}img{border-radius:3px}table{border-collapse:collapse}.rounded{border-radius:.28571429rem!important}code,pre{font:12px Consolas,"Liberation Mono",Menlo,Courier,monospace}code.raw,pre.raw{padding:7px 12px;margin:10px 0;background-color:#f8f8f8;border:1px solid #ddd;border-radius:3px;font-size:13px;line-height:1.5;overflow:auto}code.wrap,pre.wrap{white-space:pre-wrap;-ms-word-break:break-all;word-break:break-all;overflow-wrap:break-word;word-wrap:break-word}.dont-break-out{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.full.height{padding:0;margin:0 0 -40px 0;min-height:100%}.following.bar{z-index:900;left:0;width:100%;margin:0}.following.bar.light{background-color:#fff;border-bottom:1px solid #DDD;box-shadow:0 2px 3px rgba(0,0,0,.04)}.following.bar .column .menu{margin-top:0}.following.bar .top.menu a.item.brand{padding-left:0}.following.bar .brand .ui.mini.image{width:30px}.following.bar .top.menu .dropdown.item.active,.following.bar .top.menu .dropdown.item:hover,.following.bar .top.menu a.item:hover{background-color:transparent}.following.bar .top.menu a.item:hover{color:rgba(0,0,0,.45)}.following.bar .top.menu .menu{z-index:900}.following.bar .octicon{margin-right:.75em}.following.bar .octicon.fitted{margin-right:0}.following.bar .searchbox{background-color:#f4f4f4!important}.following.bar .searchbox:focus{background-color:#e9e9e9!important}.following.bar .text .octicon{width:16px;text-align:center}@media only screen and (max-width:767px){.following.bar #navbar:not(.shown)>:not(:first-child){display:none}}.right.stackable.menu{margin-left:auto;display:flex;display:-ms-flexbox;-ms-flex-align:inherit;align-items:inherit;-ms-flex-direction:inherit;flex-direction:inherit}.ui.left{float:left}.ui.right{float:right}.ui.button,.ui.menu .item{-moz-user-select:auto;-ms-user-select:auto;-webkit-user-select:auto;user-select:auto}.ui.container.fluid.padded{padding:0 10px 0 10px}.ui.form .ui.button{font-weight:400}.ui.floating.label{z-index:10}.ui.transparent.label{background-color:transparent}.ui.menu,.ui.segment,.ui.vertical.menu{box-shadow:none}.ui .menu:not(.vertical) .item>.button.compact{padding:.58928571em 1.125em}.ui .menu:not(.vertical) .item>.button.small{font-size:.92857143rem}.ui.dropdown .menu>.item>.floating.label{z-index:11}.ui.dropdown .menu .menu>.item>.floating.label{z-index:21}.ui .text.red{color:#d95c5c!important}.ui .text.red a{color:#d95c5c!important}.ui .text.red a:hover{color:#E67777!important}.ui .text.blue{color:#428bca!important}.ui .text.blue a{color:#15c!important}.ui .text.blue a:hover{color:#428bca!important}.ui .text.black{color:#444}.ui .text.black:hover{color:#000}.ui .text.grey{color:#767676!important}.ui .text.grey a{color:#444!important}.ui .text.grey a:hover{color:#000!important}.ui .text.light.grey{color:#888!important}.ui .text.green{color:#6cc644!important}.ui .text.purple{color:#6e5494!important}.ui .text.yellow{color:#FBBD08!important}.ui .text.gold{color:#a1882b!important}.ui .text.left{text-align:left!important}.ui .text.right{text-align:right!important}.ui .text.small{font-size:.75em}.ui .text.normal{font-weight:400}.ui .text.bold{font-weight:700}.ui .text.italic{font-style:italic}.ui .text.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.ui .text.thin{font-weight:400}.ui .text.middle{vertical-align:middle}.ui .message{text-align:center}.ui .header>i+.content{padding-left:.75rem;vertical-align:middle}.ui .warning.header{background-color:#F9EDBE!important;border-color:#F0C36D}.ui .warning.segment{border-color:#F0C36D}.ui .info.segment{border:1px solid #c5d5dd}.ui .info.segment.top{background-color:#e6f1f6!important}.ui .info.segment.top h3,.ui .info.segment.top h4{margin-top:0}.ui .info.segment.top h3:last-child{margin-top:4px}.ui .info.segment.top>:last-child{margin-bottom:0}.ui .normal.header{font-weight:400}.ui .avatar.image{border-radius:3px}.ui .form .fake{display:none!important}.ui .form .sub.field{margin-left:25px}.ui .sha.label{font-family:Consolas,Menlo,Monaco,"Lucida Console",monospace;font-size:13px;padding:6px 10px 4px 10px;font-weight:400;margin:0 6px}.ui.status.buttons .octicon{margin-right:4px}.ui.inline.delete-button{padding:8px 15px;fLine truncated
|
.tribute-container{box-shadow:0 1px 3px 1px #c7c7c7}.tribute-container ul{background:#fff}.tribute-container li{padding:8px 12px;border-bottom:1px solid #dcdcdc}.tribute-container li img{display:inline-block;vertical-align:middle;width:28px;height:28px;margin-right:5px}.tribute-container li span.fullname{font-weight:400;font-size:.8rem;margin-left:3px}.tribute-container li.highlight,.tribute-container li:hover{background:#2185D0;color:#fff}.emoji{width:1.5em;height:1.5em;display:inline-block;background-size:contain}body{font-family:Lato,"Segoe UI","Microsoft YaHei",Arial,Helvetica,sans-serif!important;background-color:#fff;overflow-y:scroll;-webkit-font-smoothing:antialiased}img{border-radius:3px}table{border-collapse:collapse}.rounded{border-radius:.28571429rem!important}code,pre{font:12px Consolas,"Liberation Mono",Menlo,Courier,monospace}code.raw,pre.raw{padding:7px 12px;margin:10px 0;background-color:#f8f8f8;border:1px solid #ddd;border-radius:3px;font-size:13px;line-height:1.5;overflow:auto}code.wrap,pre.wrap{white-space:pre-wrap;-ms-word-break:break-all;word-break:break-all;overflow-wrap:break-word;word-wrap:break-word}.dont-break-out{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.full.height{padding:0;margin:0 0 -40px 0;min-height:100%}.following.bar{z-index:900;left:0;width:100%;margin:0}.following.bar.light{background-color:#fff;border-bottom:1px solid #DDD;box-shadow:0 2px 3px rgba(0,0,0,.04)}.following.bar .column .menu{margin-top:0}.following.bar .top.menu a.item.brand{padding-left:0}.following.bar .brand .ui.mini.image{width:30px}.following.bar .top.menu .dropdown.item.active,.following.bar .top.menu .dropdown.item:hover,.following.bar .top.menu a.item:hover{background-color:transparent}.following.bar .top.menu a.item:hover{color:rgba(0,0,0,.45)}.following.bar .top.menu .menu{z-index:900}.following.bar .octicon{margin-right:.75em}.following.bar .octicon.fitted{margin-right:0}.following.bar .searchbox{background-color:#f4f4f4!important}.following.bar .searchbox:focus{background-color:#e9e9e9!important}.following.bar .text .octicon{width:16px;text-align:center}@media only screen and (max-width:767px){.following.bar #navbar:not(.shown)>:not(:first-child){display:none}}.right.stackable.menu{margin-left:auto;display:flex;display:-ms-flexbox;-ms-flex-align:inherit;align-items:inherit;-ms-flex-direction:inherit;flex-direction:inherit}.ui.left{float:left}.ui.right{float:right}.ui.button,.ui.menu .item{-moz-user-select:auto;-ms-user-select:auto;-webkit-user-select:auto;user-select:auto}.ui.container.fluid.padded{padding:0 10px 0 10px}.ui.form .ui.button{font-weight:400}.ui.floating.label{z-index:10}.ui.transparent.label{background-color:transparent}.ui.menu,.ui.segment,.ui.vertical.menu{box-shadow:none}.ui .menu:not(.vertical) .item>.button.compact{padding:.58928571em 1.125em}.ui .menu:not(.vertical) .item>.button.small{font-size:.92857143rem}.ui.dropdown .menu>.item>.floating.label{z-index:11}.ui.dropdown .menu .menu>.item>.floating.label{z-index:21}.ui .text.red{color:#d95c5c!important}.ui .text.red a{color:#d95c5c!important}.ui .text.red a:hover{color:#E67777!important}.ui .text.blue{color:#428bca!important}.ui .text.blue a{color:#15c!important}.ui .text.blue a:hover{color:#428bca!important}.ui .text.black{color:#444}.ui .text.black:hover{color:#000}.ui .text.grey{color:#767676!important}.ui .text.grey a{color:#444!important}.ui .text.grey a:hover{color:#000!important}.ui .text.light.grey{color:#888!important}.ui .text.green{color:#6cc644!important}.ui .text.purple{color:#6e5494!important}.ui .text.yellow{color:#FBBD08!important}.ui .text.gold{color:#a1882b!important}.ui .text.left{text-align:left!important}.ui .text.right{text-align:right!important}.ui .text.small{font-size:.75em}.ui .text.normal{font-weight:400}.ui .text.bold{font-weight:700}.ui .text.italic{font-style:italic}.ui .text.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.ui .text.thin{font-weight:400}.ui .text.middle{vertical-align:middle}.ui .message{text-align:center}.ui .header>i+.content{padding-left:.75rem;vertical-align:middle}.ui .warning.header{background-color:#F9EDBE!important;border-color:#F0C36D}.ui .warning.segment{border-color:#F0C36D}.ui .info.segment{border:1px solid #c5d5dd}.ui .info.segment.top{background-color:#e6f1f6!important}.ui .info.segment.top h3,.ui .info.segment.top h4{margin-top:0}.ui .info.segment.top h3:last-child{margin-top:4px}.ui .info.segment.top>:last-child{margin-bottom:0}.ui .normal.header{font-weight:400}.ui .avatar.image{border-radius:3px}.ui .form .fake{display:none!important}.ui .form .sub.field{margin-left:25px}.ui .sha.label{font-family:Consolas,Menlo,Monaco,"Lucida Console",monospace;font-size:13px;padding:6px 10px 4px 10px;font-weight:400;margin:0 6px}.ui.status.buttons .octicon{margin-right:4px}.ui.inline.delete-button{padding:8px 15px;fLine truncated
|
||||||
@@ -1 +1 @@
|
|||||||
.hljs{display:block;overflow-x:auto;padding:.5em;color:#bababa}.repository.file.list .non-diff-file-content .code-view .lines-code ol,.repository.file.list .non-diff-file-content .code-view .lines-num{background-color:#2b2b2b!important}.hljs-emphasis,.hljs-strong{color:#a8a8a2}.hljs-bullet,.hljs-link,.hljs-literal,.hljs-number,.hljs-quote,.hljs-regexp{color:#6896ba}.hljs-code,.hljs-selector-class{color:#a6e22e}.hljs-emphasis{font-style:italic}.hljs-attribute,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-variable{color:#cb7832}.hljs-params{color:#b9b9b9}.hljs-string{color:#6a8759}.hljs-addition,.hljs-built_in,.hljs-builtin-name,.hljs-selector-attr,.hljs-selector-id,.hljs-selector-pseudo,.hljs-subst,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-type{color:#e0c46c}.hljs-comment,.hljs-deletion,.hljs-meta{color:#7f7f7f}.repository .ui.segment.sub-menu .list .item a{color:#dbdbdb}.ui.horizontal.segments>.segment{background-color:#383c4a}body{background:#383c4a;color:#9e9e9e}a{color:#87ab63}a:hover{color:#a0cc75}.ui.card>.extra a:not(.ui):hover,.ui.cards>.card>.extra a:not(.ui):hover{color:#a0cc75}.ui.breadcrumb a:hover{color:#a0cc75}.ui.breadcrumb a{color:#87ab63}.repository .metas .ui.list a .text{color:#87ab63}.repository .metas .ui.list a .text:hover{color:#a0cc75}.repository .label.list .item a{color:#87ab63}.repository .label.list .item a:hover{color:#a0cc75}.repository .milestone.list>.item>a{color:#87ab63}.repository .milestone.list>.item>a:hover{color:#a0cc75}.repository.release #release-list{border-top:1px solid #4c505c}.repository .milestone.list>.item .operate>a{color:#87ab63}.repository .milestone.list>.item .operate>a:hover{color:#a0cc75}.ui.green.progress .bar{background-color:#684}.ui.progress.success .bar{background-color:#7b9e57!important}.following.bar.light{background:#2e323e}.ui.secondary.menu .active.item{color:#dbdbdb}.ui.secondary.menu .item{color:#9e9e9e}.following.bar .top.menu a.item:hover{color:#fff}.repository.view.issue .comment-list .comment .content>.bottom.segment a{border:solid 1px #353945;background-color:#353945}.following.bar.light{border-bottom:1px solid #313131}.ui.attached.header{background:#404552;border:1px solid #404552;color:#dbdbdb}.ui.attached.table{border:1px solid #304251;background:#304251}.feeds .list ul li:not(:last-child){border-bottom:1px solid #333640}.feeds .list ul li.private{background:#353945;border:1px solid #333640}.ui.secondary.menu .dropdown.item:hover,.ui.secondary.menu .link.item:hover,.ui.secondary.menu a.item:hover{color:#fff}.ui.menu .ui.dropdown .menu>.item{background:#2c303a!important;color:#9e9e9e!important}.ui.secondary.menu .dropdown.item>.menu,.ui.text.menu .dropdown.item>.menu{border:1px solid #434444}footer{background:#2e323e;border-top:1px solid #313131}.ui.menu .dropdown.item .menu{background:#2c303a}.ui.menu .ui.dropdown .menu>.item:hover,.ui.menu .ui.dropdown .menu>.selected.item{color:#fff!important}.ui.dropdown .menu>.header{color:#dbdbdb}.ui.red.label,.ui.red.labels .label{background-color:#7d3434!important;border-color:#8a2121!important}.ui.menu{background:#404552;border:1px solid #353945}.ui.menu .active.item:hover,.ui.vertical.menu .active.item:hover{color:#dbdbdb;background:#4B5162}.ui.link.menu .item:hover,.ui.menu .dropdown.item:hover,.ui.menu .link.item:hover,.ui.menu a.item:hover{color:#dbdbdb;background:#454b5a}.ui.menu .active.item{background:#4B5162;color:#dbdbdb}.ui.input input{background:#404552;border:2px solid #353945;color:#dbdbdb}.ui.input input:focus,.ui.input.focus input{background:#404552;border:2px solid #353945;color:#dbdbdb}.ui.label{color:#dbdbdb;background-color:#404552}.issue.list>.item .title{color:#87ab63}.issue.list>.item .title:hover{color:#a0cc75}.issue.list>.item{border-bottom:1px dashed #475767}.ui.green.label,.ui.green.labels .label{background-color:#2d693b!important;border-color:#2d693b!important}.issue.list>.item .comment{color:#129c92}.ui.basic.button,.ui.basic.buttons .button{color:#797979!important}.ui.basic.red.active.button,.ui.basic.red.buttons .active.button{box-shadow:0 0 0 1px #c75252 inset!important;color:#c75252!important}.ui.basic.button:focus,.ui.basic.button:hover,.ui.basic.buttons .button:focus,.ui.basic.buttons .button:hover{background:0 0!important;color:#dbdbdb!important}.ui.menu .item{background:#404552;color:#9e9e9e}.ui.menu .item.disabled,.ui.menu .item.disabled:hover{color:#626773}.ui.pagination.menu .active.item{color:#dbdbdb;background-color:#609926}.repository .header-wrapper{background-color:#2a2e3a}.ui.tabular.menu .active.item{background:#383c4a;color:#dbdbdb;border-left:1px solid transparent;border-right:1px solid transparent;border-top:none}.ui.tabular.menu .item{color:#9e9e9e}.ui.tabular.menu .item:hover{color:#dbdbdb}.ui.breadcrumb .divider,.ui.header{color:#9e9e9e}.ui.blue.label,.ui.blue.labels .label{background-color:#26577b!important;border-color:#26577b!important}.ui.menu .item>.label{background:#565454}.ui.blue.button,.ui.blue.Line truncated
|
.hljs{display:block;overflow-x:auto;padding:.5em;color:#bababa}.repository.file.list .non-diff-file-content .code-view .lines-code ol,.repository.file.list .non-diff-file-content .code-view .lines-num{background-color:#2b2b2b!important}.hljs-emphasis,.hljs-strong{color:#a8a8a2}.hljs-bullet,.hljs-link,.hljs-literal,.hljs-number,.hljs-quote,.hljs-regexp{color:#6896ba}.hljs-code,.hljs-selector-class{color:#a6e22e}.hljs-emphasis{font-style:italic}.hljs-attribute,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-variable{color:#cb7832}.hljs-params{color:#b9b9b9}.hljs-string{color:#6a8759}.hljs-addition,.hljs-built_in,.hljs-builtin-name,.hljs-selector-attr,.hljs-selector-id,.hljs-selector-pseudo,.hljs-subst,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-type{color:#e0c46c}.hljs-comment,.hljs-deletion,.hljs-meta{color:#7f7f7f}.repository .ui.segment.sub-menu .list .item a{color:#dbdbdb}.ui.horizontal.segments>.segment{background-color:#383c4a}body{background:#383c4a;color:#9e9e9e}a{color:#87ab63}a:hover{color:#a0cc75}.ui.card>.extra a:not(.ui):hover,.ui.cards>.card>.extra a:not(.ui):hover{color:#a0cc75}.ui.breadcrumb a:hover{color:#a0cc75}.ui.breadcrumb a{color:#87ab63}.repository .metas .ui.list a .text{color:#87ab63}.repository .metas .ui.list a .text:hover{color:#a0cc75}.repository .label.list .item a{color:#87ab63}.repository .label.list .item a:hover{color:#a0cc75}.repository .milestone.list>.item>a{color:#87ab63}.repository .milestone.list>.item>a:hover{color:#a0cc75}.repository.release #release-list{border-top:1px solid #4c505c}.repository .milestone.list>.item .operate>a{color:#87ab63}.repository .milestone.list>.item .operate>a:hover{color:#a0cc75}.ui.green.progress .bar{background-color:#684}.ui.progress.success .bar{background-color:#7b9e57!important}.following.bar.light{background:#2e323e}.ui.secondary.menu .active.item{color:#dbdbdb}.ui.secondary.menu .item{color:#9e9e9e}.following.bar .top.menu a.item:hover{color:#fff}.repository.view.issue .comment-list .comment .content>.bottom.segment a{border:solid 1px #353945;background-color:#353945}.following.bar.light{border-bottom:1px solid #313131}.ui.attached.header{background:#404552;border:1px solid #404552;color:#dbdbdb}.ui.attached.table{border:1px solid #304251;background:#304251}.feeds .list ul li:not(:last-child){border-bottom:1px solid #333640}.feeds .list ul li.private{background:#353945;border:1px solid #333640}.ui.secondary.menu .dropdown.item:hover,.ui.secondary.menu .link.item:hover,.ui.secondary.menu a.item:hover{color:#fff}.ui.menu .ui.dropdown .menu>.item{background:#2c303a!important;color:#9e9e9e!important}.ui.secondary.menu .dropdown.item>.menu,.ui.text.menu .dropdown.item>.menu{border:1px solid #434444}footer{background:#2e323e;border-top:1px solid #313131}.ui.menu .dropdown.item .menu{background:#2c303a}.ui.menu .ui.dropdown .menu>.item:hover,.ui.menu .ui.dropdown .menu>.selected.item{color:#fff!important}.ui.dropdown .menu>.header{color:#dbdbdb}.ui.red.label,.ui.red.labels .label{background-color:#7d3434!important;border-color:#8a2121!important}.ui.menu{background:#404552;border:1px solid #353945}.ui.menu .active.item:hover,.ui.vertical.menu .active.item:hover{color:#dbdbdb;background:#4B5162}.ui.link.menu .item:hover,.ui.menu .dropdown.item:hover,.ui.menu .link.item:hover,.ui.menu a.item:hover{color:#dbdbdb;background:#454b5a}.ui.menu .active.item{background:#4B5162;color:#dbdbdb}.ui.input input{background:#404552;border:2px solid #353945;color:#dbdbdb}.ui.input input:focus,.ui.input.focus input{background:#404552;border:2px solid #353945;color:#dbdbdb}.ui.accordion .title:not(.ui){color:#dbdbdb}.ui.label{color:#dbdbdb;background-color:#404552}.issue.list>.item .title{color:#87ab63}.issue.list>.item .title:hover{color:#a0cc75}.issue.list>.item{border-bottom:1px dashed #475767}.ui.basic.green.label,.ui.green.label,.ui.green.labels .label{background-color:#2d693b!important;border-color:#2d693b!important}.ui.basic.green.labels a.label:hover,a.ui.basic.green.label:hover{background-color:#16ab39!important;border-color:#16ab39!important;color:#fff!important}.issue.list>.item .comment{color:#129c92}.ui.basic.button,.ui.basic.buttons .button{color:#797979!important}.ui.basic.red.active.button,.ui.basic.red.buttons .active.button{box-shadow:0 0 0 1px #c75252 inset!important;color:#c75252!important}.ui.basic.button:focus,.ui.basic.button:hover,.ui.basic.buttons .button:focus,.ui.basic.buttons .button:hover{background:0 0!important;color:#dbdbdb!important}.ui.menu .item{background:#404552;color:#9e9e9e}.ui.menu .item.disabled,.ui.menu .item.disabled:hover{color:#626773}.ui.pagination.menu .active.item{color:#dbdbdb;background-color:#609926}.repository .header-wrapper{background-color:#2a2e3a}.ui.tabular.menu .active.item{background:#383c4a;color:#dbdbdb;border-left:1px solid transparent;border-right:1px solid transparent;border-top:none}.ui.tabular.menu .item{color:#9e9e9e}.ui.tabular.menu .item:hover{color:#dbdbdb}Line truncated
|
||||||
+2
-2
@@ -780,7 +780,7 @@ function initPullRequestReview() {
|
|||||||
$("#show-outdated-" + id).removeClass('hide');
|
$("#show-outdated-" + id).removeClass('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.comment-form-reply').on('click', function (e) {
|
$('button.comment-form-reply').on('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
var form = $(this).parent().find('.comment-form')
|
var form = $(this).parent().find('.comment-form')
|
||||||
@@ -2649,7 +2649,7 @@ function cancelCodeComment(btn) {
|
|||||||
var form = $(btn).closest("form");
|
var form = $(btn).closest("form");
|
||||||
if(form.length > 0 && form.hasClass('comment-form')) {
|
if(form.length > 0 && form.hasClass('comment-form')) {
|
||||||
form.addClass('hide');
|
form.addClass('hide');
|
||||||
form.parent().find('.comment-form-reply').show();
|
form.parent().find('button.comment-form-reply').show();
|
||||||
}else {
|
}else {
|
||||||
console.log("Hey");
|
console.log("Hey");
|
||||||
form.closest('.comment-code-cloud').remove()
|
form.closest('.comment-code-cloud').remove()
|
||||||
|
|||||||
@@ -42,14 +42,21 @@
|
|||||||
top: -13px;
|
top: -13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.attached.tab {
|
.attached
|
||||||
border: none;
|
{
|
||||||
padding: 0;
|
&.tab {
|
||||||
margin: 0;
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
&.markdown {
|
&.markdown {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
min-height: 168px;
|
min-height: 168px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.header {
|
||||||
|
padding: .1rem 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,8 +99,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-form-reply {
|
button.comment-form-reply {
|
||||||
margin: 0.5em !important;
|
margin: 0.5em 0.5em 0.5em 4.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
form.comment-form-reply {
|
||||||
|
margin: 0 0 0 4em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -181,6 +181,9 @@
|
|||||||
background: #404552;
|
background: #404552;
|
||||||
border: 2px solid #353945;
|
border: 2px solid #353945;
|
||||||
color: #dbdbdb;
|
color: #dbdbdb;
|
||||||
|
}
|
||||||
|
.ui.accordion .title:not(.ui) {
|
||||||
|
color: #dbdbdb;
|
||||||
}
|
}
|
||||||
.ui.label {
|
.ui.label {
|
||||||
color: #dbdbdb;
|
color: #dbdbdb;
|
||||||
@@ -195,9 +198,14 @@
|
|||||||
.issue.list > .item {
|
.issue.list > .item {
|
||||||
border-bottom: 1px dashed #475767;
|
border-bottom: 1px dashed #475767;
|
||||||
}
|
}
|
||||||
.ui.green.label, .ui.green.labels .label {
|
.ui.green.label, .ui.green.labels .label, .ui.basic.green.label {
|
||||||
background-color: #2d693b!important;
|
background-color: #2d693b!important;
|
||||||
border-color: #2d693b!important;
|
border-color: #2d693b!important;
|
||||||
|
}
|
||||||
|
.ui.basic.green.labels a.label:hover, a.ui.basic.green.label:hover {
|
||||||
|
background-color: #16ab39 !important;
|
||||||
|
border-color: #16ab39 !important;
|
||||||
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
.issue.list > .item .comment {
|
.issue.list > .item .comment {
|
||||||
color: #129c92;
|
color: #129c92;
|
||||||
@@ -554,10 +562,17 @@
|
|||||||
}
|
}
|
||||||
.ui.attached.info.message, .ui.info.message {
|
.ui.attached.info.message, .ui.info.message {
|
||||||
box-shadow: 0 0 0 1px #4b5e71 inset, 0 0 0 0 transparent;
|
box-shadow: 0 0 0 1px #4b5e71 inset, 0 0 0 0 transparent;
|
||||||
|
}
|
||||||
|
.ui.positive.message {
|
||||||
|
background-color: #2c662d;
|
||||||
|
color: #fcfff5;
|
||||||
}
|
}
|
||||||
.ui.info.message {
|
.ui.info.message {
|
||||||
background-color: #2c3b4a;
|
background-color: #2c3b4a;
|
||||||
color: #9ebcc5;
|
color: #9ebcc5;
|
||||||
|
}
|
||||||
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
|
border-left: 1px solid #9e9e9e;
|
||||||
}
|
}
|
||||||
.ui .warning.header {
|
.ui .warning.header {
|
||||||
background-color: #5d3a22 !important;
|
background-color: #5d3a22 !important;
|
||||||
@@ -767,8 +782,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.repository .diff-detail-box {
|
.repository .diff-detail-box {
|
||||||
background-color: inherit;
|
background-color: #383c4a;
|
||||||
.detail-files {
|
.detail-files {
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.comment-code-cloud {
|
||||||
|
.ui.attached.tabular.menu {
|
||||||
|
background: none transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.footer .markdown-info {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-comment {
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.comments .comment {
|
||||||
|
.author {
|
||||||
|
color: #dbdbdb;
|
||||||
|
}
|
||||||
|
.metadata {
|
||||||
|
color: #808084;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
color: #9e9e9e;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -128,13 +128,23 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if form.HasEmptyContent() {
|
review, err = models.GetCurrentReview(ctx.User, issue)
|
||||||
|
if err == nil {
|
||||||
|
review.Issue = issue
|
||||||
|
if errl := review.LoadCodeComments(); errl != nil {
|
||||||
|
ctx.ServerError("LoadCodeComments", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((err == nil && len(review.CodeComments) == 0) ||
|
||||||
|
(err != nil && models.IsErrReviewNotExist(err))) &&
|
||||||
|
form.HasEmptyContent() {
|
||||||
ctx.Flash.Error(ctx.Tr("repo.issues.review.content.empty"))
|
ctx.Flash.Error(ctx.Tr("repo.issues.review.content.empty"))
|
||||||
ctx.Redirect(fmt.Sprintf("%s/pulls/%d/files", ctx.Repo.RepoLink, issue.Index))
|
ctx.Redirect(fmt.Sprintf("%s/pulls/%d/files", ctx.Repo.RepoLink, issue.Index))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
review, err = models.GetCurrentReview(ctx.User, issue)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !models.IsErrReviewNotExist(err) {
|
if !models.IsErrReviewNotExist(err) {
|
||||||
ctx.ServerError("GetCurrentReview", err)
|
ctx.ServerError("GetCurrentReview", err)
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="lines-code lines-code-old halfwidth">
|
<td class="lines-code lines-code-old halfwidth">
|
||||||
{{if and $.root.SignedUserID $line.CanComment}}
|
{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}
|
||||||
<a class="ui green button add-code-comment add-code-comment-left" data-path="{{$file.Name}}" data-side="left" data-idx="{{$line.LeftIdx}}">+</a>
|
<a class="ui green button add-code-comment add-code-comment-left" data-path="{{$file.Name}}" data-side="left" data-idx="{{$line.LeftIdx}}">+</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
<pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>
|
<pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{{if $.hidden}}
|
{{if $.hidden}}
|
||||||
<button class="comment-form-reply ui green labeled icon tiny button"><i class="reply icon"></i> {{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
|
<button class="comment-form-reply ui green labeled icon tiny button"><i class="reply icon"></i> {{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form class="ui form {{if $.hidden}}hide comment-form{{end}}" action="{{$.root.Issue.HTMLURL}}/files/reviews/comments" method="post">
|
<form class="ui form {{if $.hidden}}hide comment-form comment-form-reply{{end}}" action="{{$.root.Issue.HTMLURL}}/files/reviews/comments" method="post">
|
||||||
{{$.root.CsrfTokenHtml}}
|
{{$.root.CsrfTokenHtml}}
|
||||||
<input type="hidden" name="side" value="{{if $.Side}}{{$.Side}}{{end}}">
|
<input type="hidden" name="side" value="{{if $.Side}}{{$.Side}}{{end}}">
|
||||||
<input type="hidden" name="line" value="{{if $.Line}}{{$.Line}}{{end}}">
|
<input type="hidden" name="line" value="{{if $.Line}}{{$.Line}}{{end}}">
|
||||||
@@ -34,8 +34,10 @@
|
|||||||
class="ui submit green tiny button btn-start-review">{{$.root.i18n.Tr "repo.diff.comment.start_review"}}</button>
|
class="ui submit green tiny button btn-start-review">{{$.root.i18n.Tr "repo.diff.comment.start_review"}}</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{if not $.root.CurrentReview}}
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="ui submit tiny basic button btn-add-single">{{$.root.i18n.Tr "repo.diff.comment.add_single_comment"}}</button>
|
class="ui submit tiny basic button btn-add-single">{{$.root.i18n.Tr "repo.diff.comment.add_single_comment"}}</button>
|
||||||
|
{{end}}
|
||||||
{{if or (not $.HasComments) $.hidden}}
|
{{if or (not $.HasComments) $.hidden}}
|
||||||
<button type="button" class="ui submit tiny basic button btn-cancel" onclick="cancelCodeComment(this);">{{$.root.i18n.Tr "cancel"}}</button>
|
<button type="button" class="ui submit tiny basic button btn-cancel" onclick="cancelCodeComment(this);">{{$.root.i18n.Tr "cancel"}}</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</td>
|
</td>
|
||||||
{{end}}
|
{{end}}
|
||||||
<td class="lines-code {{if (not $line.RightIdx)}}lines-code-old{{end}}">
|
<td class="lines-code {{if (not $line.RightIdx)}}lines-code-old{{end}}">
|
||||||
{{if and $.root.SignedUserID $line.CanComment}}
|
{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}
|
||||||
<a class="ui green button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}" data-path="{{$file.Name}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">+</a>
|
<a class="ui green button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}" data-path="{{$file.Name}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">+</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
<pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
|
<pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
|
||||||
|
|||||||
Reference in new issue
Block a user