mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
42 lines
1.3 KiB
HTML
42 lines
1.3 KiB
HTML
@(title: String, content: Option[String], issueId: Int, owner: String, repository: String)(implicit context: app.Context)
|
|
@import context._
|
|
<span id="error-edit-title" class="error"></span>
|
|
<input type="text" style="width: 680px;" id="edit-title" value="@title"/>
|
|
@helper.html.attached(owner, repository){
|
|
<textarea style="width: 680px; height: 100px; max-height: 300px;" id="edit-content">@content.getOrElse("")</textarea>
|
|
}
|
|
<div>
|
|
<input type="button" id="update" class="btn btn-small" value="Update Issue"/>
|
|
<input type="button" id="cancel" class="btn btn-small btn-danger pull-right" value="Cancel"/>
|
|
</div>
|
|
<script>
|
|
$(function(){
|
|
$('#edit-content').elastic();
|
|
|
|
var callback = function(data){
|
|
$('#issueTitle').empty().text(data.title);
|
|
$('#issueContent').empty().html(data.content);
|
|
};
|
|
|
|
$('#update').click(function(){
|
|
$.ajax({
|
|
url: '@path/@owner/@repository/issues/edit/@issueId',
|
|
type: 'POST',
|
|
data: {
|
|
title : $('#edit-title').val(),
|
|
content : $('#edit-content').val()
|
|
}
|
|
}).done(
|
|
callback
|
|
).fail(function(req) {
|
|
$('#error-edit-title').text($.parseJSON(req.responseText).title);
|
|
});
|
|
});
|
|
|
|
$('#cancel').click(function(){
|
|
$.get('@path/@owner/@repository/issues/_data/@issueId', callback);
|
|
return false;
|
|
});
|
|
});
|
|
</script>
|