mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-02-12 09:37:02 +01:00
(refs #2057)Fix duplicate event handler registration in commit comments
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
isManageable: Boolean,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
pullreq: Option[gitbucket.core.model.PullRequest] = None,
|
||||
commitId: Option[String] = None)(implicit context: gitbucket.core.controller.Context)
|
||||
commitId: Option[String] = None,
|
||||
renderScript: Boolean = true)(implicit context: gitbucket.core.controller.Context)
|
||||
@import gitbucket.core.view.helpers
|
||||
@issueOrPullRequest()={ @if(issue.exists(_.isPullRequest))( "pull request" )else( "issue" ) }
|
||||
@showFormattedComment(comment: gitbucket.core.model.IssueComment)={
|
||||
@@ -279,6 +280,7 @@
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@if(renderScript){
|
||||
<script>
|
||||
$(function(){
|
||||
@if(issue.isDefined){
|
||||
@@ -415,3 +417,4 @@ $(function(){
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
@import gitbucket.core.model.CommitComment
|
||||
@(commitId: String,
|
||||
commit: gitbucket.core.util.JGitUtil.CommitInfo,
|
||||
branches: List[String],
|
||||
@@ -26,7 +25,7 @@
|
||||
<div class="small" style="font-weight: normal;">
|
||||
@if(branches.nonEmpty){
|
||||
<span class="muted">
|
||||
<i class="octicon octicon-git-branch"></i>
|
||||
<i class="octicon octicon-git-branch"></i>
|
||||
@branches.zipWithIndex.map { case (branch, i) =>
|
||||
<a href="@helpers.url(repository)/tree/@helpers.encodeRefName(branch)" class="branch" id="branch-@i">@branch</a>
|
||||
}
|
||||
@@ -34,7 +33,7 @@
|
||||
}
|
||||
@if(tags.nonEmpty){
|
||||
<span class="muted">
|
||||
<i class="octicon octicon-tag"></i>
|
||||
<i class="octicon octicon-tag"></i>
|
||||
@tags.zipWithIndex.map { case (tag, i) =>
|
||||
<a href="@helpers.url(repository)/tree/@tag" class="tag" id="tag-@i">@tag</a>
|
||||
}
|
||||
@@ -90,15 +89,16 @@
|
||||
</label>
|
||||
<div id="comment-list">
|
||||
@gitbucket.core.issues.html.commentlist(
|
||||
None,
|
||||
comments.filter(_.asInstanceOf[gitbucket.core.model.CommitComment].fileName.isEmpty),
|
||||
hasWritePermission,
|
||||
repository,
|
||||
None)
|
||||
issue = None,
|
||||
comments = comments.filter(_.asInstanceOf[CommitComment].fileName.isEmpty),
|
||||
isManageable = hasWritePermission,
|
||||
repository = repository,
|
||||
pullreq = None,
|
||||
renderScript = false)
|
||||
<div style="display: none;">
|
||||
@gitbucket.core.issues.html.commentlist(
|
||||
None,
|
||||
comments.map(_.asInstanceOf[CommitComment]).filter(_.fileName.isDefined).groupBy(_.fileName).map { case (fileName, comments) =>
|
||||
issue = None,
|
||||
comments = comments.map(_.asInstanceOf[CommitComment]).filter(_.fileName.isDefined).groupBy(_.fileName).map { case (fileName, comments) =>
|
||||
CommitComments(
|
||||
fileName = fileName.get,
|
||||
commentedUserName = comments.head.commentedUserName,
|
||||
@@ -107,10 +107,10 @@
|
||||
diff = None
|
||||
)
|
||||
}.toList,
|
||||
hasWritePermission,
|
||||
repository,
|
||||
None,
|
||||
Some(commitId))
|
||||
isManageable = hasWritePermission,
|
||||
repository = repository,
|
||||
pullreq = None,
|
||||
commitId = Some(commitId))
|
||||
</div>
|
||||
</div>
|
||||
@gitbucket.core.repo.html.commentform(commitId = commitId, hasWritePermission = hasWritePermission, repository = repository)
|
||||
|
||||
Reference in New Issue
Block a user