Fix stack renaming, archived card adding

This commit is contained in:
Julius Haertl
2016-10-28 01:59:59 +02:00
parent 5e7f0a044d
commit 461269d7d2
6 changed files with 30 additions and 16 deletions

View File

@@ -185,7 +185,7 @@
} }
.stack h2 { .stack h2 {
padding: 10px; padding:10px;
padding-bottom: 8px; padding-bottom: 8px;
margin: 0; margin: 0;
font-size: 12pt; font-size: 12pt;
@@ -197,7 +197,6 @@
.stack h2 input { .stack h2 input {
padding: 0px; padding: 0px;
width: 80%; width: 80%;
padding-bottom: 3px;
margin: 0; margin: 0;
font-size: 12pt; font-size: 12pt;
font-weight: 700; font-weight: 700;

View File

@@ -40,6 +40,10 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ
}; };
$scope.boardCreate = function () { $scope.boardCreate = function () {
if(!$scope.newBoard.title || !$scope.newBoard.color) {
$scope.status.addBoard=false;
return;
}
BoardService.create($scope.newBoard) BoardService.create($scope.newBoard)
.then(function (response) { .then(function (response) {
$scope.newBoard = {}; $scope.newBoard = {};
@@ -65,7 +69,6 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ
}; };
$scope.filterData = function () { $scope.filterData = function () {
console.log("filter");
angular.copy($scope.boardservice.getData(), $scope.boardservice.sorted); angular.copy($scope.boardservice.getData(), $scope.boardservice.sorted);
$scope.boardservice.sorted = $filter('orderBy')($scope.boardservice.sorted, 'title'); $scope.boardservice.sorted = $filter('orderBy')($scope.boardservice.sorted, 'title');
}; };

View File

@@ -422,6 +422,10 @@ app.controller('ListController', ["$scope", "$location", "$filter", "BoardServic
}; };
$scope.boardCreate = function () { $scope.boardCreate = function () {
if(!$scope.newBoard.title || !$scope.newBoard.color) {
$scope.status.addBoard=false;
return;
}
BoardService.create($scope.newBoard) BoardService.create($scope.newBoard)
.then(function (response) { .then(function (response) {
$scope.newBoard = {}; $scope.newBoard = {};
@@ -447,7 +451,6 @@ app.controller('ListController', ["$scope", "$location", "$filter", "BoardServic
}; };
$scope.filterData = function () { $scope.filterData = function () {
console.log("filter");
angular.copy($scope.boardservice.getData(), $scope.boardservice.sorted); angular.copy($scope.boardservice.getData(), $scope.boardservice.sorted);
$scope.boardservice.sorted = $filter('orderBy')($scope.boardservice.sorted, 'title'); $scope.boardservice.sorted = $filter('orderBy')($scope.boardservice.sorted, 'title');
}; };

View File

@@ -65,6 +65,4 @@ class Entity extends \OCP\AppFramework\Db\Entity {
return $this->_updatedFields; return $this->_updatedFields;
} }
} }

View File

@@ -34,22 +34,34 @@ class Stack extends Entity implements JsonSerializable {
protected $boardId; protected $boardId;
protected $cards = array(); protected $cards = array();
protected $order; protected $order;
public function __construct() { public function __construct() {
$this->addType('id','integer'); $this->addType('id','integer');
$this->addType('boardId','integer'); $this->addType('boardId','integer');
$this->addType('order','integer'); $this->addType('order','integer');
} }
public function setCards($cards) { public function setCards($cards) {
$this->cards = $cards; $this->cards = $cards;
} }
public function jsonSerialize() { public function jsonSerialize() {
return [ if(!empty($this->cards)) {
'id' => $this->id, return [
'title' => $this->title, 'id' => $this->id,
'order' => $this->order, 'title' => $this->title,
'boardId' => $this->boardId, 'order' => $this->order,
'cards' => $this->cards, 'boardId' => $this->boardId,
]; 'cards' => $this->cards
];
} else {
return [
'id' => $this->id,
'title' => $this->title,
'order' => $this->order,
'boardId' => $this->boardId
];
}
} }
} }

View File

@@ -30,7 +30,6 @@
ng-blur="s.status.editStack=false" ng-model="s.title" ng-blur="s.status.editStack=false" ng-model="s.title"
ng-if="s.status.editStack" autofocus-on-insert ng-if="s.status.editStack" autofocus-on-insert
required/> required/>
</form> </form>
<div class="stack-actions"> <div class="stack-actions">
<button class="icon icon-confirm" ng-if="s.status.editStack" <button class="icon icon-confirm" ng-if="s.status.editStack"
@@ -99,7 +98,7 @@
</ul> </ul>
<!-- CREATE CARD //--> <!-- CREATE CARD //-->
<div class="card create" <div class="card create"
style="background-color:#{{ boardservice.getCurrent().color }};" ng-if="checkCanEdit()"> style="background-color:#{{ boardservice.getCurrent().color }};" ng-if="checkCanEdit() && filter!=='archive'">
<form ng-submit="createCard(s.id, newCard.title)"> <form ng-submit="createCard(s.id, newCard.title)">
<h3 ng-if="s.status.addCard"> <h3 ng-if="s.status.addCard">
<input type="text" autofocus-on-insert <input type="text" autofocus-on-insert