diff --git a/appinfo/routes.php b/appinfo/routes.php index b18313cba..7d594f399 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -41,6 +41,7 @@ return [ ['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#unarchive', 'url' => '/cards/{cardId}/unarchive', '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 diff --git a/controller/cardcontroller.php b/controller/cardcontroller.php index ccc4c36d2..30838d439 100644 --- a/controller/cardcontroller.php +++ b/controller/cardcontroller.php @@ -64,14 +64,14 @@ class CardController extends Controller { /** * @NoAdminRequired */ - public function archive($id) { - return $this->cardService->archive($id); + public function archive($cardId) { + return $this->cardService->archive($cardId); } /** * @NoAdminRequired */ - public function unarchive($id) { - return $this->cardService->unarchive($id); + public function unarchive($cardId) { + return $this->cardService->unarchive($cardId); } /** * @NoAdminRequired diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index c335e32b0..7a00e15da 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -15,15 +15,18 @@ use OCP\IRequest; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Controller; +use OCP\IL10N; class PageController extends Controller { private $userId; + private $l10n; - public function __construct($AppName, IRequest $request, $UserId){ + public function __construct($AppName, IRequest $request,IL10N $l10n, $UserId){ parent::__construct($AppName, $request); $this->userId = $UserId; + $this->l10n = $l10n; } /** @@ -38,4 +41,4 @@ class PageController extends Controller { return new TemplateResponse('deck', 'main', $params); } -} \ No newline at end of file +} diff --git a/css/style.css b/css/style.css index d536dfdc9..370005c17 100644 --- a/css/style.css +++ b/css/style.css @@ -72,7 +72,6 @@ font-size:14pt; margin: 0; padding:12px; - padding-left:50px; } #board-actions { @@ -135,10 +134,11 @@ margin-right:10px; vertical-align: top; display:inline-block !important; + background-color: #fafafa; } .stack h2 { - padding: 5px; - padding-bottom:3px; + padding: 10px; + padding-bottom:8px; margin: 0; font-size:12pt; font-weight:700; @@ -171,15 +171,14 @@ float:right; } .card { - background-color:#f0f0f0; - margin:5px; + background-color:#ffffff; + margin:10px; white-space: normal; - padding-bottom:4px; position: relative; opacity: 1.0; - border:1px solid #aaaaaa; + -webkit-box-shadow: 0px 0px 5px #bbb; } -.card.archived { +.card.archived .card-upper { opacity:0.5; } .card-upper { @@ -191,6 +190,10 @@ position: absolute; bottom: 10px; right:10px; + display: none; +} +.card:hover .card-options { + display: block; } .card .popovermenu { z-index:999; @@ -212,11 +215,13 @@ font-size:10pt; margin:0; padding:0; - margin-bottom:-5px; - margin-top:15px; + margin: 5px; display: inline-block; float:left; } +.card.has-labels h3 { + margin-top:15px; +} .card h3 .fa { font-size:18pt; line-height:10pt; @@ -251,8 +256,7 @@ } .as-sortable-placeholder { - margin:5px; - margin-bottom:5px; + margin:10px; border: 1px dashed #aaa; } @@ -274,9 +278,11 @@ text-align:center; margin:0; padding:0; - padding-top:4px; + padding:10px; border: none; overflow:hidden; + margin: 10px; + -webkit-box-shadow: none; } .card.create:hover { text-align:center; @@ -321,10 +327,12 @@ #card-header { + height: 44px; } #card-header h2 { - font-weight:600; + font-size: 14pt; padding:10px; + padding-bottom:9px; overflow: hidden; margin-bottom:0px; background-color:#f0f0f0; @@ -342,6 +350,9 @@ color: #aaaaaa; margin-bottom: 3px; } +#card-meta #labels { + margin-bottom: 10px; +} #card-dates span { } @@ -426,14 +437,18 @@ } .labels li span { -} -#assigned-users { - margin-top:15px; - } .avatardiv { float:left; - margin-right:5px; + background-color: #eee; + border-radius: 16px; + width:32px; + height:32px; + margin-right: 3px; +} +.avatardiv .fa-group { + padding: 7px; + opacity: 0.5; } /* color selector */ @@ -625,6 +640,14 @@ margin-bottom:2px; width:100%; display:none !important; } } +@media only screen and (max-width: 768px) { + #board-header h1 { + margin-left: 50px; + } +} + + + #markdown p { margin-bottom:15px; @@ -658,6 +681,9 @@ margin-bottom:2px; width:100%; } +.shareWithList .username { + min-width:100px; +} .shareWithList .icon { display: inline-block; background-size: 16px 16px; diff --git a/db/boardmapper.php b/db/boardmapper.php index 0e07fd0da..5b3d64522 100644 --- a/db/boardmapper.php +++ b/db/boardmapper.php @@ -51,7 +51,13 @@ class BoardMapper extends Mapper { */ public function findAll($userId, $limit=null, $offset=null) { $sql = 'SELECT * FROM `*PREFIX*deck_boards` WHERE `owner` = ? ORDER BY `title`'; - return $this->findEntities($sql, [$userId], $limit, $offset); + $entries = $this->findEntities($sql, [$userId], $limit, $offset); + /* @var Board $entry */ + foreach ($entries as $entry) { + $acl = $this->aclMapper->findAll($entry->id); + $entry->setAcl($acl); + } + return $entries; } public function delete(\OCP\AppFramework\Db\Entity $entity) { diff --git a/db/labelmapper.php b/db/labelmapper.php index da41f2938..a383c6857 100644 --- a/db/labelmapper.php +++ b/db/labelmapper.php @@ -14,7 +14,7 @@ class LabelMapper extends DeckMapper { } public function findAll($boardId, $limit=null, $offset=null) { - $sql = 'SELECT * FROM `*PREFIX*deck_labels` WHERE `board_id` = ?'; + $sql = 'SELECT * FROM `*PREFIX*deck_labels` WHERE `board_id` = ? ORDER BY `id`'; return $this->findEntities($sql, [$boardId], $limit, $offset); } diff --git a/js/Makefile b/js/Makefile index e12ae8f13..df7963fb5 100644 --- a/js/Makefile +++ b/js/Makefile @@ -4,3 +4,7 @@ default: watch: grunt watch +install: + npm install + bower install + diff --git a/js/app/Config.js b/js/app/Config.js index f407f6d33..e8b28f9ca 100644 --- a/js/app/Config.js +++ b/js/app/Config.js @@ -22,23 +22,22 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid controller: 'ListController', }) .state('board', { - url: "/board/:boardId", + url: "/board/:boardId/:filter", templateUrl: "/board.html", controller: 'BoardController', + params: { + filter: { value: '', dynamic: true } + } }) .state('board.detail', { url: "/detail/", + reloadOnSearch : false, views: { "sidebarView": { templateUrl: "/board.sidebarView.html", } }, }) - .state('board.archive', { - url: "/archive/", - templateUrl: "/board.html", - controller: 'BoardController', - }) .state('board.card', { url: "/card/:cardId", views: { @@ -47,12 +46,6 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid controller: 'CardController' } } - }) - .state('board.settings', { - - }) - .state('board.sharing', { - }); diff --git a/js/app/Run.js b/js/app/Run.js index 179242b7e..a2109dd44 100644 --- a/js/app/Run.js +++ b/js/app/Run.js @@ -19,8 +19,7 @@ app.run(function ($document, $rootScope, $transitions) { $rootScope.sidebar.show = false; }); $transitions.onEnter({to: 'board.archive'}, function ($state) { - //BoardController.update(); - console.log($state.$current.parent) + //BoardController.loadArchived(); }); $('link[rel="shortcut icon"]').attr( diff --git a/js/controller/AppController.js b/js/controller/AppController.js index f0fbde9a6..8c5f455df 100644 --- a/js/controller/AppController.js +++ b/js/controller/AppController.js @@ -14,6 +14,6 @@ app.controller('AppController', function ($scope, $location, $http, $route, $log $scope.searchText = value; }; - $scope.searchText = $location.search().search; + $rootScope.searchText = $location.search().search; }); \ No newline at end of file diff --git a/js/controller/BoardController.js b/js/controller/BoardController.js index b96612755..cc840ee5d 100644 --- a/js/controller/BoardController.js +++ b/js/controller/BoardController.js @@ -1,4 +1,4 @@ -app.controller('BoardController', function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions) { +app.controller('BoardController', function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions, $filter) { $scope.sidebar = $rootScope.sidebar; @@ -6,10 +6,6 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St $scope.status={}, $scope.newLabel={}; $scope.status.boardtab = $stateParams.detailTab; - $scope.state = $state.current; - - - $scope.stackservice = StackService; $scope.boardservice = BoardService; @@ -18,26 +14,87 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St $scope.labelservice = LabelService; $scope.defaultColors = ['31CC7C', '317CCC', 'FF7A66', 'F1DB50', '7C31CC', 'CC317C', '3A3B3D', 'CACBCD']; - // fetch data - StackService.clear(); + $scope.search = function (searchText) { + $scope.searchText = searchText; + $scope.refreshData(); + }; + + $scope.board = BoardService.getCurrent(); + StackService.clear(); //FIXME: Is this still needed? $scope.statusservice.retainWaiting(); $scope.statusservice.retainWaiting(); - BoardService.fetchOne($scope.id).then(function(data) { - $scope.statusservice.releaseWaiting(); - }, function(error) { - $scope.statusservice.setError('Error occured', error); + // FIXME: ugly solution for archive + $scope.$state = $stateParams; + $scope.filter = $stateParams.filter; + $scope.$watch('$state.filter', function (name) { + console.log("statewatch" + name); + $scope.filter = name; + }); + $scope.switchFilter = function(filter) { + console.log("switch filter click " + name); + $state.go('.', {filter: filter}, {notify: false}); + $scope.filter = filter; + }; + $scope.$watch('filter', function(name) { + if(name==="archive") { + $scope.loadArchived(); + } else { + $scope.loadDefault(); + } }); - console.log($scope.state); + $scope.stacksData = StackService; + $scope.stacks = {}; + $scope.$watch('stacksData', function(value) { + $scope.refreshData(); + }, true); + $scope.refreshData = function () { + if($scope.filter === "archive") { + $scope.filterData('-lastModified', $scope.searchText); + } else { + $scope.filterData('order', $scope.searchText); + } + }; + + // filter cards here, as ng-sortable will not work nicely with html-inline filters + $scope.filterData = function (order, text) { + if ($scope.stacks === undefined) + return; + angular.copy($scope.stackservice.data, $scope.stacks); + angular.forEach($scope.stacks, function (value, key) { + var cards = []; + cards = $filter('cardSearchFilter')(value.cards, text); + cards = $filter('orderBy')(cards, order); + $scope.stacks[key].cards = cards; + }); + }; + + $scope.loadDefault = function() { + console.log("Load default"); StackService.fetchAll($scope.id).then(function(data) { $scope.statusservice.releaseWaiting(); }, function(error) { $scope.statusservice.setError('Error occured', error); }); + }; + $scope.loadArchived = function() { + console.log("Load archived!"); + StackService.fetchArchived($scope.id).then(function(data) { + $scope.statusservice.releaseWaiting(); + }, function(error) { + $scope.statusservice.setError('Error occured', error); + }); + }; + // Handle initial Loading + BoardService.fetchOne($scope.id).then(function(data) { + $scope.statusservice.releaseWaiting(); + }, function(error) { + $scope.statusservice.setError('Error occured', error); + }); @@ -68,7 +125,14 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St $scope.cardDelete = function(card) { CardService.delete(card.id); StackService.deleteCard(card); - + } + $scope.cardArchive = function(card) { + CardService.archive(card); + StackService.deleteCard(card); + }; + $scope.cardUnarchive = function(card){ + CardService.unarchive(card); + StackService.deleteCard(card); } $scope.labelDelete = function(label) { @@ -102,27 +166,33 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St BoardService.updateAcl(acl); } - + $scope.checkCanEdit = function() { + if($scope.archived) { + return false; + } + return true; + } // settings for card sorting $scope.sortOptions = { itemMoved: function (event) { - // TODO: Implement reodering here + // TODO: Implement reodering here (set new order of all cards in stack) 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 + // TODO: Implement ordering here (set new order of all cards in stack) + // then maybe also call $scope.filterData('order')? var order = event.dest.index; var card = event.source.itemScope.c; + var stack = event.dest.sortableScope.$parent.s.id; CardService.reorder(card, order); }, scrollableContainer: '#board', diff --git a/js/controller/CardController.js b/js/controller/CardController.js index 7c416d347..4c2bff1e8 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -14,12 +14,11 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo CardService.fetchOne($scope.cardId).then(function(data) { $scope.statusservice.releaseWaiting(); - + $scope.archived = CardService.getCurrent().archived; console.log(data); }, function(error) { }); - // handle rename to update information on the board as well $scope.renameCard = function(card) { CardService.rename(card).then(function(data) { @@ -42,14 +41,9 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo var card = CardService.getCurrent(); StackService.updateCard(card); } + $scope.labelRemove = function(element, model) { CardService.removeLabel($scope.cardId, element.id) } - /*var menu = $('#app-content'); - menu.click(function(event){ - $scope.location.path('/board/'+$scope.boardId); - $scope.$apply(); - - });*/ }); diff --git a/js/directive/avatar.js b/js/directive/avatar.js index 72433cf6d..cd7c61b00 100644 --- a/js/directive/avatar.js +++ b/js/directive/avatar.js @@ -2,17 +2,15 @@ app.directive('avatar', function() { 'use strict'; return { restrict: 'A', - scope: false, - link: function(scope, elm, attr) { - return attr.$observe('user', function() { - if (attr.user) { - var url = OC.generateUrl('/avatar/{user}/{size}', - {user: attr.user, size: Math.ceil(attr.size * window.devicePixelRatio)}); - var inner = ''; - elm.html(inner); - //elm.avatar(attr.user, attr.size); + scope: true, + link: function(scope, element, attr){ + attr.$observe('displayname', function(value){ + console.log(value); + if(value!==undefined) { + $(element).avatar(value, 32); } }); + } }; }); \ No newline at end of file diff --git a/js/filters/cardSearchFilter.js b/js/filters/cardSearchFilter.js index 9cf754b1b..4bf30d252 100644 --- a/js/filters/cardSearchFilter.js +++ b/js/filters/cardSearchFilter.js @@ -1,11 +1,9 @@ -// usage | cardFilter({ member: 'admin'}) - app.filter('cardSearchFilter', function() { return function(cards, searchString) { var _result = {}; var rules = { title: searchString, - owner: searchString, + //owner: searchString, }; angular.forEach(cards, function(card){ var _card = card; @@ -15,6 +13,11 @@ app.filter('cardSearchFilter', function() { } }); }); - return _result; + + var arrayResult = $.map(_result, function(value, index) { + return [value]; + }); + + return arrayResult; }; }); \ No newline at end of file diff --git a/js/public/app.js b/js/public/app.js index 5bd5eb346..0b4a2f870 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -52,23 +52,22 @@ app.config(["$provide", "$routeProvider", "$interpolateProvider", "$httpProvider controller: 'ListController', }) .state('board', { - url: "/board/:boardId", + url: "/board/:boardId/:filter", templateUrl: "/board.html", controller: 'BoardController', + params: { + filter: { value: '', dynamic: true } + } }) .state('board.detail', { url: "/detail/", + reloadOnSearch : false, views: { "sidebarView": { templateUrl: "/board.sidebarView.html", } }, }) - .state('board.archive', { - url: "/archive/", - templateUrl: "/board.html", - controller: 'BoardController', - }) .state('board.card', { url: "/card/:cardId", views: { @@ -77,12 +76,6 @@ app.config(["$provide", "$routeProvider", "$interpolateProvider", "$httpProvider controller: 'CardController' } } - }) - .state('board.settings', { - - }) - .state('board.sharing', { - }); @@ -108,8 +101,7 @@ app.run(["$document", "$rootScope", "$transitions", function ($document, $rootSc $rootScope.sidebar.show = false; }); $transitions.onEnter({to: 'board.archive'}, function ($state) { - //BoardController.update(); - console.log($state.$current.parent) + //BoardController.loadArchived(); }); $('link[rel="shortcut icon"]').attr( @@ -135,7 +127,7 @@ app.controller('AppController', ["$scope", "$location", "$http", "$route", "$log $scope.searchText = value; }; - $scope.searchText = $location.search().search; + $rootScope.searchText = $location.search().search; }]); @@ -304,7 +296,7 @@ app.controller('ArchiveController', ["$rootScope", "$scope", "$stateParams", "St }]); -app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "StatusService", "BoardService", "StackService", "CardService", "LabelService", "$state", "$transitions", function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions) { +app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "StatusService", "BoardService", "StackService", "CardService", "LabelService", "$state", "$transitions", "$filter", function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions, $filter) { $scope.sidebar = $rootScope.sidebar; @@ -312,10 +304,6 @@ app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "Stat $scope.status={}, $scope.newLabel={}; $scope.status.boardtab = $stateParams.detailTab; - $scope.state = $state.current; - - - $scope.stackservice = StackService; $scope.boardservice = BoardService; @@ -324,26 +312,87 @@ app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "Stat $scope.labelservice = LabelService; $scope.defaultColors = ['31CC7C', '317CCC', 'FF7A66', 'F1DB50', '7C31CC', 'CC317C', '3A3B3D', 'CACBCD']; - // fetch data - StackService.clear(); + $scope.search = function (searchText) { + $scope.searchText = searchText; + $scope.refreshData(); + }; + + $scope.board = BoardService.getCurrent(); + StackService.clear(); //FIXME: Is this still needed? $scope.statusservice.retainWaiting(); $scope.statusservice.retainWaiting(); - BoardService.fetchOne($scope.id).then(function(data) { - $scope.statusservice.releaseWaiting(); - }, function(error) { - $scope.statusservice.setError('Error occured', error); + // FIXME: ugly solution for archive + $scope.$state = $stateParams; + $scope.filter = $stateParams.filter; + $scope.$watch('$state.filter', function (name) { + console.log("statewatch" + name); + $scope.filter = name; + }); + $scope.switchFilter = function(filter) { + console.log("switch filter click " + name); + $state.go('.', {filter: filter}, {notify: false}); + $scope.filter = filter; + }; + $scope.$watch('filter', function(name) { + if(name==="archive") { + $scope.loadArchived(); + } else { + $scope.loadDefault(); + } }); - console.log($scope.state); + $scope.stacksData = StackService; + $scope.stacks = {}; + $scope.$watch('stacksData', function(value) { + $scope.refreshData(); + }, true); + $scope.refreshData = function () { + if($scope.filter === "archive") { + $scope.filterData('-lastModified', $scope.searchText); + } else { + $scope.filterData('order', $scope.searchText); + } + }; + + // filter cards here, as ng-sortable will not work nicely with html-inline filters + $scope.filterData = function (order, text) { + if ($scope.stacks === undefined) + return; + angular.copy($scope.stackservice.data, $scope.stacks); + angular.forEach($scope.stacks, function (value, key) { + var cards = []; + cards = $filter('cardSearchFilter')(value.cards, text); + cards = $filter('orderBy')(cards, order); + $scope.stacks[key].cards = cards; + }); + }; + + $scope.loadDefault = function() { + console.log("Load default"); StackService.fetchAll($scope.id).then(function(data) { $scope.statusservice.releaseWaiting(); }, function(error) { $scope.statusservice.setError('Error occured', error); }); + }; + $scope.loadArchived = function() { + console.log("Load archived!"); + StackService.fetchArchived($scope.id).then(function(data) { + $scope.statusservice.releaseWaiting(); + }, function(error) { + $scope.statusservice.setError('Error occured', error); + }); + }; + // Handle initial Loading + BoardService.fetchOne($scope.id).then(function(data) { + $scope.statusservice.releaseWaiting(); + }, function(error) { + $scope.statusservice.setError('Error occured', error); + }); @@ -374,7 +423,14 @@ app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "Stat $scope.cardDelete = function(card) { CardService.delete(card.id); StackService.deleteCard(card); - + } + $scope.cardArchive = function(card) { + CardService.archive(card); + StackService.deleteCard(card); + }; + $scope.cardUnarchive = function(card){ + CardService.unarchive(card); + StackService.deleteCard(card); } $scope.labelDelete = function(label) { @@ -408,27 +464,33 @@ app.controller('BoardController', ["$rootScope", "$scope", "$stateParams", "Stat BoardService.updateAcl(acl); } - + $scope.checkCanEdit = function() { + if($scope.archived) { + return false; + } + return true; + } // settings for card sorting $scope.sortOptions = { itemMoved: function (event) { - // TODO: Implement reodering here + // TODO: Implement reodering here (set new order of all cards in stack) 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 + // TODO: Implement ordering here (set new order of all cards in stack) + // then maybe also call $scope.filterData('order')? var order = event.dest.index; var card = event.source.itemScope.c; + var stack = event.dest.sortableScope.$parent.s.id; CardService.reorder(card, order); }, scrollableContainer: '#board', @@ -473,12 +535,11 @@ app.controller('CardController', ["$scope", "$rootScope", "$routeParams", "$loca CardService.fetchOne($scope.cardId).then(function(data) { $scope.statusservice.releaseWaiting(); - + $scope.archived = CardService.getCurrent().archived; console.log(data); }, function(error) { }); - // handle rename to update information on the board as well $scope.renameCard = function(card) { CardService.rename(card).then(function(data) { @@ -501,16 +562,11 @@ app.controller('CardController', ["$scope", "$rootScope", "$routeParams", "$loca var card = CardService.getCurrent(); StackService.updateCard(card); } + $scope.labelRemove = function(element, model) { CardService.removeLabel($scope.cardId, element.id) } - /*var menu = $('#app-content'); - menu.click(function(event){ - $scope.location.path('/board/'+$scope.boardId); - $scope.$apply(); - - });*/ }]); @@ -570,14 +626,12 @@ app.filter('cardFilter', function() { return result; }; }); -// usage | cardFilter({ member: 'admin'}) - app.filter('cardSearchFilter', function() { return function(cards, searchString) { var _result = {}; var rules = { title: searchString, - owner: searchString, + //owner: searchString, }; angular.forEach(cards, function(card){ var _card = card; @@ -587,7 +641,12 @@ app.filter('cardSearchFilter', function() { } }); }); - return _result; + + var arrayResult = $.map(_result, function(value, index) { + return [value]; + }); + + return arrayResult; }; }); app.filter('lightenColorFilter', function() { @@ -701,17 +760,15 @@ app.directive('avatar', function() { 'use strict'; return { restrict: 'A', - scope: false, - link: function(scope, elm, attr) { - return attr.$observe('user', function() { - if (attr.user) { - var url = OC.generateUrl('/avatar/{user}/{size}', - {user: attr.user, size: Math.ceil(attr.size * window.devicePixelRatio)}); - var inner = ''; - elm.html(inner); - //elm.avatar(attr.user, attr.size); + scope: true, + link: function(scope, element, attr){ + attr.$observe('displayname', function(value){ + console.log(value); + if(value!==undefined) { + $(element).avatar(value, 32); } }); + } }; }); @@ -1067,7 +1124,19 @@ app.factory('CardService', ["ApiService", "$http", "$q", function(ApiService, $h CardService.prototype.archive = function (card) { var deferred = $q.defer(); var self = this; - $http.put(this.baseUrl + '/' + card.id + '/archive').then(function (response) { + $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; + + }; + + CardService.prototype.unarchive = function (card) { + var deferred = $q.defer(); + var self = this; + $http.put(this.baseUrl + '/' + card.id + '/unarchive', {}).then(function (response) { deferred.resolve(response.data); }, function (error) { deferred.reject('Error while update ' + self.endpoint); @@ -1092,6 +1161,7 @@ app.factory('StackService', ["ApiService", "$http", "$q", function(ApiService, $ ApiService.call(this, $http, ep, $q); }; StackService.prototype = angular.copy(ApiService.prototype); + StackService.prototype.dataFiltered = {}; StackService.prototype.fetchAll = function(boardId) { var deferred = $q.defer(); var self=this; @@ -1139,6 +1209,7 @@ app.factory('StackService', ["ApiService", "$http", "$q", function(ApiService, $ } } }; + service = new StackService($http, 'stacks', $q); return service; }]); @@ -1149,8 +1220,8 @@ app.factory('StatusService', function(){ var StatusService = function() { this.active = true; this.icon = 'loading'; - this.title = 'Please wait'; - this.text = 'Es dauert noch einen kleinen Moment'; + this.title = ''; + this.text = ''; this.counter = 0; } @@ -1182,8 +1253,8 @@ app.factory('StatusService', function(){ StatusService.prototype.retainWaiting = function() { this.active = true; this.icon = 'loading'; - this.title = 'Please wait'; - this.text = 'Es dauert noch einen kleinen Moment'; + this.title = ''; + this.text = ''; this.counter++; } diff --git a/js/service/CardService.js b/js/service/CardService.js index ea210874f..c3d872a4d 100644 --- a/js/service/CardService.js +++ b/js/service/CardService.js @@ -54,7 +54,19 @@ app.factory('CardService', function(ApiService, $http, $q){ CardService.prototype.archive = function (card) { var deferred = $q.defer(); var self = this; - $http.put(this.baseUrl + '/' + card.id + '/archive').then(function (response) { + $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; + + }; + + CardService.prototype.unarchive = function (card) { + var deferred = $q.defer(); + var self = this; + $http.put(this.baseUrl + '/' + card.id + '/unarchive', {}).then(function (response) { deferred.resolve(response.data); }, function (error) { deferred.reject('Error while update ' + self.endpoint); diff --git a/js/service/StackService.js b/js/service/StackService.js index 54f441636..a42cb946e 100644 --- a/js/service/StackService.js +++ b/js/service/StackService.js @@ -3,6 +3,7 @@ app.factory('StackService', function(ApiService, $http, $q){ ApiService.call(this, $http, ep, $q); }; StackService.prototype = angular.copy(ApiService.prototype); + StackService.prototype.dataFiltered = {}; StackService.prototype.fetchAll = function(boardId) { var deferred = $q.defer(); var self=this; @@ -50,6 +51,7 @@ app.factory('StackService', function(ApiService, $http, $q){ } } }; + service = new StackService($http, 'stacks', $q); return service; }); diff --git a/js/service/StatusService.js b/js/service/StatusService.js index f181c92e9..0f2135ca3 100644 --- a/js/service/StatusService.js +++ b/js/service/StatusService.js @@ -3,8 +3,8 @@ app.factory('StatusService', function(){ var StatusService = function() { this.active = true; this.icon = 'loading'; - this.title = 'Please wait'; - this.text = 'Es dauert noch einen kleinen Moment'; + this.title = ''; + this.text = ''; this.counter = 0; } @@ -36,8 +36,8 @@ app.factory('StatusService', function(){ StatusService.prototype.retainWaiting = function() { this.active = true; this.icon = 'loading'; - this.title = 'Please wait'; - this.text = 'Es dauert noch einen kleinen Moment'; + this.title = ''; + this.text = ''; this.counter++; } diff --git a/service/boardservice.php b/service/boardservice.php index 3fbe3b2bf..b2d9fd761 100644 --- a/service/boardservice.php +++ b/service/boardservice.php @@ -33,6 +33,7 @@ class BoardService { $this->labelMapper = $labelMapper; $this->aclMapper = $aclMapper; $this->logger = $logger; + $this->l10n = $l10n; } public function findAll($userId) { @@ -58,11 +59,16 @@ class BoardService { $new_board = $this->boardMapper->insert($board); // create new labels - $default_labels = ['31CC7C', '317CCC', 'FF7A66', 'F1DB50', '7C31CC', 'CC317C', '3A3B3D', 'CACBCD']; + $default_labels = [ + '31CC7C' => $this->l10n->t('Finished'), + '317CCC' => $this->l10n->t('To review'), + 'FF7A66' => $this->l10n->t('Action needed'), + 'F1DB50' => $this->l10n->t('Maybe')]; $labels = []; - foreach ($default_labels as $color) { + foreach ($default_labels as $color=>$title) { $label = new Label(); $label->setColor($color); + $label->setTitle($title); $label->setBoardId($new_board->getId()); $labels[] = $this->labelMapper->insert($label); } diff --git a/templates/part.board.mainView.php b/templates/part.board.mainView.php index d043fd617..1bfb62802 100644 --- a/templates/part.board.mainView.php +++ b/templates/part.board.mainView.php @@ -1,114 +1,129 @@
-
-
-

{{ statusservice.title }}

-

{{ statusservice.text }}

+
+
+

{{ statusservice.title }}

+

{{ statusservice.text }}

-
-

- {{ boardservice.data[id].title }} -
- - - - - -
-

-
-
- - - - - - -
-
-

{{ s.title }} -
- - -
-
- - -
-

-
    -
  • -
    -
    -

    {{ c.title }}

    -
      -
    • {{ label.title }} -
    • -
    - -
    - - -
    - +
    +

    + {{ boardservice.data[id].title }} +
    + + + - +
    +

    +
    +
    + + + +
    +
    +

    {{ s.title }} +
    + + +
    +
    + + +
    +

    + -
      -
    • -
      -
      -

      {{ card.title }}

      -
        -
      • {{ label.title }} -
      • -
      -
      - -
      -
    • -
    - -
    -
    -

    - -

    -
    -
    -
    -
    -
    -
    -

    - - -

    -
    -
    -
    +
    +
  • +
+ +
+
+

+ +

+
+
+
+
+
+
+

+ + +

+
+
+
-
+ - + diff --git a/templates/part.board.sidebarView.php b/templates/part.board.sidebarView.php index 739d8762e..9195420da 100644 --- a/templates/part.board.sidebarView.php +++ b/templates/part.board.sidebarView.php @@ -11,15 +11,14 @@
- + {{ $item.participant }} @@ -27,30 +26,38 @@ {{ sharee.participant }} - Dang! We couldn't find any choices... + t('Dang! We couldn\'t find any choices...')); ?> @@ -85,16 +92,9 @@
  • - Create a new Label + t('Create a new label')); ?>
  • -
    -

    -

    -

    -

    - -
    diff --git a/templates/part.boardlist.php b/templates/part.boardlist.php index 9993c3e53..6762cff87 100644 --- a/templates/part.boardlist.php +++ b/templates/part.boardlist.php @@ -1,51 +1,54 @@
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Board TitleMembersActions
    - - {{ b.title }} -
    - -
    - -
    - Sharing - Aktionen -
    - - Board erstellen - -
    - -
    -

    -
    - - -
    -
    -
    \ No newline at end of file + + + + + + + + + + + + + + + + + + + + +
    t('Board title')); ?>t('Members')); ?>
    + + {{ b.title }} +
    +
    +
    +
    +
    + + t('Create new board')); ?> + +
    + +
    +
    +
    +
    + +
    +
    + diff --git a/templates/part.card.php b/templates/part.card.php index 598dbb331..3f67ba758 100644 --- a/templates/part.card.php +++ b/templates/part.card.php @@ -1,78 +1,107 @@
    -
    -
    -

    {{ statusservice.title }}

    -

    {{ statusservice.text }}

    +
    +
    +

    {{ statusservice.title }}

    +

    {{ statusservice.text }}

    {{card=cardservice.getCurrent();""}}
    -   -

    -
    - - -
    -
    {{ cardservice.getCurrent().title }}
    -

    +   +

    +
    + + +
    +
    {{ + cardservice.getCurrent().title }} +
    +

    -
    -
    - Modified: {{ cardservice.getCurrent().lastModified*1000|date:'medium' }} - Created: {{ cardservice.getCurrent().createdAt*1000|date:'medium' }} - by {{ cardservice.getCurrent().owner }} -
    +
    +
    + t('Modified:')); ?> {{ cardservice.getCurrent().lastModified*1000|date:'medium' }} + t('Created:')); ?> {{ cardservice.getCurrent().createdAt*1000|date:'medium' }} + t('by')); ?> + {{ cardservice.getCurrent().owner }} +
    - - {{$item.title}} - - {{label.title}} - - +
    + + {{$item.title}} + + + {{label.title}} + + +
    -
    - - {{$item.title}} - - {{label.title}} - - -
    + -
    -

    Description

    - -
    Add a card description ...
    +
    +

    Description

    + +
    +
    +
    t('Add a card description ...')); ?>
    +
    -
    +
    - + \ No newline at end of file +//--> diff --git a/templates/part.navigation.php b/templates/part.navigation.php index 574ae5b2c..e465ea16e 100644 --- a/templates/part.navigation.php +++ b/templates/part.navigation.php @@ -1,21 +1,21 @@ diff --git a/templates/part.settings.php b/templates/part.settings.php index 5dd5dc869..2f9a861d3 100644 --- a/templates/part.settings.php +++ b/templates/part.settings.php @@ -5,11 +5,7 @@ >
    - We will provide some options here! + t('We will provide some options here!')); ?>
    - Show labels on cards
    - Show summary on cards
    - Show members on cards
    - Show archived cards