Set location information to reply comment correctly

This commit is contained in:
Naoki Takezoe
2018-04-27 18:39:30 +09:00
parent 332836119d
commit 9bff4b1e97
2 changed files with 6 additions and 29 deletions

View File

@@ -8,29 +8,6 @@
@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>&nbsp;
<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)

View File

@@ -365,14 +365,14 @@ $(function(){
});
for(var key in elements){
filename = elements[key]['filename'];
oldline = elements[key]['oldline'];
newline = elements[key]['newline'];
oldline = elements[key]['oldline'] ? elements[key]['oldline'] : '';
newline = elements[key]['newline'] ? elements[key]['newline'] : '';
var $v = $('<div class="commit-comment-box reply-comment-box">')
.append($('<input type="text" class="form-control reply-comment" placeholder="Reply...">')
.data('filename', filename)
.data('newline', newline)
.data('oldline', oldline));
.append($('<input type="text" class="form-control reply-comment" placeholder="Reply..." '
+ 'data-filename="' + filename + '" '
+ 'data-newline="' + newline + '" '
+ 'data-oldline="' + oldline + '">'));
var tmp;
if (typeof oldline !== 'undefined') {