Skip to content

Instantly share code, notes, and snippets.

@waterjump
Last active June 6, 2018 14:23
Show Gist options
  • Save waterjump/73f47a7777b9ef687f53929b58325ae5 to your computer and use it in GitHub Desktop.
Save waterjump/73f47a7777b9ef687f53929b58325ae5 to your computer and use it in GitHub Desktop.
Redmine Kanban Group WIP limit bookmarklet
javascript: (function() {
var getAmount = function($element) {
return Number($element.first().find('.count').text().split('/')[0]);
};
var brkActive, brkDone, brkTotal, $breakdown;
var impActive, impDone, impTotal, $implement;
var rvwActive, rvwDone, rvwTotal, $review;
brkActive = getAmount($('th[data-column-id=12]'));
brkDone = getAmount($('th[data-column-id=15]'));
brkTotal = brkActive + brkDone;
$breakdown = $('th:contains("Breakdown")');
$breakdown.text('Breakdown (' + brkTotal +'/2)');
impActive = getAmount($('th[data-column-id=2]'));
impDone = getAmount($('th[data-column-id=16]'));
impTotal = impActive + impDone;
$implement = $('th:contains("Implement")');
$implement.text('Implement (' + impTotal +'/5)');
rvwActive = getAmount($('th[data-column-id=13]'));
rvwDone = getAmount($('th[data-column-id=3]'));
rvwTotal = rvwActive + rvwDone;
$review = $('th:contains("Review")');
$review.text('Review (' + rvwTotal +'/5)');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment