mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 04:56:02 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -87,6 +87,10 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
// TODO Authenticator
|
// TODO Authenticator
|
||||||
post("/:owner/:repository/issue_comments/:id"){
|
post("/:owner/:repository/issue_comments/:id"){
|
||||||
// TODO update issue memo
|
// TODO update issue memo
|
||||||
|
contentType = formats("json")
|
||||||
|
|
||||||
|
org.json4s.jackson.Serialization.write(Map(
|
||||||
|
"content" -> view.Markdown.toHtml("* hoge memo", getRepository("root", "test", baseUrl).get, false, true, true)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Authenticator
|
// TODO Authenticator
|
||||||
|
|||||||
@@ -1,29 +1,41 @@
|
|||||||
@(title: Option[String], content: String, key: Int, owner: String, repository: String)(implicit context: app.Context)
|
@(title: Option[String], content: String, key: Int, owner: String, repository: String)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@if(title.isDefined){
|
@defining(title.isEmpty){ isComment =>
|
||||||
<input type="text" style="width: 730px;" id="title" value="@title.get"/>
|
@if(!isComment){
|
||||||
|
<input type="text" style="width: 730px;" id="edit-title" value="@title.get"/>
|
||||||
}
|
}
|
||||||
<textarea style="width: 730px; height: 100px;" id="content-@key">@content</textarea>
|
<textarea style="width: 730px; height: 100px;" id="edit-content@if(isComment){"-" + key}">@content</textarea>
|
||||||
<input type="button" class="btn btn-small" value="Update @{if(title.isDefined) "Issue" else "Comment"}" id="update-@key"/>
|
<input type="button" class="btn btn-small" value="Update @{if(isComment) "Comment" else "Issue"}"/>
|
||||||
<span class="pull-right"><a class="btn btn-small btn-danger" href="#" id="cancel-@key">Cancel</a></span>
|
<span class="pull-right"><a class="btn btn-small btn-danger" href="#">Cancel</a></span>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
$('#update-@key').click(function(){
|
$('@{if(isComment) "#commentContent-" + key else "#issueContent"} input.btn').click(function(){
|
||||||
$.post('@path/@owner/@repository/@{if(title.isDefined) "issues" else "issue_comments"}/@key',
|
@if(isComment){
|
||||||
{
|
var url = '@path/@owner/@repository/issue_comments/@key';
|
||||||
@if(title.isDefined){ title : $('#title').val(), }
|
var param = {
|
||||||
content : $('#content-@key').val()
|
content : $('#edit-content-@key').val()
|
||||||
},
|
};
|
||||||
function(data){
|
var func = function(data){
|
||||||
@if(title.isDefined){
|
$('#commentContent-@key').empty().html(data.content);
|
||||||
$('#issueTitle').empty().text(data.title);
|
};
|
||||||
}
|
}else{
|
||||||
$('#issueContent').empty().html(data.content);
|
var url = '@path/@owner/@repository/issues/@key';
|
||||||
});
|
var param = {
|
||||||
|
title : $('#edit-title').val(),
|
||||||
|
content : $('#edit-content-@key').val()
|
||||||
|
};
|
||||||
|
var func = function(data){
|
||||||
|
$('#issueTitle').empty().text(data.title);
|
||||||
|
$('#issueContent').empty().html(data.content);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
$.post(url, param, func);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#cancel-@key').click(function(){
|
$('#cancel').click(function(){
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<div class="span10">
|
<div class="span10">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<span class="pull-right"><a class="btn btn-small" href="#" id="editIssue">Edit</a></span>
|
<span class="pull-right"><a class="btn btn-small" href="#" id="edit">Edit</a></span>
|
||||||
<div class="small"><a href="@path/@issue.openedUserName">@issue.openedUserName</a> opened this issue @datetime(issue.registeredDate)</div>
|
<div class="small"><a href="@path/@issue.openedUserName">@issue.openedUserName</a> opened this issue @datetime(issue.registeredDate)</div>
|
||||||
<h4 id="issueTitle">@issue.title</h4>
|
<h4 id="issueTitle">@issue.title</h4>
|
||||||
</div>
|
</div>
|
||||||
@@ -24,9 +24,12 @@
|
|||||||
<div class="box" id="comment-@comment.commentId">
|
<div class="box" id="comment-@comment.commentId">
|
||||||
<div class="box-header-small">
|
<div class="box-header-small">
|
||||||
<a href="@path/@comment.commentedUserName">@comment.commentedUserName</a> commented
|
<a href="@path/@comment.commentedUserName">@comment.commentedUserName</a> commented
|
||||||
<span class="pull-right">@datetime(comment.registeredDate)</span>
|
<span class="pull-right">
|
||||||
|
@datetime(comment.registeredDate)
|
||||||
|
<a href="#" data-comment-id="@comment.commentId"><i class="icon-pencil"></i></a>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-content" style="background-color: #f5f5f5;">
|
<div class="box-content" style="background-color: #f5f5f5;" id="commentContent-@comment.commentId">
|
||||||
@markdown(comment.content, repository, false, true, true)
|
@markdown(comment.content, repository, false, true, true)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,7 +58,7 @@
|
|||||||
}
|
}
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
$('#editIssue').click(function(){
|
$('#edit').click(function(){
|
||||||
$.get('@path/@repository.owner/@repository.name/issues/_data/@issue.issueId',
|
$.get('@path/@repository.owner/@repository.name/issues/_data/@issue.issueId',
|
||||||
function(data){
|
function(data){
|
||||||
$('#issueContent').empty().html(data);
|
$('#issueContent').empty().html(data);
|
||||||
@@ -63,5 +66,13 @@ $(function(){
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('i.icon-pencil').click(function(){
|
||||||
|
var id = $(this).closest('a').data('comment-id');
|
||||||
|
$.get('@path/@repository.owner/@repository.name/issue_comments/_data/' + id,
|
||||||
|
function(data){
|
||||||
|
$('#commentContent-' + id).empty().html(data);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user