mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-04 20:45:58 +01:00
Add the label edit process by mock.
This commit is contained in:
@@ -109,6 +109,16 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
redirect("/%s/%s/issues/_data/%d".format(owner, repository, issueId))
|
redirect("/%s/%s/issues/_data/%d".format(owner, repository, issueId))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Authenticator
|
||||||
|
ajaxPost("/:owner/:repository/issues/:id/label/:labelId/new"){
|
||||||
|
"TODO Insert!"
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO Authenticator
|
||||||
|
ajaxPost("/:owner/:repository/issues/:id/label/:labelId/delete"){
|
||||||
|
"TODO Delete!"
|
||||||
|
}
|
||||||
|
|
||||||
// TODO requires users only and readable repository checking
|
// TODO requires users only and readable repository checking
|
||||||
post("/:owner/:repository/issue_comments/new", commentForm)( usersOnly { form =>
|
post("/:owner/:repository/issue_comments/new", commentForm)( usersOnly { form =>
|
||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
@labels.map { label =>
|
@labels.map { label =>
|
||||||
<li>
|
<li>
|
||||||
<a href="#">
|
<a href="#" class="toggle-label" data-label="@label.labelId">
|
||||||
<i class="@{if(issueLabels.exists(_.labelId == label.labelId)) "icon-ok" else "icon-white"}"></i>
|
<i class="@{if(issueLabels.exists(_.labelId == label.labelId)) "icon-ok" else "icon-white"}"></i>
|
||||||
<span class="label" style="background-color: #@label.color;"> </span>
|
<span class="label" style="background-color: #@label.color;"> </span>
|
||||||
@label.labelName
|
@label.labelName
|
||||||
@@ -124,5 +124,25 @@ $(function(){
|
|||||||
$('#action').click(function(){
|
$('#action').click(function(){
|
||||||
$('<input type="hidden">').attr('name', 'action').val($(this).val().toLowerCase()).appendTo('form');
|
$('<input type="hidden">').attr('name', 'action').val($(this).val().toLowerCase()).appendTo('form');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('a.toggle-label').click(function(){
|
||||||
|
var url = '@url(repository)/issues/@issue.issueId/label/' + $(this).data('label');
|
||||||
|
var icon;
|
||||||
|
var i = $(this).children('i');
|
||||||
|
if(i.hasClass('icon-ok')){
|
||||||
|
url += '/delete';
|
||||||
|
icon = 'icon-white';
|
||||||
|
} else {
|
||||||
|
url += '/new';
|
||||||
|
icon = 'icon-ok';
|
||||||
|
}
|
||||||
|
$.post(url,
|
||||||
|
function(data){
|
||||||
|
i.removeClass().addClass(icon);
|
||||||
|
// TODO label sort
|
||||||
|
alert(data);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user