diff --git a/src/main/twirl/gitbucket/core/issues/list.scala.html b/src/main/twirl/gitbucket/core/issues/list.scala.html index ea4d8d7..81ae631 100644 --- a/src/main/twirl/gitbucket/core/issues/list.scala.html +++ b/src/main/twirl/gitbucket/core/issues/list.scala.html @@ -48,17 +48,32 @@ }); $('.table-issues input[type=checkbox]').change(function(){ - if($('.table-issues input[type=checkbox]').filter(':checked').length == 0){ + var all = $('.table-issues input[type=checkbox][value]'); + + // check all + if($(this).val() == 'on'){ + var flag = $(this).is(":checked"); + all.each(function(){ + $(this).prop("checked", flag); + }); + } + + var count = all.filter(':checked').length; + // whether all check + $('.table-issues input[type=checkbox]').filter(':first').prop("checked", count > 0 && count == all.length); + + if(count == 0){ $('#table-issues-control').show(); $('#table-issues-batchedit').hide(); } else { + $('#batchedit-selected').text(count); $('#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 checked = $('.table-issues input[type=checkbox][value]').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); diff --git a/src/main/twirl/gitbucket/core/issues/listparts.scala.html b/src/main/twirl/gitbucket/core/issues/listparts.scala.html index b5c8789..3cc9027 100644 --- a/src/main/twirl/gitbucket/core/issues/listparts.scala.html +++ b/src/main/twirl/gitbucket/core/issues/listparts.scala.html @@ -26,8 +26,10 @@
- - + @if(hasWritePermission){ + + } + @openCount Open @@ -36,116 +38,119 @@ @closedCount Closed - -
- @helper.html.dropdown("Author", flat = true) { - @collaborators.map { collaborator => -
  • - - @helper.html.checkicon(condition.author == Some(collaborator)) - @avatar(collaborator, 20) @collaborator - -
  • - } - } - @helper.html.dropdown("Label", flat = true) { - @labels.map { label => -
  • - - @helper.html.checkicon(condition.labels.contains(label.labelName)) -    - @label.labelName - -
  • - } - } - @helper.html.dropdown("Milestone", flat = true) { -
  • - - @helper.html.checkicon(condition.milestone == Some(None)) Issues with no milestone - -
  • - @milestones.filter(_.closedDate.isEmpty).map { milestone => -
  • - - @helper.html.checkicon(condition.milestone == Some(Some(milestone.title))) @milestone.title - -
  • - } - } - @helper.html.dropdown("Assignee", flat = true) { - @collaborators.map { collaborator => -
  • - - @helper.html.checkicon(condition.assigned == Some(collaborator)) - @avatar(collaborator, 20) @collaborator - -
  • - } - } - @helper.html.dropdown("Sort", flat = true){ -
  • - - @helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest - -
  • -
  • - - @helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest - -
  • -
  • - - @helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented - -
  • -
  • - - @helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented - -
  • -
  • - - @helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated - -
  • -
  • - - @helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated - -
  • - } -
    - @if(hasWritePermission){ -
    - @helper.html.dropdown("Mark as", flat = true) { -
  • Open
  • -
  • Close
  • +
    + @helper.html.dropdown("Author", flat = true) { + @collaborators.map { collaborator => +
  • + + @helper.html.checkicon(condition.author == Some(collaborator)) + @avatar(collaborator, 20) @collaborator + +
  • + } } @helper.html.dropdown("Label", flat = true) { @labels.map { label =>
  • - - -   + + @helper.html.checkicon(condition.labels.contains(label.labelName)) +    @label.labelName
  • } } @helper.html.dropdown("Milestone", flat = true) { -
  • No milestone
  • +
  • + + @helper.html.checkicon(condition.milestone == Some(None)) Issues with no milestone + +
  • @milestones.filter(_.closedDate.isEmpty).map { milestone => -
  • @milestone.title
  • +
  • + + @helper.html.checkicon(condition.milestone == Some(Some(milestone.title))) @milestone.title + +
  • } } @helper.html.dropdown("Assignee", flat = true) { -
  • Clear assignee
  • @collaborators.map { collaborator => -
  • @avatar(collaborator, 20) @collaborator
  • +
  • + + @helper.html.checkicon(condition.assigned == Some(collaborator)) + @avatar(collaborator, 20) @collaborator + +
  • } } + @helper.html.dropdown("Sort", flat = true){ +
  • + + @helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest + +
  • +
  • + + @helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest + +
  • +
  • + + @helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented + +
  • +
  • + + @helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented + +
  • +
  • + + @helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated + +
  • +
  • + + @helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated + +
  • + }
    + + @if(hasWritePermission){ + + selected +
    + @helper.html.dropdown("Mark as", flat = true) { +
  • Open
  • +
  • Close
  • + } + @helper.html.dropdown("Label", flat = true) { + @labels.map { label => +
  • + + +   + @label.labelName + +
  • + } + } + @helper.html.dropdown("Milestone", flat = true) { +
  • No milestone
  • + @milestones.filter(_.closedDate.isEmpty).map { milestone => +
  • @milestone.title
  • + } + } + @helper.html.dropdown("Assign", flat = true) { +
  • Assign to nobody
  • + @collaborators.map { collaborator => +
  • @avatar(collaborator, 20) @collaborator
  • + } + } +
    +
    }