change lot of stuff

This commit is contained in:
Julius Haertl
2016-07-30 22:21:12 +02:00
parent d61dcdb614
commit 9abd92c4e4
29 changed files with 864 additions and 204 deletions

View File

@@ -17,42 +17,40 @@ return [
['name' => 'share#searchUser', 'url' => '/share/search/{search}', 'verb' => 'GET'],
// boards
['name' => 'board#index', 'url' => '/boards/', 'verb' => 'GET'],
['name' => 'board#create', 'url' => '/boards/', 'verb' => 'POST'],
['name' => 'board#read', 'url' => '/boards/{boardId}/', 'verb' => 'GET'],
['name' => 'board#update', 'url' => '/boards/', 'verb' => 'PUT'],
['name' => 'board#delete', 'url' => '/boards/{boardId}/', 'verb' => 'DELETE'],
// boards - acl
['name' => 'board#addAcl', 'url' => '/boards/acl', 'verb' => 'POST'],
['name' => 'board#updateAcl', 'url' => '/boards/acl', 'verb' => 'PUT'],
['name' => 'board#deleteAcl', 'url' => '/boards/acl/{id}', 'verb' => 'DELETE'],
['name' => 'board#index', 'url' => '/boards', 'verb' => 'GET'],
['name' => 'board#create', 'url' => '/boards', 'verb' => 'POST'],
['name' => 'board#read', 'url' => '/boards/{boardId}', 'verb' => 'GET'],
['name' => 'board#update', 'url' => '/boards/{boardId}', 'verb' => 'PUT'],
['name' => 'board#delete', 'url' => '/boards/{boardId}', 'verb' => 'DELETE'],
['name' => 'board#addAcl', 'url' => '/boards/{boardId}/acl', 'verb' => 'POST'],
['name' => 'board#updateAcl', 'url' => '/boards/{boardId}/acl', 'verb' => 'PUT'],
['name' => 'board#deleteAcl', 'url' => '/boards/{boardId}/acl/{aclId}', 'verb' => 'DELETE'],
// stacks
['name' => 'stack#index', 'url' => '/stacks/{boardId}/', 'verb' => 'GET'],
['name' => 'stack#create', 'url' => '/stacks/', 'verb' => 'POST'],
['name' => 'stack#update', 'url' => '/stacks/', 'verb' => 'PUT'],
['name' => 'stack#delete', 'url' => '/stacks/{stackId}/', 'verb' => 'DELETE'],
['name' => 'stack#index', 'url' => '/stacks/{boardId}', 'verb' => 'GET'],
['name' => 'stack#create', 'url' => '/stacks', 'verb' => 'POST'],
['name' => 'stack#update', 'url' => '/stacks/{stackId}', 'verb' => 'PUT'],
['name' => 'stack#delete', 'url' => '/stacks/{stackId}', 'verb' => 'DELETE'],
['name' => 'stack#archived', 'url' => '/stacks/{boardId}/archived', 'verb' => 'GET'],
// cards
['name' => 'card#read', 'url' => '/cards/{cardId}/', 'verb' => 'GET'],
['name' => 'card#create', 'url' => '/cards/', 'verb' => 'POST'],
['name' => 'card#update', 'url' => '/cards/', 'verb' => 'PUT'],
['name' => 'card#rename', 'url' => '/cards/rename/', 'verb' => 'PUT'],
['name' => 'card#reorder', 'url' => '/cards/reorder/', 'verb' => 'PUT'],
['name' => 'card#delete', 'url' => '/cards/{cardId}/', 'verb' => 'DELETE'],
// card - assign labels
['name' => 'card#read', 'url' => '/cards/{cardId}', 'verb' => 'GET'],
['name' => 'card#create', 'url' => '/cards', 'verb' => 'POST'],
['name' => 'card#update', 'url' => '/cards/{cardId}', 'verb' => 'PUT'],
['name' => 'card#delete', 'url' => '/cards/{cardId}', 'verb' => 'DELETE'],
['name' => 'card#rename', 'url' => '/cards/{cardId}/rename', 'verb' => 'PUT'],
['name' => 'card#reorder', 'url' => '/cards/{cardId}/reorder', 'verb' => 'PUT'],
['name' => 'card#archive', 'url' => '/cards/{cardId}/archive', 'verb' => 'PUT'],
['name' => 'card#assignLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'POST'],
['name' => 'card#removeLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'DELETE'],
// TODO: card - assign user
['name' => 'card#assignUser', 'url' => '/cards/{cardId}/user/{labelId}', 'verb' => 'POST'],
['name' => 'card#removeUser', 'url' => '/cards/{cardId}/user/{labelId}', 'verb' => 'DELETE'],
// labels
['name' => 'label#create', 'url' => '/labels/', 'verb' => 'POST'],
['name' => 'label#update', 'url' => '/labels/', 'verb' => 'PUT'],
['name' => 'label#delete', 'url' => '/labels/{labelId}/', 'verb' => 'DELETE'],
['name' => 'label#create', 'url' => '/labels', 'verb' => 'POST'],
['name' => 'label#update', 'url' => '/labels({labelId}', 'verb' => 'PUT'],
['name' => 'label#delete', 'url' => '/labels/{labelId}', 'verb' => 'DELETE'],
// TODO: Implement public board sharing
['name' => 'public#index', 'url' => '/public/board/:hash', 'verb' => 'GET'],

View File

@@ -35,7 +35,7 @@ class BoardController extends Controller {
*/
public function read($boardId) {
// FIXME: Remove as this is just for testing if loading animation works out nicely
usleep(200000);
//usleep(2000);
return $this->boardService->find($this->userId, $boardId);
}

View File

@@ -60,6 +60,19 @@ class CardController extends Controller {
public function delete($cardId) {
return $this->cardService->delete($this->userId, $cardId);
}
/**
* @NoAdminRequired
*/
public function archive($id) {
return $this->cardService->archive($id);
}
/**
* @NoAdminRequired
*/
public function unarchive($id) {
return $this->cardService->unarchive($id);
}
/**
* @NoAdminRequired
*/

View File

@@ -26,6 +26,12 @@ class StackController extends Controller {
public function index($boardId) {
return $this->stackService->findAll($boardId);
}
/**
* @NoAdminRequired
*/
public function archived($boardId) {
return $this->stackService->findAllArchived($boardId);
}
/**
* @NoAdminRequired
*/

View File

@@ -1,3 +1,8 @@
#searchbox {
display:block !important;
}
.app-navigation-entry-utils-menu-button {
display: block !important;
}
@@ -154,12 +159,16 @@
float:right;
}
.card {
background-color:#f6f6f6;
background-color:#f0f0f0;
margin:5px;
white-space: normal;
padding-bottom:4px;
position: relative;
opacity: 1.0;
border:1px solid #aaaaaa;
}
.card.archived {
opacity:0.5;
}
.card-upper {
overflow: hidden;

View File

@@ -33,7 +33,7 @@ class Board extends \OCA\Deck\Db\Entity implements JsonSerializable {
public function setLabels($labels) {
foreach ($labels as $l) {
$this->labels[$l->id] = $l;
$this->labels[] = $l;
}
}

View File

@@ -22,6 +22,9 @@ class Card extends Entity implements JsonSerializable {
$this->addType('id','integer');
$this->addType('stackId','integer');
$this->addType('order','integer');
$this->addType('lastModified', 'integer');
$this->addType('createdAt', 'integer');
$this->addType('archived','boolean');
$this->addRelation('labels');
}

View File

@@ -51,6 +51,7 @@ class CardMapper extends Mapper {
}
public function findAll($stackId, $limit=null, $offset=null) {
// TODO: Exclude fields like text
$sql = 'SELECT * FROM `*PREFIX*deck_cards`
WHERE `stack_id` = ? AND NOT archived ORDER BY `order`';
$entities = $this->findEntities($sql, [$stackId], $limit, $offset);
@@ -58,9 +59,8 @@ class CardMapper extends Mapper {
}
// TODO: test
public function findAllArchived($boardId, $limit=null, $offset=null) {
$sql = 'SELECT * FROM `*PREFIX*deck_cards` as c, `*PREFIX*deck_stacks` as s
WHERE `s.board_id` = ? AND c.stack_id = s.id AND archived ORDER BY `last_modified`';
public function findAllArchived($stackId, $limit=null, $offset=null) {
$sql = 'SELECT * FROM `*PREFIX*deck_cards` WHERE `stack_id`=? AND archived ORDER BY `last_modified`';
$entities = $this->findEntities($sql, [$stackId], $limit, $offset);
return $entities;
}

View File

@@ -33,6 +33,7 @@ class StackMapper extends Mapper {
return $this->findEntities($sql, [$boardId], $limit, $offset);
}
public function delete(Entity $entity) {
// FIXME: delete linked elements, because owncloud doesn't support foreign keys for apps
return parent::delete($entity);

View File

@@ -40,6 +40,7 @@ module.exports = function(grunt) {
buildJS: [
'app/**/*.js',
'controller/**/*.js',
'filters/**/*.js',
'directive/**/*.js',
'service/**/*.js'
],

View File

@@ -24,7 +24,7 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid
.state('board', {
url: "/board/:boardId",
templateUrl: "/board.html",
controller: 'BoardController'
controller: 'BoardController',
})
.state('board.detail', {
url: "/detail/",
@@ -32,7 +32,12 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid
"sidebarView": {
templateUrl: "/board.sidebarView.html",
}
}
},
})
.state('board.archive', {
url: "/archive/",
templateUrl: "/board.html",
controller: 'BoardController',
})
.state('board.card', {
url: "/card/:cardId",

View File

@@ -18,6 +18,10 @@ app.run(function ($document, $rootScope, $transitions) {
$transitions.onExit({from: 'board.detail'}, function ($state) {
$rootScope.sidebar.show = false;
});
$transitions.onEnter({to: 'board.archive'}, function ($state) {
//BoardController.update();
console.log($state.$current.parent)
});
$('link[rel="shortcut icon"]').attr(
'href',

View File

@@ -4,4 +4,16 @@ app.controller('AppController', function ($scope, $location, $http, $route, $log
show: false
};
$scope.sidebar = $rootScope.sidebar;
$scope.search = function (value) {
if (value === '') {
$location.search('search', null);
} else {
$location.search('search', value);
}
$scope.searchText = value;
};
$scope.searchText = $location.search().search;
});

View File

@@ -0,0 +1,165 @@
app.controller('ArchiveController', function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions) {
$scope.sidebar = $rootScope.sidebar;
$scope.id = $stateParams.boardId;
$scope.status={},
$scope.newLabel={};
$scope.status.boardtab = $stateParams.detailTab;
$scope.state = $state.current;
console.log($scope.state);
$scope.stackservice = StackService;
$scope.boardservice = BoardService;
$scope.cardservice = CardService;
$scope.statusservice = StatusService.getInstance();
$scope.labelservice = LabelService;
$scope.foo = function(state) {
console.log(state);
}
// fetch data
StackService.clear();
$scope.statusservice.retainWaiting();
$scope.statusservice.retainWaiting();
BoardService.fetchOne($scope.id).then(function(data) {
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
console.log($scope);
StackService.fetchArchived($scope.id).then(function(data) {
console.log(data);
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
BoardService.searchUsers();
$scope.cardDelete = function(card) {
CardService.delete(card.id);
StackService.deleteCard(card);
}
// TODO: move to filter?
// Lighten Color of the board for background usage
$scope.rgblight = function (hex) {
var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex);
var color = result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
if(result !== null) {
var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)";
return rgba;
} else {
return "#"+hex;
}
};
// TODO: move to filter?
// RGB2HLS by Garry Tan
// http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
$scope.textColor = function (hex) {
var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex);
var color = result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
if(result !== null) {
r = color.r/255;
g = color.g/255;
b = color.b/255;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, l = (max + min) / 2;
if(max == min){
h = s = 0; // achromatic
}else{
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch(max){
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
// TODO: Maybe just darken/lighten the color
if(l<0.5) {
return "#ffffff";
} else {
return "#000000";
}
//var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)";
//return rgba;
} else {
return "#aa0000";
}
};
// settings for card sorting
$scope.sortOptions = {
itemMoved: function (event) {
// TODO: Implement reodering here
event.source.itemScope.modelValue.status = event.dest.sortableScope.$parent.column;
var order = event.dest.index;
var card = event.source.itemScope.c;
var newStack = event.dest.sortableScope.$parent.s.id;
card.stackId = newStack;
CardService.update(card);
CardService.reorder(card, order).then(function(data) {
StackService.data[newStack].addCard(card);
});
},
orderChanged: function (event) {
// TODO: Implement ordering here
var order = event.dest.index;
var card = event.source.itemScope.c;
CardService.reorder(card, order);
},
scrollableContainer: '#board',
containerPositioning: 'relative',
containment: '#board',
// auto scroll on drag
dragMove: function (itemPosition, containment, eventObj) {
if (eventObj) {
var container = $("#board");
var offset = container.offset();
targetX = eventObj.pageX - (offset.left || container.scrollLeft());
targetY = eventObj.pageY - (offset.top || container.scrollTop());
if (targetX < offset.left) {
container.scrollLeft(container.scrollLeft() - 50);
} else if (targetX > container.width()) {
container.scrollLeft(container.scrollLeft() + 50);
}
if (targetY < offset.top) {
container.scrollTop(container.scrollTop() - 50);
} else if (targetY > container.height()) {
container.scrollTop(container.scrollTop() + 50);
}
}
}
};
});

View File

@@ -1,47 +1,51 @@
app.controller('BoardController', function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService) {
app.controller('BoardController', function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions) {
$scope.sidebar = $rootScope.sidebar;
$scope.id = $stateParams.boardId;
$scope.status={},
$scope.newLabel={};
$scope.newLabel={};
$scope.status.boardtab = $stateParams.detailTab;
$scope.state = $state.current;
$scope.stackservice = StackService;
$scope.boardservice = BoardService;
$scope.cardservice = CardService;
$scope.statusservice = StatusService.getInstance();
$scope.labelservice = LabelService;
$scope.defaultColors = ['31CC7C', '317CCC', 'FF7A66', 'F1DB50', '7C31CC', 'CC317C', '3A3B3D', 'CACBCD'];
// fetch data
StackService.clear();
$scope.statusservice.retainWaiting();
$scope.statusservice.retainWaiting();
StackService.fetchAll($scope.id).then(function(data) {
console.log(data);
BoardService.fetchOne($scope.id).then(function(data) {
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
console.log($scope.state);
StackService.fetchAll($scope.id).then(function(data) {
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
BoardService.searchUsers();
BoardService.fetchOne($scope.id).then(function(data) {
console.log(BoardService.getCurrent());
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
$scope.newStack = { 'boardId': $scope.id};
$scope.newCard = {};
// Create a new Stack
$scope.createStack = function () {
StackService.create($scope.newStack).then(function (data) {
@@ -97,64 +101,6 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
$scope.updateAcl = function(acl) {
BoardService.updateAcl(acl);
}
// TODO: move to filter?
// Lighten Color of the board for background usage
$scope.rgblight = function (hex) {
var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex);
var color = result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
if(result !== null) {
var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)";
return rgba;
} else {
return "#"+hex;
}
};
// TODO: move to filter?
// RGB2HLS by Garry Tan
// http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
$scope.textColor = function (hex) {
var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex);
var color = result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
if(result !== null) {
r = color.r/255;
g = color.g/255;
b = color.b/255;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, l = (max + min) / 2;
if(max == min){
h = s = 0; // achromatic
}else{
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch(max){
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
// TODO: Maybe just darken/lighten the color
if(l<0.5) {
return "#ffffff";
} else {
return "#000000";
}
//var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)";
//return rgba;
} else {
return "#aa0000";
}
};

28
js/directive/search.js Normal file
View File

@@ -0,0 +1,28 @@
app.directive('search', function ($document, $location) {
'use strict';
return {
restrict: 'E',
scope: {
'onSearch': '='
},
link: function (scope) {
var box = $('#searchbox');
box.val($location.search().search);
var doSearch = function() {
var value = box.val();
scope.$apply(function () {
scope.onSearch(value);
});
}
box.on('search keyup', function (event) {
if (event.type === 'search' || event.keyCode === 13 ) {
doSearch();
}
});
}
};
});

16
js/filters/cardFilter.js Normal file
View File

@@ -0,0 +1,16 @@
// usage | cardFilter({ member: 'admin'})
app.filter('cardFilter', function() {
return function(cards, rules) {
var _result = {};
angular.forEach(cards, function(card){
var _card = card;
angular.some(rules, function(rule, condition) {
if(_card[rule]===condition) {
_result.push(_card);
}
});
});
return result;
};
});

View File

@@ -0,0 +1,20 @@
// usage | cardFilter({ member: 'admin'})
app.filter('cardSearchFilter', function() {
return function(cards, searchString) {
var _result = {};
var rules = {
title: searchString,
owner: searchString,
};
angular.forEach(cards, function(card){
var _card = card;
Object.keys(rules).some(function(rule) {
if(_card[rule].search(rules[rule])>=0) {
_result[_card.id] = _card;
}
});
});
return _result;
};
});

View File

@@ -0,0 +1,16 @@
app.filter('lightenColorFilter', function() {
return function (hex) {
var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex);
var color = result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
if (result !== null) {
var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)";
return rgba;
} else {
return "#" + hex;
}
}
});

View File

@@ -0,0 +1,16 @@
app.filter('orderObjectBy', function(){
return function(input, attribute) {
if (!angular.isObject(input)) return input;
var array = [];
for(var objectKey in input) {
array.push(input[objectKey]);
}
array.sort(function(a, b){
a = parseInt(a[attribute]);
b = parseInt(b[attribute]);
return a - b;
});
return array;
}
});

View File

@@ -0,0 +1,43 @@
app.filter('lightenColorFilter', function() {
return function (hex) {
// RGB2HLS by Garry Tan
// http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex);
var color = result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
if(result !== null) {
r = color.r/255;
g = color.g/255;
b = color.b/255;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, l = (max + min) / 2;
if(max == min){
h = s = 0; // achromatic
}else{
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch(max){
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
// TODO: Maybe just darken/lighten the color
if(l<0.5) {
return "#ffffff";
} else {
return "#000000";
}
//var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)";
//return rgba;
} else {
return "#aa0000";
}
}
});

View File

@@ -54,7 +54,7 @@ app.config(["$provide", "$routeProvider", "$interpolateProvider", "$httpProvider
.state('board', {
url: "/board/:boardId",
templateUrl: "/board.html",
controller: 'BoardController'
controller: 'BoardController',
})
.state('board.detail', {
url: "/detail/",
@@ -62,7 +62,12 @@ app.config(["$provide", "$routeProvider", "$interpolateProvider", "$httpProvider
"sidebarView": {
templateUrl: "/board.sidebarView.html",
}
}
},
})
.state('board.archive', {
url: "/archive/",
templateUrl: "/board.html",
controller: 'BoardController',
})
.state('board.card', {
url: "/card/:cardId",
@@ -102,6 +107,10 @@ app.run(["$document", "$rootScope", "$transitions", function ($document, $rootSc
$transitions.onExit({from: 'board.detail'}, function ($state) {
$rootScope.sidebar.show = false;
});
$transitions.onEnter({to: 'board.archive'}, function ($state) {
//BoardController.update();
console.log($state.$current.parent)
});
$('link[rel="shortcut icon"]').attr(
'href',
@@ -116,22 +125,40 @@ app.controller('AppController', ["$scope", "$location", "$http", "$route", "$log
show: false
};
$scope.sidebar = $rootScope.sidebar;
$scope.search = function (value) {
if (value === '') {
$location.search('search', null);
} else {
$location.search('search', value);
}
$scope.searchText = value;
};
$scope.searchText = $location.search().search;
}]);
app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "StatusService", "BoardService", "StackService", "CardService", "LabelService", function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService) {
app.controller('ArchiveController', ["$rootScope", "$scope", "$stateParams", "StatusService", "BoardService", "StackService", "CardService", "LabelService", "$state", "$transitions", function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions) {
$scope.sidebar = $rootScope.sidebar;
$scope.id = $stateParams.boardId;
$scope.status={},
$scope.newLabel={};
$scope.newLabel={};
$scope.status.boardtab = $stateParams.detailTab;
$scope.state = $state.current;
console.log($scope.state);
$scope.stackservice = StackService;
$scope.boardservice = BoardService;
$scope.cardservice = CardService;
$scope.statusservice = StatusService.getInstance();
$scope.labelservice = LabelService;
$scope.defaultColors = ['31CC7C', '317CCC', 'FF7A66', 'F1DB50', '7C31CC', 'CC317C', '3A3B3D', 'CACBCD'];
$scope.foo = function(state) {
console.log(state);
}
// fetch data
@@ -139,83 +166,36 @@ app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "Stat
$scope.statusservice.retainWaiting();
$scope.statusservice.retainWaiting();
StackService.fetchAll($scope.id).then(function(data) {
console.log(data);
BoardService.fetchOne($scope.id).then(function(data) {
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
console.log($scope);
StackService.fetchArchived($scope.id).then(function(data) {
console.log(data);
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
BoardService.searchUsers();
BoardService.fetchOne($scope.id).then(function(data) {
console.log(BoardService.getCurrent());
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
$scope.newStack = { 'boardId': $scope.id};
$scope.newCard = {};
// Create a new Stack
$scope.createStack = function () {
StackService.create($scope.newStack).then(function (data) {
$scope.newStack.title="";
});
};
$scope.createCard = function(stack, title) {
var newCard = {
'title': title,
'stackId': stack,
'type': 'plain',
};
CardService.create(newCard).then(function (data) {
$scope.stackservice.addCard(data);
$scope.newCard.title = "";
});
}
$scope.cardDelete = function(card) {
CardService.delete(card.id);
StackService.deleteCard(card);
}
$scope.labelDelete = function(label) {
LabelService.delete(label.id);
// remove from board data
var i = BoardService.getCurrent().labels.indexOf(label);
BoardService.getCurrent().labels.splice(i, 1);
// TODO: remove from cards
}
$scope.labelCreate = function(label) {
label.boardId = $scope.id;
LabelService.create(label);
BoardService.getCurrent().labels.push(label);
$scope.status.createLabel = false;
$scope.newLabel = {};
}
$scope.labelUpdate = function(label) {
label.edit = false;
LabelService.update(label);
}
$scope.addAcl = function(sharee) {
sharee.boardId = $scope.id;
BoardService.addAcl(sharee);
$scope.status.addSharee = null;
}
$scope.deleteAcl = function(acl) {
BoardService.deleteAcl(acl.id);
}
$scope.updateAcl = function(acl) {
BoardService.updateAcl(acl);
}
// TODO: move to filter?
// Lighten Color of the board for background usage
$scope.rgblight = function (hex) {
@@ -277,6 +257,159 @@ app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "Stat
// settings for card sorting
$scope.sortOptions = {
itemMoved: function (event) {
// TODO: Implement reodering here
event.source.itemScope.modelValue.status = event.dest.sortableScope.$parent.column;
var order = event.dest.index;
var card = event.source.itemScope.c;
var newStack = event.dest.sortableScope.$parent.s.id;
card.stackId = newStack;
CardService.update(card);
CardService.reorder(card, order).then(function(data) {
StackService.data[newStack].addCard(card);
});
},
orderChanged: function (event) {
// TODO: Implement ordering here
var order = event.dest.index;
var card = event.source.itemScope.c;
CardService.reorder(card, order);
},
scrollableContainer: '#board',
containerPositioning: 'relative',
containment: '#board',
// auto scroll on drag
dragMove: function (itemPosition, containment, eventObj) {
if (eventObj) {
var container = $("#board");
var offset = container.offset();
targetX = eventObj.pageX - (offset.left || container.scrollLeft());
targetY = eventObj.pageY - (offset.top || container.scrollTop());
if (targetX < offset.left) {
container.scrollLeft(container.scrollLeft() - 50);
} else if (targetX > container.width()) {
container.scrollLeft(container.scrollLeft() + 50);
}
if (targetY < offset.top) {
container.scrollTop(container.scrollTop() - 50);
} else if (targetY > container.height()) {
container.scrollTop(container.scrollTop() + 50);
}
}
}
};
}]);
app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "StatusService", "BoardService", "StackService", "CardService", "LabelService", "$state", "$transitions", function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions) {
$scope.sidebar = $rootScope.sidebar;
$scope.id = $stateParams.boardId;
$scope.status={},
$scope.newLabel={};
$scope.status.boardtab = $stateParams.detailTab;
$scope.state = $state.current;
$scope.stackservice = StackService;
$scope.boardservice = BoardService;
$scope.cardservice = CardService;
$scope.statusservice = StatusService.getInstance();
$scope.labelservice = LabelService;
$scope.defaultColors = ['31CC7C', '317CCC', 'FF7A66', 'F1DB50', '7C31CC', 'CC317C', '3A3B3D', 'CACBCD'];
// fetch data
StackService.clear();
$scope.statusservice.retainWaiting();
$scope.statusservice.retainWaiting();
BoardService.fetchOne($scope.id).then(function(data) {
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
console.log($scope.state);
StackService.fetchAll($scope.id).then(function(data) {
$scope.statusservice.releaseWaiting();
}, function(error) {
$scope.statusservice.setError('Error occured', error);
});
BoardService.searchUsers();
$scope.newStack = { 'boardId': $scope.id};
$scope.newCard = {};
// Create a new Stack
$scope.createStack = function () {
StackService.create($scope.newStack).then(function (data) {
$scope.newStack.title="";
});
};
$scope.createCard = function(stack, title) {
var newCard = {
'title': title,
'stackId': stack,
'type': 'plain',
};
CardService.create(newCard).then(function (data) {
$scope.stackservice.addCard(data);
$scope.newCard.title = "";
});
}
$scope.cardDelete = function(card) {
CardService.delete(card.id);
StackService.deleteCard(card);
}
$scope.labelDelete = function(label) {
LabelService.delete(label.id);
// remove from board data
var i = BoardService.getCurrent().labels.indexOf(label);
BoardService.getCurrent().labels.splice(i, 1);
// TODO: remove from cards
}
$scope.labelCreate = function(label) {
label.boardId = $scope.id;
LabelService.create(label);
BoardService.getCurrent().labels.push(label);
$scope.status.createLabel = false;
$scope.newLabel = {};
}
$scope.labelUpdate = function(label) {
label.edit = false;
LabelService.update(label);
}
$scope.addAcl = function(sharee) {
sharee.boardId = $scope.id;
BoardService.addAcl(sharee);
$scope.status.addSharee = null;
}
$scope.deleteAcl = function(acl) {
BoardService.deleteAcl(acl.id);
}
$scope.updateAcl = function(acl) {
BoardService.updateAcl(acl);
}
// settings for card sorting
$scope.sortOptions = {
itemMoved: function (event) {
@@ -421,6 +554,117 @@ app.controller('ListController', ["$scope", "$location", "BoardService", functio
}]);
// usage | cardFilter({ member: 'admin'})
app.filter('cardFilter', function() {
return function(cards, rules) {
var _result = {};
angular.forEach(cards, function(card){
var _card = card;
angular.some(rules, function(rule, condition) {
if(_card[rule]===condition) {
_result.push(_card);
}
});
});
return result;
};
});
// usage | cardFilter({ member: 'admin'})
app.filter('cardSearchFilter', function() {
return function(cards, searchString) {
var _result = {};
var rules = {
title: searchString,
owner: searchString,
};
angular.forEach(cards, function(card){
var _card = card;
Object.keys(rules).some(function(rule) {
if(_card[rule].search(rules[rule])>=0) {
_result[_card.id] = _card;
}
});
});
return _result;
};
});
app.filter('lightenColorFilter', function() {
return function (hex) {
var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex);
var color = result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
if (result !== null) {
var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)";
return rgba;
} else {
return "#" + hex;
}
}
});
app.filter('orderObjectBy', function(){
return function(input, attribute) {
if (!angular.isObject(input)) return input;
var array = [];
for(var objectKey in input) {
array.push(input[objectKey]);
}
array.sort(function(a, b){
a = parseInt(a[attribute]);
b = parseInt(b[attribute]);
return a - b;
});
return array;
}
});
app.filter('lightenColorFilter', function() {
return function (hex) {
// RGB2HLS by Garry Tan
// http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
var result = /^([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex);
var color = result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
if(result !== null) {
r = color.r/255;
g = color.g/255;
b = color.b/255;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, l = (max + min) / 2;
if(max == min){
h = s = 0; // achromatic
}else{
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch(max){
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
// TODO: Maybe just darken/lighten the color
if(l<0.5) {
return "#ffffff";
} else {
return "#000000";
}
//var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)";
//return rgba;
} else {
return "#aa0000";
}
}
});
// OwnCloud Click Handling
// https://doc.owncloud.org/server/8.0/developer_manual/app/css.html
app.directive('appNavigationEntryUtils', function () {
@@ -531,6 +775,35 @@ app.directive('markdownChecklist', function () {
});
app.directive('search', ["$document", "$location", function ($document, $location) {
'use strict';
return {
restrict: 'E',
scope: {
'onSearch': '='
},
link: function (scope) {
var box = $('#searchbox');
box.val($location.search().search);
var doSearch = function() {
var value = box.val();
scope.$apply(function () {
scope.onSearch(value);
});
}
box.on('search keyup', function (event) {
if (event.type === 'search' || event.keyCode === 13 ) {
doSearch();
}
});
}
};
}]);
app.factory('ApiService', ["$http", "$q", function($http, $q){
var ApiService = function(http, endpoint) {
this.endpoint = endpoint;
@@ -594,7 +867,7 @@ app.factory('ApiService', ["$http", "$q", function($http, $q){
ApiService.prototype.update = function (entity) {
var deferred = $q.defer();
var self = this;
$http.put(this.baseUrl, entity).then(function (response) {
$http.put(this.baseUrl + '/' + entity.id, entity).then(function (response) {
self.add(response.data);
deferred.resolve(response.data);
}, function (error) {
@@ -691,7 +964,7 @@ app.factory('BoardService', ["ApiService", "$http", "$q", function(ApiService, $
var deferred = $q.defer();
var self = this;
var _acl = acl;
$http.post(this.baseUrl + '/acl', _acl).then(function (response) {
$http.post(this.baseUrl + '/' + acl.boardId + '/acl', _acl).then(function (response) {
if(!board.acl) {
board.acl = {};
}
@@ -704,11 +977,11 @@ app.factory('BoardService', ["ApiService", "$http", "$q", function(ApiService, $
return deferred.promise;
};
BoardService.prototype.deleteAcl = function(id) {
BoardService.prototype.deleteAcl = function(acl) {
var board = this.getCurrent();
var deferred = $q.defer();
var self = this;
$http.delete(this.baseUrl + '/acl/' + id).then(function (response) {
$http.delete(this.baseUrl + '/' + acl.boardId + '/acl/' + acl.id).then(function (response) {
delete board.acl[response.data.id];
deferred.resolve(response.data);
}, function (error) {
@@ -723,7 +996,7 @@ app.factory('BoardService', ["ApiService", "$http", "$q", function(ApiService, $
var deferred = $q.defer();
var self = this;
var _acl = acl;
$http.put(this.baseUrl + '/acl', _acl).then(function (response) {
$http.put(this.baseUrl + '/' + acl.boardId + '/acl', _acl).then(function (response) {
board.acl[_acl.id] = response.data;
deferred.resolve(response.data);
}, function (error) {
@@ -746,7 +1019,7 @@ app.factory('CardService', ["ApiService", "$http", "$q", function(ApiService, $h
CardService.prototype.reorder = function(card, order) {
var deferred = $q.defer();
var self = this;
$http.put(this.baseUrl + '/reorder', {cardId: card.id, order: order, stackId: card.stackId}).then(function (response) {
$http.put(this.baseUrl + '/' + card.id + '/reorder', {cardId: card.id, order: order, stackId: card.stackId}).then(function (response) {
card.order = order;
deferred.resolve(response.data);
}, function (error) {
@@ -758,7 +1031,7 @@ app.factory('CardService', ["ApiService", "$http", "$q", function(ApiService, $h
CardService.prototype.rename = function(card) {
var deferred = $q.defer();
var self = this;
$http.put(this.baseUrl + '/rename', {cardId: card.id, title: card.title}).then(function (response) {
$http.put(this.baseUrl + '/' + card.id + '/rename', {cardId: card.id, title: card.title}).then(function (response) {
self.data[card.id].title = card.title;
deferred.resolve(response.data);
}, function (error) {
@@ -768,7 +1041,6 @@ app.factory('CardService', ["ApiService", "$http", "$q", function(ApiService, $h
}
CardService.prototype.assignLabel = function(card, label) {
//['name' => 'card#assignLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'POST'],
var url = this.baseUrl + '/' + card + '/label/' + label;
var deferred = $q.defer();
var self = this;
@@ -780,7 +1052,6 @@ app.factory('CardService', ["ApiService", "$http", "$q", function(ApiService, $h
return deferred.promise;
}
CardService.prototype.removeLabel = function(card, label) {
// ['name' => 'card#removeLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'DELETE'],
var url = this.baseUrl + '/' + card + '/label/' + label;
var deferred = $q.defer();
var self = this;
@@ -792,6 +1063,18 @@ app.factory('CardService', ["ApiService", "$http", "$q", function(ApiService, $h
return deferred.promise;
}
CardService.prototype.archive = function (card) {
var deferred = $q.defer();
var self = this;
$http.put(this.baseUrl + '/' + card.id + '/archive').then(function (response) {
deferred.resolve(response.data);
}, function (error) {
deferred.reject('Error while update ' + self.endpoint);
});
return deferred.promise;
};
service = new CardService($http, 'cards', $q)
return service;
}]);
@@ -812,18 +1095,31 @@ app.factory('StackService', ["ApiService", "$http", "$q", function(ApiService, $
var deferred = $q.defer();
var self=this;
$http.get(this.baseUrl +'/'+boardId).then(function (response) {
self.clear();
self.addAll(response.data);
deferred.resolve(self.data);
}, function (error) {
deferred.reject('Error while loading stacks');
});
return deferred.promise;
};
}
StackService.prototype.fetchArchived = function(boardId) {
var deferred = $q.defer();
var self=this;
$http.get(this.baseUrl +'/'+boardId+'/archived').then(function (response) {
self.clear();
self.addAll(response.data);
deferred.resolve(self.data);
}, function (error) {
deferred.reject('Error while loading stacks');
});
return deferred.promise;
};
StackService.prototype.addCard = function(entity) {
this.data[entity.stackId].cards.push(entity);
}
};
StackService.prototype.updateCard = function(entity) {
var self = this;
var cards = this.data[entity.stackId].cards;
@@ -832,7 +1128,7 @@ app.factory('StackService', ["ApiService", "$http", "$q", function(ApiService, $
cards[i] = entity;
}
}
}
};
StackService.prototype.deleteCard = function(entity) {
var self = this;
var cards = this.data[entity.stackId].cards;
@@ -841,7 +1137,7 @@ app.factory('StackService', ["ApiService", "$http", "$q", function(ApiService, $
cards.splice(i, 1);
}
}
}
};
service = new StackService($http, 'stacks', $q);
return service;
}]);

View File

@@ -61,7 +61,7 @@ app.factory('ApiService', function($http, $q){
ApiService.prototype.update = function (entity) {
var deferred = $q.defer();
var self = this;
$http.put(this.baseUrl, entity).then(function (response) {
$http.put(this.baseUrl + '/' + entity.id, entity).then(function (response) {
self.add(response.data);
deferred.resolve(response.data);
}, function (error) {

View File

@@ -23,7 +23,7 @@ app.factory('BoardService', function(ApiService, $http, $q){
var deferred = $q.defer();
var self = this;
var _acl = acl;
$http.post(this.baseUrl + '/acl', _acl).then(function (response) {
$http.post(this.baseUrl + '/' + acl.boardId + '/acl', _acl).then(function (response) {
if(!board.acl) {
board.acl = {};
}
@@ -36,11 +36,11 @@ app.factory('BoardService', function(ApiService, $http, $q){
return deferred.promise;
};
BoardService.prototype.deleteAcl = function(id) {
BoardService.prototype.deleteAcl = function(acl) {
var board = this.getCurrent();
var deferred = $q.defer();
var self = this;
$http.delete(this.baseUrl + '/acl/' + id).then(function (response) {
$http.delete(this.baseUrl + '/' + acl.boardId + '/acl/' + acl.id).then(function (response) {
delete board.acl[response.data.id];
deferred.resolve(response.data);
}, function (error) {
@@ -55,7 +55,7 @@ app.factory('BoardService', function(ApiService, $http, $q){
var deferred = $q.defer();
var self = this;
var _acl = acl;
$http.put(this.baseUrl + '/acl', _acl).then(function (response) {
$http.put(this.baseUrl + '/' + acl.boardId + '/acl', _acl).then(function (response) {
board.acl[_acl.id] = response.data;
deferred.resolve(response.data);
}, function (error) {

View File

@@ -7,7 +7,7 @@ app.factory('CardService', function(ApiService, $http, $q){
CardService.prototype.reorder = function(card, order) {
var deferred = $q.defer();
var self = this;
$http.put(this.baseUrl + '/reorder', {cardId: card.id, order: order, stackId: card.stackId}).then(function (response) {
$http.put(this.baseUrl + '/' + card.id + '/reorder', {cardId: card.id, order: order, stackId: card.stackId}).then(function (response) {
card.order = order;
deferred.resolve(response.data);
}, function (error) {
@@ -19,7 +19,7 @@ app.factory('CardService', function(ApiService, $http, $q){
CardService.prototype.rename = function(card) {
var deferred = $q.defer();
var self = this;
$http.put(this.baseUrl + '/rename', {cardId: card.id, title: card.title}).then(function (response) {
$http.put(this.baseUrl + '/' + card.id + '/rename', {cardId: card.id, title: card.title}).then(function (response) {
self.data[card.id].title = card.title;
deferred.resolve(response.data);
}, function (error) {
@@ -29,7 +29,6 @@ app.factory('CardService', function(ApiService, $http, $q){
}
CardService.prototype.assignLabel = function(card, label) {
//['name' => 'card#assignLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'POST'],
var url = this.baseUrl + '/' + card + '/label/' + label;
var deferred = $q.defer();
var self = this;
@@ -41,7 +40,6 @@ app.factory('CardService', function(ApiService, $http, $q){
return deferred.promise;
}
CardService.prototype.removeLabel = function(card, label) {
// ['name' => 'card#removeLabel', 'url' => '/cards/{cardId}/label/{labelId}', 'verb' => 'DELETE'],
var url = this.baseUrl + '/' + card + '/label/' + label;
var deferred = $q.defer();
var self = this;
@@ -53,6 +51,18 @@ app.factory('CardService', function(ApiService, $http, $q){
return deferred.promise;
}
CardService.prototype.archive = function (card) {
var deferred = $q.defer();
var self = this;
$http.put(this.baseUrl + '/' + card.id + '/archive').then(function (response) {
deferred.resolve(response.data);
}, function (error) {
deferred.reject('Error while update ' + self.endpoint);
});
return deferred.promise;
};
service = new CardService($http, 'cards', $q)
return service;
});

View File

@@ -7,18 +7,31 @@ app.factory('StackService', function(ApiService, $http, $q){
var deferred = $q.defer();
var self=this;
$http.get(this.baseUrl +'/'+boardId).then(function (response) {
self.clear();
self.addAll(response.data);
deferred.resolve(self.data);
}, function (error) {
deferred.reject('Error while loading stacks');
});
return deferred.promise;
};
}
StackService.prototype.fetchArchived = function(boardId) {
var deferred = $q.defer();
var self=this;
$http.get(this.baseUrl +'/'+boardId+'/archived').then(function (response) {
self.clear();
self.addAll(response.data);
deferred.resolve(self.data);
}, function (error) {
deferred.reject('Error while loading stacks');
});
return deferred.promise;
};
StackService.prototype.addCard = function(entity) {
this.data[entity.stackId].cards.push(entity);
}
};
StackService.prototype.updateCard = function(entity) {
var self = this;
var cards = this.data[entity.stackId].cards;
@@ -27,7 +40,7 @@ app.factory('StackService', function(ApiService, $http, $q){
cards[i] = entity;
}
}
}
};
StackService.prototype.deleteCard = function(entity) {
var self = this;
var cards = this.data[entity.stackId].cards;
@@ -36,7 +49,7 @@ app.factory('StackService', function(ApiService, $http, $q){
cards.splice(i, 1);
}
}
}
};
service = new StackService($http, 'stacks', $q);
return service;
});

View File

@@ -69,7 +69,7 @@ class CardService {
if($card->id !== $id) {
$card->setOrder($i++);
}
$card->setLastModified(time());
$this->cardMapper->update($card);
}
// FIXME: return reordered cards without an additional db query
@@ -77,6 +77,17 @@ class CardService {
return $cards;
}
public function archive($id) {
$card = $this->cardMapper->find($id);
$card->setArchived(true);
return $this->cardMapper->update($card);
}
public function unarchive($id) {
$card = $this->cardMapper->find($id);
$card->setArchived(false);
return $this->cardMapper->update($card);
}
public function assignLabel($userId, $cardId, $labelId) {
$this->cardMapper->assignLabel($cardId, $labelId);

View File

@@ -46,6 +46,19 @@ class StackService {
return $stacks;
}
public function findAllArchived($boardId) {
$stacks = $this->stackMapper->findAll($boardId);
$labels = $this->labelMapper->getAssignedLabelsForBoard($boardId);
foreach ($stacks as $idx => $s) {
$cards = $this->cardMapper->findAllArchived($s->id);
foreach ($cards as $idxc => $card) {
$cards[$idxc]->setLabels($labels[$card->id]);
}
$stacks[$idx]->setCards($cards);
}
return $stacks;
}
public function create($title, $boardId, $order) {
$stack = new Stack();
$stack->setTitle($title);

View File

@@ -9,6 +9,7 @@
{{ boardservice.data[id].title }}
<div id="board-actions">
<div><i class="fa fa-filter"> </i> Filter</div>
<div><i class="icon icon-search"> </i> {{ searchText }}</div>
<div class="filter"><span class="filter-button" ng-click="status.filter.label=!status.filter.label">by label <i class="fa fa-caret-down"> </i></span></div>
<ul class="filter-select bubble" ng-if="status.filter.label">
<li ng-repeat="label in boardservice.data[id].labels"><span style="background-color:#{{ label.color }};"> </span> {{ label.title }}</li>
@@ -18,8 +19,7 @@
<li ng-repeat="label in boardservice.data[id].labels"><span style="background-color:#{{ label.color }};"> </span> {{ label.title }}</li>
</ul>
<div class="board-action-button"><a class="fa fa-share-alt" ui-sref="board.detail({ id: id })"> </a></div>
<div class="board-action-button"><a class="fa fa-users" ui-sref="board.detail({ id: id })"> </a></div>
<div class="board-action-button"><a class="fa fa-archive" ui-sref="board.archive({ id: id })"> </a></div>
<div class="board-action-button"><a class="fa fa-ellipsis-h" ui-sref="board.detail({ id: id })"> </a></div>
</div>
@@ -28,6 +28,8 @@
<div id="board" class="scroll-container" >
<search on-search="search" class="ng-hide"></search>
<div id="innerBoard" data-ng-model="stacks">
@@ -43,7 +45,7 @@
</div>
</h2>
<ul data-as-sortable="sortOptions" data-ng-model="s.cards" style="min-height: 40px;">
<li class="card as-sortable-item" ng-repeat="c in s.cards" data-as-sortable-item ui-sref="board.card({boardId: id, cardId: c.id})">
<li class="card as-sortable-item" ng-repeat="c in s.cards | cardSearchFilter: searchText | orderObjectBy:'order'" data-as-sortable-item ui-sref="board.card({boardId: id, cardId: c.id})" ng-class="{'archived': c.archived }">
<div data-as-sortable-item-handle>
<div class="card-upper">
<h3>{{ c.title }}</h3>
@@ -56,7 +58,7 @@
<button class="card-options icon-more" ng-click="c.status.showMenu=!c.status.showMenu; $event.stopPropagation();" ng-model="card"></button>
<div class="popovermenu bubble" ng-show="c.status.showMenu"><ul>
<li><a class="menuitem action action-rename permanent" data-action="Rename"><span class="icon icon-rename"></span><span>Umbenennen</span></a></li>
<li><a class="menuitem action action-rename permanent" data-action="Rename"><span class="icon icon-rename"></span><span>Archive</span></a></li>
<li><a class="menuitem action action-rename permanent" data-action="Rename" ng-click="cardservice.archive(c); $event.stopPropagation();"><span class="fa fa-archive"></span><span>Archive</span></a></li>
<li><a class="menuitem action action-delete permanent" data-action="Delete" ng-click="cardDelete(c)"><span class="icon icon-delete"></span><span>Löschen</span></a></li></ul>
</div>
<div class="card-assignees">
@@ -69,7 +71,20 @@
</div>
</li>
</li></ul>
<ul>
<li class="card archived" ng-repeat="card in s.cards | cardSearchFilter: searchText | orderObjectBy:'lastModified'" ui-sref="board.card({boardId: id, cardId: c.id})">
<div>
<div class="card-upper">
<h3>{{ card.title }}</h3>
<ul class="labels">
<li ng-repeat="label in c.labels" style="background-color: #{{ label.color }};"><span>{{ label.title }}</span>
</li>
</ul>
</div>
<button class="card-options fa fa-archive"></button>
</div>
</li>
</ul>
<!-- CREATE CARD //-->
<div class="card create" style="background-color:#{{ boardservice.getCurrent().color }};">