mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-04 20:45:58 +01:00
42 lines
1.4 KiB
HTML
42 lines
1.4 KiB
HTML
@(title: Option[String], content: String, key: Int, owner: String, repository: String)(implicit context: app.Context)
|
|
@import context._
|
|
@defining(title.isEmpty){ isComment =>
|
|
@if(!isComment){
|
|
<input type="text" style="width: 730px;" id="edit-title" value="@title.get"/>
|
|
}
|
|
<textarea style="width: 730px; height: 100px;" id="edit-content@if(isComment){"-" + key}">@content</textarea>
|
|
<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="#">Cancel</a></span>
|
|
<script>
|
|
$(function(){
|
|
$('@{if(isComment) "#commentContent-" + key else "#issueContent"} input.btn').click(function(){
|
|
@if(isComment){
|
|
var url = '@path/@owner/@repository/issue_comments/@key';
|
|
var param = {
|
|
content : $('#edit-content-@key').val()
|
|
};
|
|
var func = function(data){
|
|
$('#commentContent-@key').empty().html(data.content);
|
|
};
|
|
}else{
|
|
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').click(function(){
|
|
|
|
});
|
|
});
|
|
</script>
|
|
|
|
}
|