diff --git a/css/style.scss b/css/style.scss index d5248aff3..8180a4ac6 100644 --- a/css/style.scss +++ b/css/style.scss @@ -457,6 +457,20 @@ input.input-inline { } } + .card-tasks { + border-radius: 3px; + margin: 4px 4px 4px 0px; + padding: 0 2px; + font-size: 90%; + opacity: 0.5; + display: flex; + align-items: center; + + .icon { + background-size: contain; + } + } + button { padding: 22px; margin: 0; diff --git a/js/controller/BoardController.js b/js/controller/BoardController.js index 2d2d1e374..6d4d7e615 100644 --- a/js/controller/BoardController.js +++ b/js/controller/BoardController.js @@ -49,6 +49,22 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St }, true); $scope.params = $state; + /** + * Check for markdown checkboxes in description to render the counter + * + * This should probably be moved to the backend at some point + * + * @param text + * @returns array of [finished, total] checkboxes + */ + $scope.getCheckboxes = function(text) { + const regTotal = /\[(X|\s|\_|\-)\]\s(.*)/ig; + const regFinished = /\[(X|\_|\-)\]\s(.*)/ig; + return [ + ((text || '').match(regFinished) || []).length, + ((text || '').match(regTotal) || []).length + ]; + }; $scope.search = function (searchText) { $scope.searchText = searchText; diff --git a/templates/part.board.mainView.php b/templates/part.board.mainView.php index 1de9a543b..05dff539f 100644 --- a/templates/part.board.mainView.php +++ b/templates/part.board.mainView.php @@ -80,6 +80,10 @@ {{ c.duedate | relativeDateFilterString }} +
+ + {{ getCheckboxes(c.description)[0] }}/{{ getCheckboxes(c.description)[1] }} +