editable inline card titles

Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
Ryan Fletcher
2018-08-21 13:25:48 -04:00
committed by Julius Härtl
parent abb5290baa
commit 5fd8ff003b
2 changed files with 20 additions and 7 deletions

View File

@@ -125,7 +125,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
$scope.filterData('-lastModified', $scope.searchText); $scope.filterData('-lastModified', $scope.searchText);
} else { } else {
$scope.filterData('order', $scope.searchText); $scope.filterData('order', $scope.searchText);
} }
}; };
$scope.checkCanEdit = function () { $scope.checkCanEdit = function () {
return !BoardService.getCurrent().archived; return !BoardService.getCurrent().archived;
@@ -136,7 +136,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
if ($scope.stacks === undefined) { if ($scope.stacks === undefined) {
return; return;
} }
angular.copy(StackService.getData(), $scope.stacks); angular.copy(StackService.getData(), $scope.stacks);
$scope.stacks = $filter('orderBy')($scope.stacks, 'order'); $scope.stacks = $filter('orderBy')($scope.stacks, 'order');
angular.forEach($scope.stacks, function (value, key) { angular.forEach($scope.stacks, function (value, key) {
var cards = $filter('cardSearchFilter')(value.cards, text); var cards = $filter('cardSearchFilter')(value.cards, text);

View File

@@ -43,13 +43,16 @@
<div class="stack" ng-repeat="s in stacks" data-as-sortable-item <div class="stack" ng-repeat="s in stacks" data-as-sortable-item
data-columnindex="{{$index}}" id="column{{$index}}" data-columnindex="{{$index}}" id="column{{$index}}"
style=""> style="">
<h3 data-as-sortable-item-handle> <h3 data-as-sortable-item-handle>
<span class="editable-inline" ng-show="!s.status.editStack" ng-click="s.status.editStack=true">{{ s.title }}</span> <span class="editable-inline"
ng-show="!s.status.editStack"
ng-click="s.status.editStack=true">{{ s.title }}</span>
<form ng-if="s.status.editStack" ng-submit="stackservice.update(s); s.status.editStack=false"> <form ng-if="s.status.editStack" ng-submit="stackservice.update(s); s.status.editStack=false">
<input type="text" placeholder="<?php p($l->t('Add a new stack')); ?>" <input type="text" placeholder="<?php p($l->t('Add a new stack')); ?>"
ng-blur="stackservice.update(s); s.status.editStack=false" ng-model="s.title" ng-blur="stackservice.update(s); s.status.editStack=false" ng-model="s.title"
autofocus-on-insert required maxlength="100" /> autofocus-on-insert required maxlength="100" />
</form> </form>
<button class="icon-delete button-inline stack-actions" <button class="icon-delete button-inline stack-actions"
ng-if="!s.status.editStack" ng-if="!s.status.editStack"
ng-click="stackDelete(s)"></button> ng-click="stackDelete(s)"></button>
@@ -66,8 +69,18 @@
<p><?php p($l->t('Drop your files here to upload it to the card')); ?></p> <p><?php p($l->t('Drop your files here to upload it to the card')); ?></p>
</div> </div>
<div data-as-sortable-item-handle> <div data-as-sortable-item-handle>
<div class="card-upper"> <div class="card-upper">
<h4>{{ cardservice.get(c.id).title }}</h4> <h4>
<span class="editable-inline"
ng-show="!c.status.editCard"
ng-click="c.status.editCard=true">{{cardservice.get(c.id).title}}</span>
<form ng-if="c.status.editCard" ng-submit="cardservice.update(c); c.status.editCard=false">
<input type="text" placeholder="<?php p($l->t('Add a new card')); ?>"
ng-blue="cardservice.update(c); c.status.editCard=false" ng-model="c.title"
autofocus-on-insert required maxlength="100" />
</form>
</h4>
<ul class="labels"> <ul class="labels">
<li ng-repeat="label in cardservice.get(c.id).labels" <li ng-repeat="label in cardservice.get(c.id).labels"
ng-style="labelStyle(label.color)" title="{{ label.title }}"> ng-style="labelStyle(label.color)" title="{{ label.title }}">