mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-12 08:25:50 +01:00
Fix to submit form when creating issue comment.
This commit is contained in:
@@ -19,25 +19,26 @@
|
||||
@markdown(issue.content getOrElse "No description given.", repository, false, true, true)
|
||||
</div>
|
||||
</div>
|
||||
<span id="comment-area">
|
||||
@comments.map { comment =>
|
||||
<div class="box">
|
||||
<div class="box-header-small">
|
||||
<a href="@path/@comment.commentedUserName">@comment.commentedUserName</a> commented
|
||||
<span class="pull-right">@datetime(comment.registeredDate)</span>
|
||||
</div>
|
||||
<div class="box-content" style="background-color: #f5f5f5;">
|
||||
@markdown(comment.content, repository, false, true, true)
|
||||
</div>
|
||||
<div class="box" id="comment-@comment.commentId">
|
||||
<div class="box-header-small">
|
||||
<a href="@path/@comment.commentedUserName">@comment.commentedUserName</a> commented
|
||||
<span class="pull-right">@datetime(comment.registeredDate)</span>
|
||||
</div>
|
||||
<div class="box-content" style="background-color: #f5f5f5;">
|
||||
@markdown(comment.content, repository, false, true, true)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</span>
|
||||
<form action="@path/@repository.owner/@repository.name/issue_comments" method="POST" validate="true">
|
||||
<div class="box">
|
||||
<div class="box-content">
|
||||
@html.preview(repository, "", false, true, true, "width: 730px; height: 100px;")
|
||||
</div>
|
||||
</div>
|
||||
<input type="button" class="btn btn-success" value="Comment" id="comment"/>
|
||||
<input type="hidden" name="issueId" value="@issue.issueId"/>
|
||||
<input type="submit" class="btn btn-success" value="Comment"/>
|
||||
</form>
|
||||
</div>
|
||||
<div class="span2">
|
||||
@if(issue.closed) {
|
||||
@@ -50,25 +51,4 @@
|
||||
<strong>Labels</strong>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('#comment').click(function(){
|
||||
$.post('@path/@repository.owner/@repository.name/issue_comments',
|
||||
{
|
||||
issueId : @issue.issueId,
|
||||
content : $('#content').val()
|
||||
},
|
||||
function(data){
|
||||
var div = $('<div>').addClass('box')
|
||||
.append($('<div>').addClass('box-header-small')
|
||||
.append($('<a>').attr('href', '@path/@repository.owner').text(data.commentedUserName))
|
||||
.append(' commented')
|
||||
.append($('<span>').addClass('pull-right').text(data.registeredDate)))
|
||||
.append($('<div>').addClass('box-content').attr('style', 'background-color: #f5f5f5;').html(data.content));
|
||||
$('#comment-area').append(div);
|
||||
$('#content').val('');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
Reference in New Issue
Block a user