mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 03:26:06 +01:00
Modifying commit comments presentation
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
@(comments: gitbucket.core.model.CommitComments,
|
||||
hasWritePermission: Boolean,
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
latestCommitId: Option[String] = None)(implicit context: gitbucket.core.controller.Context)
|
||||
@import gitbucket.core.view.helpers
|
||||
<div class="panel panel-default commit-comment-box">
|
||||
<div class="panel-heading">
|
||||
@comments.fileName
|
||||
</div>
|
||||
@comments.comments.map { comment =>
|
||||
<div class="panel-body @if((!latestCommitId.isDefined || latestCommitId.get == comment.commitId)){inline-comment}"
|
||||
id="discussion_r@comment.commentId"
|
||||
@if(comment.fileName.isDefined){filename="@comment.fileName.get"}
|
||||
@if(comment.newLine.isDefined){newline="@comment.newLine.get"}
|
||||
@if(comment.oldLine.isDefined){oldline="@comment.oldLine.get"}>
|
||||
<div class="commit-comment-@comment.commentId">
|
||||
@*
|
||||
<div class="panel-heading">
|
||||
@helpers.avatar(comment.commentedUserName, 20)
|
||||
@helpers.user(comment.commentedUserName, styleClass="username strong")
|
||||
<span class="muted">
|
||||
commented on
|
||||
@if(comment.issueId.isDefined){
|
||||
<a href="@helpers.url(repository)/pull/@comment.issueId">#@comment.issueId</a>
|
||||
}
|
||||
@comment.fileName.map { fileName =>
|
||||
@fileName in
|
||||
}
|
||||
<a href="@context.path/@repository.owner/@repository.name/commit/@comment.commitId">@comment.commitId.substring(0, 7)</a>
|
||||
@gitbucket.core.helper.html.datetimeago(comment.registeredDate)
|
||||
</span>
|
||||
<span class="pull-right">
|
||||
@if(hasWritePermission || context.loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false)){
|
||||
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil"></i></a>
|
||||
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x"></i></a>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
*@
|
||||
<div class="markdown-body">
|
||||
<div>
|
||||
@helpers.avatar(comment.commentedUserName, 20)
|
||||
@helpers.user(comment.commentedUserName, styleClass="username strong")
|
||||
<span class="muted">@gitbucket.core.helper.html.datetimeago(comment.registeredDate)</span>
|
||||
<span class="pull-right">
|
||||
@if(hasWritePermission || context.loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false)){
|
||||
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil"></i></a>
|
||||
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x"></i></a>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<div class="commit-commentContent-@comment.commentId" style="padding-left: 24px;">
|
||||
@helpers.markdown(
|
||||
markdown = comment.content,
|
||||
repository = repository,
|
||||
enableWikiLink = false,
|
||||
enableRefsLink = true,
|
||||
enableLineBreaks = true,
|
||||
enableTaskList = false,
|
||||
hasWritePermission = hasWritePermission
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -4,7 +4,7 @@
|
||||
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||
pullreq: Option[gitbucket.core.model.PullRequest] = None)(implicit context: gitbucket.core.controller.Context)
|
||||
@import gitbucket.core.view.helpers
|
||||
@import gitbucket.core.model.CommitComment
|
||||
@import gitbucket.core.model.CommitComments
|
||||
@issueOrPullRequest()={ @if(issue.exists(_.isPullRequest))( "pull request" )else( "issue" ) }
|
||||
@showFormattedComment(comment: gitbucket.core.model.IssueComment)={
|
||||
<div class="panel panel-default issue-comment-box" id="comment-@comment.commentId">
|
||||
@@ -233,8 +233,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
case comment: CommitComment => {
|
||||
@gitbucket.core.helper.html.commitcomment(comment, isManageable, repository, pullreq.map(_.commitIdTo))
|
||||
case comments: CommitComments => {
|
||||
@gitbucket.core.helper.html.commitcomments(comments, isManageable, repository, pullreq.map(_.commitIdTo))
|
||||
}
|
||||
}
|
||||
<script>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<ul class="nav nav-tabs fill-width" id="pullreq-tab">
|
||||
<li><a href="#conversation">Conversation <span class="badge">@comments.flatMap @{
|
||||
case comment: IssueComment => Some(comment)
|
||||
case _: CommitComment => None
|
||||
case _ => None
|
||||
}.size</span></a></li>
|
||||
<li><a href="#commits">Commits <span class="badge">@commits.size</span></a></li>
|
||||
<li><a href="#files">Files Changed <span class="badge">@diffs.size</span></a></li>
|
||||
|
||||
Reference in New Issue
Block a user