diff --git a/css/style.css b/css/style.css index 5c8615cfa..0237b89be 100644 --- a/css/style.css +++ b/css/style.css @@ -185,7 +185,7 @@ } .stack h2 { - padding: 10px; + padding:10px; padding-bottom: 8px; margin: 0; font-size: 12pt; @@ -197,7 +197,6 @@ .stack h2 input { padding: 0px; width: 80%; - padding-bottom: 3px; margin: 0; font-size: 12pt; font-weight: 700; diff --git a/js/controller/ListController.js b/js/controller/ListController.js index 853d81243..3afb64c5e 100644 --- a/js/controller/ListController.js +++ b/js/controller/ListController.js @@ -40,6 +40,10 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ }; $scope.boardCreate = function () { + if(!$scope.newBoard.title || !$scope.newBoard.color) { + $scope.status.addBoard=false; + return; + } BoardService.create($scope.newBoard) .then(function (response) { $scope.newBoard = {}; @@ -65,7 +69,6 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ }; $scope.filterData = function () { - console.log("filter"); angular.copy($scope.boardservice.getData(), $scope.boardservice.sorted); $scope.boardservice.sorted = $filter('orderBy')($scope.boardservice.sorted, 'title'); }; diff --git a/js/public/app.js b/js/public/app.js index 2678aaf61..3544abf91 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -422,6 +422,10 @@ app.controller('ListController', ["$scope", "$location", "$filter", "BoardServic }; $scope.boardCreate = function () { + if(!$scope.newBoard.title || !$scope.newBoard.color) { + $scope.status.addBoard=false; + return; + } BoardService.create($scope.newBoard) .then(function (response) { $scope.newBoard = {}; @@ -447,7 +451,6 @@ app.controller('ListController', ["$scope", "$location", "$filter", "BoardServic }; $scope.filterData = function () { - console.log("filter"); angular.copy($scope.boardservice.getData(), $scope.boardservice.sorted); $scope.boardservice.sorted = $filter('orderBy')($scope.boardservice.sorted, 'title'); }; diff --git a/lib/Db/Entity.php b/lib/Db/Entity.php index 450e376b4..f804eedd0 100644 --- a/lib/Db/Entity.php +++ b/lib/Db/Entity.php @@ -65,6 +65,4 @@ class Entity extends \OCP\AppFramework\Db\Entity { return $this->_updatedFields; } - - } \ No newline at end of file diff --git a/lib/Db/Stack.php b/lib/Db/Stack.php index ee2f5bb9a..bec7a3914 100644 --- a/lib/Db/Stack.php +++ b/lib/Db/Stack.php @@ -34,22 +34,34 @@ class Stack extends Entity implements JsonSerializable { protected $boardId; protected $cards = array(); protected $order; + public function __construct() { $this->addType('id','integer'); $this->addType('boardId','integer'); $this->addType('order','integer'); - } + public function setCards($cards) { $this->cards = $cards; } + public function jsonSerialize() { - return [ - 'id' => $this->id, - 'title' => $this->title, - 'order' => $this->order, - 'boardId' => $this->boardId, - 'cards' => $this->cards, - ]; + if(!empty($this->cards)) { + return [ + 'id' => $this->id, + 'title' => $this->title, + 'order' => $this->order, + 'boardId' => $this->boardId, + 'cards' => $this->cards + ]; + } else { + return [ + 'id' => $this->id, + 'title' => $this->title, + 'order' => $this->order, + 'boardId' => $this->boardId + ]; + } + } } \ No newline at end of file diff --git a/templates/part.board.mainView.php b/templates/part.board.mainView.php index cc07d736b..92309c595 100644 --- a/templates/part.board.mainView.php +++ b/templates/part.board.mainView.php @@ -30,7 +30,6 @@ ng-blur="s.status.editStack=false" ng-model="s.title" ng-if="s.status.editStack" autofocus-on-insert required/> -