mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-07 11:55:42 +02:00
Fix comment header
This commit is contained in:
@@ -328,9 +328,10 @@ trait PullRequestService { self: IssuesService with CommitsService =>
|
||||
.map(commit => getCommitComments(userName, repositoryName, commit.id, true))
|
||||
.flatten ++ getComments(userName, repositoryName, issueId))
|
||||
.groupBy {
|
||||
case x: IssueComment => (Some(x.commentId), None, None, None)
|
||||
case x: CommitComment => (None, x.fileName, x.oldLine, x.newLine)
|
||||
case x => throw new MatchError(x)
|
||||
case x: IssueComment => (Some(x.commentId), None, None, None)
|
||||
case x: CommitComment if x.fileName.isEmpty => (Some(x.commentId), None, None, None)
|
||||
case x: CommitComment => (None, x.fileName, x.oldLine, x.newLine)
|
||||
case x => throw new MatchError(x)
|
||||
}
|
||||
.toSeq
|
||||
.map {
|
||||
@@ -353,9 +354,6 @@ trait PullRequestService { self: IssuesService with CommitsService =>
|
||||
newLine
|
||||
)
|
||||
)
|
||||
// Comment on a specific commit
|
||||
case (_, comments) =>
|
||||
comments.head // TODO In this case, something wrong in the presentation of the comments list.
|
||||
}
|
||||
.sortWith(_.registeredDate before _.registeredDate)
|
||||
}
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<span class="monospace">@comments.fileName</span>
|
||||
<span class="pull-right">
|
||||
<a href="@helpers.url(repository)/commit/@comments.comments.head.commitId" class="monospace">@comments.comments.head.commitId.substring(0, 7)</a>
|
||||
</span>
|
||||
</div>
|
||||
@comments.diff.map(helpers.diff)
|
||||
<div class="panel-body">
|
||||
|
||||
@@ -236,9 +236,35 @@
|
||||
@gitbucket.core.helper.html.commitcomments(comments, isManageable, repository, pullreq.map(_.commitIdTo))
|
||||
}
|
||||
case comment: gitbucket.core.model.CommitComment => {
|
||||
@gitbucket.core.helper.html.commitcomments(gitbucket.core.model.CommitComments(
|
||||
comment.fileName.getOrElse(""), comment.commentedUserName, comment.registeredDate, Seq(comment), None
|
||||
), isManageable, repository, pullreq.map(_.commitIdTo))
|
||||
<div class="panel panel-default issue-comment-box" id="comment-@comment.commentId">
|
||||
<div class="panel-heading">
|
||||
@helpers.avatar(comment.commentedUserName, 20)
|
||||
@helpers.user(comment.commentedUserName, styleClass="username strong")
|
||||
<span class="muted">
|
||||
commented
|
||||
<a href="#comment-@comment.commentId">@gitbucket.core.helper.html.datetimeago(comment.registeredDate)</a>
|
||||
on
|
||||
<a href="@helpers.url(repository)/commit/@comment.commitId" class="monospace">@comment.commitId.substring(0, 7)</a>
|
||||
</span>
|
||||
@if((isManageable || context.loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){
|
||||
<span class="pull-right">
|
||||
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil" aria-label="Edit"></i></a>
|
||||
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x" aria-label="Remove"></i></a>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
<div class="panel-body markdown-body" id="commentContent-@comment.commentId">
|
||||
@helpers.markdown(
|
||||
markdown = comment.content,
|
||||
repository = repository,
|
||||
enableWikiLink = false,
|
||||
enableRefsLink = true,
|
||||
enableLineBreaks = true,
|
||||
enableTaskList = true,
|
||||
hasWritePermission = isManageable
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user