Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit board in board list view #198

Merged
merged 5 commits into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ button.button-inline:hover {
background-color: #f0f0f0;
}

.icon-close {
#app-sidebar .icon-close {
position: absolute;
top: 5px;
right: 5px;
Expand Down Expand Up @@ -685,7 +685,6 @@ button.button-inline:hover {
min-width: 240px;
height: 34px;
display: flex;
margin: 3px 3px 3px 0;
}

.colorselect .color {
Expand Down Expand Up @@ -740,6 +739,7 @@ button.button-inline:hover {
position: relative;
cursor: pointer;
display: block;
margin: 2px 0px;
}

.popovermenu ul {
Expand All @@ -755,7 +755,7 @@ button.button-inline:hover {
#boardlist span.icon {
width: 30px;
height: 30px;
display: inline-block;
margin: 2px 0px;
}

.cell-board-bullet {
Expand Down Expand Up @@ -811,6 +811,15 @@ button.button-inline:hover {
margin-top: 5px;
}

#boardlist .board-edit-controls {
float: right;
display: flex;
}

#boardlist input {
margin: 0px;
}

/**
* Board details
*/
Expand Down
12 changes: 12 additions & 0 deletions js/controller/ListController.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ
$scope.colors = ['0082c9', '00c9c6','00c906', 'c92b00', 'F1DB50', '7C31CC', '3A3B3D', 'CACBCD'];
$scope.boardservice = BoardService;
$scope.newBoard.color = $scope.colors[0];
$scope.updatingBoard = null;

// FIXME: not nice, but we want to load this only once
if($element.attr('id') === 'app-navigation') {
Expand Down Expand Up @@ -100,7 +101,18 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ
$scope.boardUpdate = function(board) {
BoardService.update(board).then(function(data) {
$scope.filterData();
board.status.edit = false;
});
};

$scope.boardUpdateBegin = function(board) {
$scope.updatingBoard = board;
};

$scope.boardUpdateReset = function(board) {
board.title = $scope.updatingBoard.title;
board.color = $scope.updatingBoard.color;
$scope.filterData();
board.status.edit = false;
};

Expand Down
3 changes: 1 addition & 2 deletions js/service/ApiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ app.factory('ApiService', function($http, $q){
} else {
Object.keys(entity).forEach(function (key) {
element[key] = entity[key];
if(element[key]!==null)
element[key].status = {};
});
element.status = {};
}
};
ApiService.prototype.remove = function(id) {
Expand Down
30 changes: 26 additions & 4 deletions templates/part.boardlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@
<span class="board-bullet"
style="background-color:#{{b.color}};"> </span>
</td>
<td ng-click="gotoBoard(b)">{{ b.title }}</a></td>
<td>
<div ng-click="gotoBoard(b)" ng-show="!b.status.edit">{{ b.title }}</div>
<div class="app-navigation-entry-edit" ng-show="b.status.edit">
<form ng-disabled="isAddingList" class="ng-pristine ng-valid" ng-submit="boardUpdate(b)">
<input id="newTitle" class="edit ng-valid ng-empty" type="text" autofocus-on-insert ng-model="b.title" maxlength="100">
<div class="colorselect">
<div class="color" ng-repeat="c in colors" style="background-color:#{{ c }};" ng-click="b.color=c" ng-class="{'selected': (c == b.color) }"><br /></div>
</div>
</form>
</div>
</td>
<td>
<div id="assigned-users">
<div class="avatardiv" avatar displayname="{{ b.owner.uid }}" title="{{ b.owner.displayname }}"></div>
Expand All @@ -32,10 +42,14 @@
</td>
<td>
<div class="hint"></div>
<div class="app-popover-menu-utils" ng-if="b.deletedAt == 0">
<div class="app-popover-menu-utils" ng-if="b.deletedAt == 0" ng-show="!b.status.edit">
<button class="icon icon-more button-inline" title="<?php p($l->t('More actions')); ?>"></button>
<div class="popovermenu bubble hidden">
<ul>
<li ng-click="boardUpdateBegin(b); b.status.edit = true">
<a class="menuitem"><span class="icon-rename"></span> <?php p($l->t('Edit board')); ?>
</a>
</li>
<li ng-if="boardservice.canManage(b) && !b.archived" ng-click="boardArchive(b)">
<a class="menuitem"><span class="icon-archive"></span> <?php p($l->t('Archive board')); ?>
</a>
Expand All @@ -55,6 +69,10 @@
</ul>
</div>
</div>
<div class="board-edit-controls" ng-show="b.status.edit">
<span class="icon icon-checkmark" ng-click="boardUpdate(b)"></span>
<span class="icon icon-close" ng-click="boardUpdateReset(b)"></span>
</div>
<div class="app-popover-menu-utils" ng-if="b.deletedAt > 0">
<button class="icon icon-history button-inline" ng-click="boardDeleteUndo(b)" title="Undo board deletion - Otherwise the board will be deleted during the next cronjob run."></button>
</div>
Expand Down Expand Up @@ -84,11 +102,15 @@ class="ng-pristine ng-valid" ng-submit="boardCreate()">
ng-click="selectColor(c)"
ng-class="{'selected': (c == newBoard.color), 'dark': (newBoard.color | textColorFilter) === '#ffffff' }"></div>
</div>
<input type="submit" value="" class="icon-checkmark svg" />
</form>
</td>
<td></td>
<td></td>
<td>
<div class="board-edit-controls">
<span class="icon icon-checkmark" ng-click="boardCreate()"></span>
<span class="icon icon-close" ng-click="status.addBoard=!status.addBoard"></span>
</div>
</td>
</tr>
</tbody>
</table>
Expand Down