mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
(refs #488)Batch edit for issues
This commit is contained in:
@@ -234,8 +234,10 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
|
||||
post("/:owner/:repository/issues/batchedit/state")(collaboratorsOnly { repository =>
|
||||
defining(params.get("value")){ action =>
|
||||
executeBatch(repository) {
|
||||
handleComment(_, None, repository)( _ => action)
|
||||
action match {
|
||||
case Some("open") => executeBatch(repository) { handleComment(_, None, repository)( _ => Some("reopen")) }
|
||||
case Some("close") => executeBatch(repository) { handleComment(_, None, repository)( _ => Some("close")) }
|
||||
case _ => // TODO BadRequest
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -311,15 +313,15 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
val (action, recordActivity) =
|
||||
getAction(issue)
|
||||
.collect {
|
||||
case "close" => true -> (Some("close") ->
|
||||
Some(if(issue.isPullRequest) recordClosePullRequestActivity _ else recordCloseIssueActivity _))
|
||||
case "reopen" => false -> (Some("reopen") ->
|
||||
Some(recordReopenIssueActivity _))
|
||||
}
|
||||
case "close" if(!issue.closed) => true ->
|
||||
(Some("close") -> Some(if(issue.isPullRequest) recordClosePullRequestActivity _ else recordCloseIssueActivity _))
|
||||
case "reopen" if(issue.closed) => false ->
|
||||
(Some("reopen") -> Some(recordReopenIssueActivity _))
|
||||
}
|
||||
.map { case (closed, t) =>
|
||||
updateClosed(owner, name, issueId, closed)
|
||||
t
|
||||
}
|
||||
updateClosed(owner, name, issueId, closed)
|
||||
t
|
||||
}
|
||||
.getOrElse(None -> None)
|
||||
|
||||
val commentId = content
|
||||
@@ -329,7 +331,7 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
case (content, action) => createComment(owner, name, userName, issueId, content, action)
|
||||
}
|
||||
|
||||
// record activity
|
||||
// record comment activity if comment is entered
|
||||
content foreach {
|
||||
(if(issue.isPullRequest) recordCommentPullRequestActivity _ else recordCommentIssueActivity _)
|
||||
(owner, name, userName, issueId, _)
|
||||
|
||||
@@ -62,10 +62,6 @@ trait PullRequestsControllerBase extends ControllerBase {
|
||||
searchPullRequests(None, repository)
|
||||
})
|
||||
|
||||
get("/:owner/:repository/pulls/:userName")(referrersOnly { repository =>
|
||||
searchPullRequests(Some(params("userName")), repository)
|
||||
})
|
||||
|
||||
get("/:owner/:repository/pull/:id")(referrersOnly { repository =>
|
||||
params("id").toIntOpt.flatMap{ issueId =>
|
||||
val owner = repository.owner
|
||||
|
||||
@@ -18,121 +18,6 @@
|
||||
@html.menu("issues", repository){
|
||||
@tab("issues", false, repository)
|
||||
<div class="row-fluid">
|
||||
@*
|
||||
<div class="span3">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li@if(filter == "all"){ class="active"}>
|
||||
<a href="@url(repository)/issues@condition.toURL">
|
||||
<span class="count-right">@allCount</span>
|
||||
Everyone's Issues
|
||||
</a>
|
||||
</li>
|
||||
@if(loginAccount.isDefined){
|
||||
<li@if(filter == "assigned"){ class="active"}>
|
||||
<a href="@url(repository)/issues/assigned/@loginAccount.map(_.userName)@condition.toURL">
|
||||
<span class="count-right">@assignedCount</span>
|
||||
Assigned to you
|
||||
</a>
|
||||
</li>
|
||||
<li@if(filter == "created_by"){ class="active"}>
|
||||
<a href="@url(repository)/issues/created_by/@loginAccount.map(_.userName)@condition.toURL">
|
||||
<span class="count-right">@createdByCount</span>
|
||||
Created by you
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
<hr/>
|
||||
@if(condition.milestoneId.isEmpty){
|
||||
<span class="muted small">No milestone selected</span>
|
||||
} else {
|
||||
@if(condition.milestoneId.get.isEmpty){
|
||||
<span class="muted small">Issues with no milestone</span>
|
||||
} else {
|
||||
<span class="muted small">Milestone:</span> @milestones.find(_.milestoneId == condition.milestoneId.get.get).map(_.title)
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown() {
|
||||
@if(condition.milestoneId.isDefined){
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = None).toURL">
|
||||
<i class="icon-remove-circle"></i> Clear milestone filter
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(None)).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
|
||||
</a>
|
||||
</li>
|
||||
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
|
||||
<div class="small" style="padding-left: 20px;">
|
||||
@milestone.dueDate.map { dueDate =>
|
||||
@if(isPast(dueDate)){
|
||||
<img src="@assets/common/images/alert_mono.png"/>Due in @date(dueDate)
|
||||
} else {
|
||||
<span class="muted">Due in @date(dueDate)</span>
|
||||
}
|
||||
}.getOrElse {
|
||||
<span class="muted">No due date</span>
|
||||
}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
@if(condition.milestoneId.isDefined && condition.milestoneId.get.isDefined){
|
||||
@milestones.find(_.milestoneId == condition.milestoneId.get.get).map { milestone =>
|
||||
<div style="margin-top: 4px;">
|
||||
@_root_.issues.milestones.html.progress(openCount + closedCount, closedCount, false)
|
||||
</div>
|
||||
<span class="muted small">@openCount open issues</span>
|
||||
@if(milestone.closedDate.isDefined){
|
||||
@milestone.closedDate.map { closedDate =>
|
||||
<span class="small">Closed in @date(closedDate)</span>
|
||||
}
|
||||
} else {
|
||||
@milestone.dueDate.map { dueDate =>
|
||||
@if(isPast(dueDate)){
|
||||
<img src="@assets/common/images/alert.png"/><span class="small milestone-alert">Due in @date(dueDate)</span>
|
||||
} else {
|
||||
<span class="small">Due in @date(dueDate)</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<hr/>
|
||||
<span class="strong">Labels</span>
|
||||
<div>
|
||||
<div id="label-list">
|
||||
<ul class="label-list nav nav-pills nav-stacked">
|
||||
@labels.map { label =>
|
||||
<li>
|
||||
<a href="@condition.copy(labels = (if(condition.labels.contains(label.labelName)) condition.labels - label.labelName else condition.labels + label.labelName)).toURL"
|
||||
@if(condition.labels.contains(label.labelName)){style="background-color: #@label.color; color: #@label.fontColor;"}>
|
||||
<span class="count-right">@labelCounts.getOrElse(label.labelName, 0)</span>
|
||||
<span style="background-color: #@label.color;" class="label-color"> </span>
|
||||
@label.labelName
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@if(hasWritePermission){
|
||||
<hr/>
|
||||
<input type="button" class="btn btn-block" id="manageLabel" data-toggle="button" value="Manage Labels"/>
|
||||
<br/>
|
||||
<span class="strong">New label</span>
|
||||
@_root_.issues.labels.html.edit(None, repository)
|
||||
}
|
||||
</div>
|
||||
*@
|
||||
@***** show issue list *****@
|
||||
<div class="span12">
|
||||
@listparts(issues, page, openCount, closedCount, condition, collaborators, milestones, labels, Some(repository), hasWritePermission)
|
||||
</div>
|
||||
@@ -148,20 +33,14 @@
|
||||
@if(hasWritePermission){
|
||||
<script>
|
||||
$(function(){
|
||||
$('#manageLabel').click(function(){
|
||||
if($(this).data('toggle-state')){
|
||||
location.href = '@url(repository)/issues';
|
||||
} else {
|
||||
$(this).data('toggle-state', 'on');
|
||||
$.get('@url(repository)/issues/label/edit', function(data){
|
||||
$('#label-list').parent().empty().html(data);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('.table-issues input[type=checkbox]').change(function(){
|
||||
$('.table-issues button').prop('disabled',
|
||||
!$('.table-issues input[type=checkbox]').filter(':checked').length);
|
||||
if($('.table-issues input[type=checkbox]').filter(':checked').length == 0){
|
||||
$('#table-issues-control').show();
|
||||
$('#table-issues-batchedit').hide();
|
||||
} else {
|
||||
$('#table-issues-control').hide();
|
||||
$('#table-issues-batchedit').show();
|
||||
}
|
||||
}).filter(':first').change();
|
||||
|
||||
var submitBatchEdit = function(action, value) {
|
||||
@@ -173,8 +52,8 @@ $(function(){
|
||||
form.submit();
|
||||
};
|
||||
|
||||
$('#state').click(function(){
|
||||
submitBatchEdit('@url(repository)/issues/batchedit/state', $(this).text().toLowerCase());
|
||||
$('a.toggle-state').click(function(){
|
||||
submitBatchEdit('@url(repository)/issues/batchedit/state', $(this).data('id'));
|
||||
});
|
||||
$('a.toggle-label').click(function(){
|
||||
submitBatchEdit('@url(repository)/issues/batchedit/label', $(this).data('id'));
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<input type="checkbox"/>
|
||||
<a class="button-link@if(condition.state == "open" ){ selected}" href="@condition.copy(state = "open" ).toURL">@openCount Open</a>
|
||||
<a class="button-link@if(condition.state == "closed"){ selected}" href="@condition.copy(state = "closed").toURL">@closedCount Closed</a>
|
||||
<div class="pull-right">
|
||||
<div class="pull-right" id="table-issues-control">
|
||||
@helper.html.dropdown("Author", flat = true) {
|
||||
@collaborators.map { collaborator =>
|
||||
<li>
|
||||
@@ -99,30 +99,13 @@
|
||||
</li>
|
||||
}
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
@if(issues.isEmpty){
|
||||
<tr>
|
||||
<td style="padding: 20px; background-color: #eee; text-align: center;">
|
||||
No issues to show.
|
||||
@if(condition.labels.nonEmpty || condition.milestoneId.isDefined){
|
||||
<a href="@condition.copy(labels = Set.empty, milestoneId = None).toURL">Clear active filters.</a>
|
||||
} else {
|
||||
@if(repository.isDefined){
|
||||
<a href="@url(repository.get)/issues/new">Create a new issue.</a>
|
||||
@if(hasWritePermission){
|
||||
<div class="pull-right" id="table-issues-batchedit">
|
||||
@helper.html.dropdown("Mark as", flat = true) {
|
||||
<li><a href="javascript:void(0);" class="toggle-state" data-id="open">Open</a></li>
|
||||
<li><a href="javascript:void(0);" class="toggle-state" data-id="close">Close</a></li>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
} else {
|
||||
@*
|
||||
@if(hasWritePermission){
|
||||
<tr>
|
||||
<td style="background-color: #eee;">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-mini strong" id="state">@{if(condition.state == "open") "Close" else "Reopen"}</button>
|
||||
</div>
|
||||
@helper.html.dropdown("Label") {
|
||||
@helper.html.dropdown("Label", flat = true) {
|
||||
@labels.map { label =>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="toggle-label" data-id="@label.labelId">
|
||||
@@ -133,43 +116,40 @@
|
||||
</li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Assignee") {
|
||||
@helper.html.dropdown("Milestone", flat = true) {
|
||||
<li><a href="javascript:void(0);" class="toggle-milestone" data-id="">No milestone</a></li>
|
||||
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||
<li><a href="javascript:void(0);" class="toggle-milestone" data-id="@milestone.milestoneId">@milestone.title</a></li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Assignee", flat = true) {
|
||||
<li><a href="javascript:void(0);" class="toggle-assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
|
||||
@collaborators.map { collaborator =>
|
||||
<li><a href="javascript:void(0);" class="toggle-assign" data-name="@collaborator"><i class="icon-white"></i>@avatar(collaborator, 20) @collaborator</a></li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Milestone") {
|
||||
<li><a href="javascript:void(0);" class="toggle-milestone" data-id=""><i class="icon-remove-circle"></i> Clear this milestone</a></li>
|
||||
@milestones.map { milestone =>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="toggle-milestone" data-id="@milestone.milestoneId">
|
||||
<i class="icon-white"></i> @milestone.title
|
||||
<div class="small" style="padding-left: 20px;">
|
||||
@milestone.dueDate.map { dueDate =>
|
||||
@if(isPast(dueDate)){
|
||||
<img src="@assets/common/images/alert_mono.png"/>Due in @date(dueDate)
|
||||
} else {
|
||||
<span class="muted">Due in @date(dueDate)</span>
|
||||
}
|
||||
}.getOrElse {
|
||||
<span class="muted">No due date</span>
|
||||
}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</th>
|
||||
</tr>
|
||||
@if(issues.isEmpty){
|
||||
<tr>
|
||||
<td style="padding: 20px; background-color: #eee; text-align: center;">
|
||||
No issues to show.
|
||||
@if(condition.labels.nonEmpty || condition.milestoneId.isDefined){
|
||||
<a href="@condition.copy(labels = Set.empty, milestoneId = None).toURL">Clear active filters.</a>
|
||||
} else {
|
||||
@if(repository.isDefined){
|
||||
<a href="@url(repository.get)/issues/new">Create a new issue.</a>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
*@
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@issues.map { case IssueInfo(issue, labels, milestone, commentCount) =>
|
||||
<tr>
|
||||
<td style="padding-top: 15px; padding-bottom: 15px;">
|
||||
@if(hasWritePermission){
|
||||
<label class="checkbox" style="cursor: default;">
|
||||
<input type="checkbox" value="@issue.issueId"/>
|
||||
}
|
||||
<img src="@assets/common/images/issue-@(if(issue.closed) "closed" else "open").png" style="margin-right: 20px;"/>
|
||||
@@ -190,9 +170,6 @@
|
||||
#@issue.issueId opened by @user(issue.openedUserName, styleClass="username") @datetime(issue.registeredDate)
|
||||
<span style="margin: 20px;"><a href="@condition.copy(milestoneId = Some(Some(1))).toURL" class="username">@milestone</a></span>
|
||||
</div>
|
||||
@if(hasWritePermission){
|
||||
</label>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
@@ -17,43 +17,52 @@
|
||||
@html.menu("pulls", repository){
|
||||
@_root_.issues.html.tab("pulls", false, repository)
|
||||
<div class="row-fluid">
|
||||
@*
|
||||
<div class="span3">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li@if(filter.isEmpty){ class="active"}>
|
||||
<a href="@url(repository)/pulls">
|
||||
<span class="count-right">@allCount</span>
|
||||
All Requests
|
||||
</a>
|
||||
</li>
|
||||
@if(loginAccount.isDefined){
|
||||
<li@if(filter.map(_ == loginAccount.get.userName).getOrElse(false)){ class="active"}>
|
||||
<a href="@url(repository)/pulls/@loginAccount.map(_.userName)">
|
||||
<span class="count-right">@counts.find(_.userName == loginAccount.get.userName).map(_.count).getOrElse(0)</span>
|
||||
Yours
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
<hr>
|
||||
<ul class="nav nav-pills nav-stacked small">
|
||||
@counts.map { user =>
|
||||
@if(loginAccount.isEmpty || loginAccount.get.userName != user.userName){
|
||||
<li@if(filter.map(_ == user.userName).getOrElse(false)){ class="active"}>
|
||||
<a href="@url(repository)/pulls/@user.userName">
|
||||
<span class="count-right">@user.count</span>
|
||||
@user.userName
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
*@
|
||||
<div class="span12">
|
||||
@listparts(issues, page, openCount, closedCount, condition, collaborators, milestones, labels, Some(repository), hasWritePermission)
|
||||
</div>
|
||||
</div>
|
||||
@if(hasWritePermission){
|
||||
<form id="batcheditForm" method="POST">
|
||||
<input type="hidden" name="value"/>
|
||||
<input type="hidden" name="checked"/>
|
||||
</form>
|
||||
}
|
||||
}
|
||||
}
|
||||
@if(hasWritePermission){
|
||||
<script>
|
||||
$(function(){
|
||||
$('.table-issues input[type=checkbox]').change(function(){
|
||||
if($('.table-issues input[type=checkbox]').filter(':checked').length == 0){
|
||||
$('#table-issues-control').show();
|
||||
$('#table-issues-batchedit').hide();
|
||||
} else {
|
||||
$('#table-issues-control').hide();
|
||||
$('#table-issues-batchedit').show();
|
||||
}
|
||||
}).filter(':first').change();
|
||||
|
||||
var submitBatchEdit = function(action, value) {
|
||||
var checked = $('.table-issues input[type=checkbox]').filter(':checked').map(function(){ return this.value; }).get().join();
|
||||
var form = $('#batcheditForm');
|
||||
form.find('input[name=value]').val(value);
|
||||
form.find('input[name=checked]').val(checked);
|
||||
form.attr('action', action);
|
||||
form.submit();
|
||||
};
|
||||
|
||||
$('a.toggle-state').click(function(){
|
||||
submitBatchEdit('@url(repository)/issues/batchedit/state', $(this).data('id'));
|
||||
});
|
||||
$('a.toggle-label').click(function(){
|
||||
submitBatchEdit('@url(repository)/issues/batchedit/label', $(this).data('id'));
|
||||
});
|
||||
$('a.toggle-assign').click(function(){
|
||||
submitBatchEdit('@url(repository)/issues/batchedit/assign', $(this).data('name'));
|
||||
});
|
||||
$('a.toggle-milestone').click(function(){
|
||||
submitBatchEdit('@url(repository)/issues/batchedit/milestone', $(this).data('id'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -11,138 +11,118 @@
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@import service.IssuesService.IssueInfo
|
||||
@*
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-small@if(condition.state == "open"){ active}" href="@condition.copy(state = "open").toURL">@openCount Open</a>
|
||||
<a class="btn btn-small@if(condition.state == "closed"){ active}" href="@condition.copy(state = "closed").toURL">@closedCount Closed</a>
|
||||
</div>
|
||||
@helper.html.dropdown(
|
||||
value = (condition.sort, condition.direction) match {
|
||||
case ("created" , "desc") => "Newest"
|
||||
case ("created" , "asc" ) => "Oldest"
|
||||
case ("comments", "desc") => "Most commented"
|
||||
case ("comments", "asc" ) => "Least commented"
|
||||
case ("updated" , "desc") => "Recently updated"
|
||||
case ("updated" , "asc" ) => "Least recently updated"
|
||||
},
|
||||
prefix = "Sort",
|
||||
mini = false
|
||||
){
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
*@
|
||||
<table class="table table-bordered table-hover table-issues">
|
||||
<tr>
|
||||
<th style="background-color: #eee;">
|
||||
<input type="checkbox"/>
|
||||
<a class="button-link@if(condition.state == "open" ){ selected}" href="@condition.copy(state = "open" ).toURL">@openCount Open</a>
|
||||
<a class="button-link@if(condition.state == "closed"){ selected}" href="@condition.copy(state = "closed").toURL">@closedCount Closed</a>
|
||||
<div class="pull-right">
|
||||
<div class="pull-right" id="table-issues-control">
|
||||
@helper.html.dropdown("Author", flat = true) {
|
||||
@collaborators.map { collaborator =>
|
||||
<li>
|
||||
<a href="@condition.copy(author = (if(condition.author == Some(collaborator)) None else Some(collaborator))).toURL">
|
||||
@helper.html.checkicon(condition.author == Some(collaborator))
|
||||
@avatar(collaborator, 20) @collaborator
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@collaborators.map { collaborator =>
|
||||
<li>
|
||||
<a href="@condition.copy(author = (if(condition.author == Some(collaborator)) None else Some(collaborator))).toURL">
|
||||
@helper.html.checkicon(condition.author == Some(collaborator))
|
||||
@avatar(collaborator, 20) @collaborator
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Label", flat = true) {
|
||||
@labels.map { label =>
|
||||
<li>
|
||||
<a href="@condition.copy(labels = (if(condition.labels.contains(label.labelName)) condition.labels - label.labelName else condition.labels + label.labelName)).toURL">
|
||||
@helper.html.checkicon(condition.labels.contains(label.labelName))
|
||||
<span style="background-color: #@label.color;" class="label-color"> </span>
|
||||
@label.labelName
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@labels.map { label =>
|
||||
<li>
|
||||
<a href="@condition.copy(labels = (if(condition.labels.contains(label.labelName)) condition.labels - label.labelName else condition.labels + label.labelName)).toURL">
|
||||
@helper.html.checkicon(condition.labels.contains(label.labelName))
|
||||
<span style="background-color: #@label.color;" class="label-color"> </span>
|
||||
@label.labelName
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Milestone", flat = true) {
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(None)).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
|
||||
</a>
|
||||
</li>
|
||||
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(None)).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
|
||||
</a>
|
||||
</li>
|
||||
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Assignee", flat = true) {
|
||||
@collaborators.map { collaborator =>
|
||||
<li>
|
||||
<a href="@condition.copy(assigned = Some(collaborator)).toURL">
|
||||
@helper.html.checkicon(condition.assigned == Some(collaborator))
|
||||
@avatar(collaborator, 20) @collaborator
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@collaborators.map { collaborator =>
|
||||
<li>
|
||||
<a href="@condition.copy(assigned = Some(collaborator)).toURL">
|
||||
@helper.html.checkicon(condition.assigned == Some(collaborator))
|
||||
@avatar(collaborator, 20) @collaborator
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Sort", flat = true){
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</div>
|
||||
<div class="pull-right" id="table-issues-batchedit">
|
||||
@helper.html.dropdown("Mark as", flat = true) {
|
||||
<li><a href="javascript:void(0);" class="toggle-state" data-id="open">Open</a></li>
|
||||
<li><a href="javascript:void(0);" class="toggle-state" data-id="close">Close</a></li>
|
||||
}
|
||||
@helper.html.dropdown("Label", flat = true) {
|
||||
@labels.map { label =>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="toggle-label" data-id="@label.labelId">
|
||||
<i class="icon-white"></i>
|
||||
<span class="label" style="background-color: #@label.color;"> </span>
|
||||
@label.labelName
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Milestone", flat = true) {
|
||||
<li><a href="javascript:void(0);" class="toggle-milestone" data-id="">No milestone</a></li>
|
||||
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||
<li><a href="javascript:void(0);" class="toggle-milestone" data-id="@milestone.milestoneId">@milestone.title</a></li>
|
||||
}
|
||||
}
|
||||
@helper.html.dropdown("Assignee", flat = true) {
|
||||
<li><a href="javascript:void(0);" class="toggle-assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
|
||||
@collaborators.map { collaborator =>
|
||||
<li><a href="javascript:void(0);" class="toggle-assign" data-name="@collaborator"><i class="icon-white"></i>@avatar(collaborator, 20) @collaborator</a></li>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</th>
|
||||
@@ -158,7 +138,6 @@
|
||||
<tr>
|
||||
<td style="padding-top: 15px; padding-bottom: 15px;">
|
||||
@if(hasWritePermission){
|
||||
<label class="checkbox" style="cursor: default;">
|
||||
<input type="checkbox" value="@issue.issueId"/>
|
||||
}
|
||||
<img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png" style="margin-right: 20px;"/>
|
||||
@@ -176,9 +155,6 @@
|
||||
#@issue.issueId opened by @user(issue.openedUserName, styleClass="username") @datetime(issue.registeredDate)
|
||||
<span style="margin: 20px;"><a href="@condition.copy(milestoneId = Some(Some(1))).toURL" class="username">@milestone</a></span>
|
||||
</div>
|
||||
@if(hasWritePermission){
|
||||
</label>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user