branch feature/8004-new-way-input-themes-keywords updated (d1602f7 -> 2c65895)
This is an automated email from the git hooks/post-receive script. New change to branch feature/8004-new-way-input-themes-keywords in repository coselmar. See http://git.forge.codelutin.com/coselmar.git from d1602f7 refs-40 #8004 try new way to input project themes new 2c65895 refs-80 #8004 try new way to input document keywords The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 2c658957b252fb361275aada410d39f402e76151 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Feb 17 16:39:00 2016 +0100 refs-80 #8004 try new way to input document keywords Summary of changes: .../src/main/webapp/js/coselmar-controllers.js | 20 ++++++++++++++ .../main/webapp/views/documents/editDocument.html | 32 ++++++++++++++++------ .../main/webapp/views/documents/newdocument.html | 24 ++++++++++++---- 3 files changed, 62 insertions(+), 14 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/8004-new-way-input-themes-keywords in repository coselmar. See http://git.forge.codelutin.com/coselmar.git commit 2c658957b252fb361275aada410d39f402e76151 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Feb 17 16:39:00 2016 +0100 refs-80 #8004 try new way to input document keywords --- .../src/main/webapp/js/coselmar-controllers.js | 20 ++++++++++++++ .../main/webapp/views/documents/editDocument.html | 32 ++++++++++++++++------ .../main/webapp/views/documents/newdocument.html | 24 ++++++++++++---- 3 files changed, 62 insertions(+), 14 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index cfff85e..9e6a649 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -313,6 +313,7 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'notif $scope.upload = {}; $scope.existing = {'types' : [], 'keywords' : []}; $scope.users = []; + $scope.toAddKeywords = {}; documentService.findAllTypes(function(results) { $scope.existing.types = results; @@ -401,6 +402,14 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'notif $location.path('/documents'); } + $scope.getExistingKeywords = function(search) { + var newKeywords = $scope.existing.keywords.slice(); + if (search && newKeywords.indexOf(search) === -1) { + newKeywords.unshift(search); + } + return newKeywords; + } + $scope.addKeyword = function(keywordList) { if (keywordList) { var keywords = keywordList.split( /,\s*/ ); @@ -412,6 +421,7 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'notif } } $scope.keywordsError = false; + $scope.toAddKeywords = {};// reset field }; $scope.removeKeyword = function(keyword) { @@ -472,6 +482,7 @@ coselmarControllers.controller("DocumentViewCtrl", $scope.upload = {}; $scope.users = []; $scope.hasErrors = false; + $scope.toAddKeywords = {}; $scope.editSession = $routeParams.edit ? $routeParams.edit : false; @@ -600,6 +611,14 @@ coselmarControllers.controller("DocumentViewCtrl", $location.search(""); } + $scope.getExistingKeywords = function(search) { + var newKeywords = $scope.existing.keywords.slice(); + if (search && newKeywords.indexOf(search) === -1) { + newKeywords.unshift(search); + } + return newKeywords; + } + $scope.addKeyword = function(keywordList) { if (keywordList) { var keywords = keywordList.split( /,\s*/ ); @@ -611,6 +630,7 @@ coselmarControllers.controller("DocumentViewCtrl", } } $scope.keywordsError = false; + $scope.toAddKeywords = {};// reset field }; $scope.removeKeyword = function(keyword) { diff --git a/coselmar-ui/src/main/webapp/views/documents/editDocument.html b/coselmar-ui/src/main/webapp/views/documents/editDocument.html index 85e57c1..3328d0f 100644 --- a/coselmar-ui/src/main/webapp/views/documents/editDocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/editDocument.html @@ -200,15 +200,29 @@ × </button> </span> - <input type="text" class="form-control" name="keywords" - placeholder="{{ 'placeholder.addKeyword' | translate }}" - ng-model="toAddKeyword" list="existingKeywords" /> - <button type="button" class="btn btn-primary tag-input-add" value="{{ 'common.button.add' | translate}}" - ng-click="addKeyword(toAddKeyword); toAddKeyword=''"><span class="fa fa-plus"></span></button> - - <datalist id="existingKeywords"> - <option data-ng-repeat="keyword in existing.keywords" value="{{keyword}}"> - </datalist> + <!--<input type="text" class="form-control" name="keywords"--> + <!--placeholder="{{ 'placeholder.addKeyword' | translate }}"--> + <!--ng-model="toAddKeyword" list="existingKeywords" />--> + <!--FIXME #CSS Leo--> + <span class="input-zone"> + <ui-select ng-model="toAddKeywords.selected" + theme="bootstrap" reset-search-input="true" ng-change="addKeyword(toAddKeywords.selected)"> + + <ui-select-match placeholder="{{ 'placeholder.addKeyword' | translate }}"> + {{$select.selected}} + </ui-select-match> + + <ui-select-choices repeat="keyword in getExistingKeywords($select.search) | filter : $select.search" > + {{keyword}} + </ui-select-choices> + </ui-select> + </span> + <!--<button type="button" class="btn btn-primary tag-input-add" value="{{ 'common.button.add' | translate}}"--> + <!--ng-click="addKeyword(toAddKeyword); toAddKeyword=''"><span class="fa fa-plus"></span></button>--> + + <!--<datalist id="existingKeywords">--> + <!--<option data-ng-repeat="keyword in existing.keywords" value="{{keyword}}">--> + <!--</datalist>--> </div> <p ng-show="(document.keywords.length < 1 && !documentForm.keywords.$pristine) || keywordsError" class="help-block">{{ 'document.message.requiredKeywords' | translate }}</p> diff --git a/coselmar-ui/src/main/webapp/views/documents/newdocument.html b/coselmar-ui/src/main/webapp/views/documents/newdocument.html index e10f668..aefbd65 100644 --- a/coselmar-ui/src/main/webapp/views/documents/newdocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/newdocument.html @@ -193,11 +193,25 @@ </button> </span> - <input type="text" class="form-control" name="keywords" - placeholder="{{ 'placeholder.addKeyword' | translate }}" - ng-model="toAddKeyword" list="existingKeywords" /> - <button type="button" class="btn btn-primary tag-input-add" - ng-click="addKeyword(toAddKeyword); toAddKeyword='';"><span class="fa fa-plus"></span></button> + <!--<input type="text" class="form-control" name="keywords"--> + <!--placeholder="{{ 'placeholder.addKeyword' | translate }}"--> + <!--ng-model="toAddKeyword" list="existingKeywords" />--> + <!--FIXME #CSS Leo--> + <span class="input-zone"> + <ui-select ng-model="toAddKeywords.selected" + theme="bootstrap" reset-search-input="true" ng-change="addKeyword(toAddKeywords.selected)"> + + <ui-select-match placeholder="{{ 'placeholder.addKeyword' | translate }}"> + {{$select.selected}} + </ui-select-match> + + <ui-select-choices repeat="keyword in getExistingKeywords($select.search) | filter : $select.search" > + {{keyword}} + </ui-select-choices> + </ui-select> + </span> + <!--<button type="button" class="btn btn-primary tag-input-add"--> + <!--ng-click="addKeyword(toAddKeyword); toAddKeyword='';"><span class="fa fa-plus"></span></button>--> <datalist id="existingKeywords"> <option data-ng-repeat="keyword in existing.keywords" value="{{keyword}}"> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm