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 d1602f78e6f6db24f568c1ff1c285200628e27e8 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Feb 17 15:26:02 2016 +0100 refs-40 #8004 try new way to input project themes --- coselmar-ui/src/main/webapp/css/coselmar.css | 11 ++++++++ .../src/main/webapp/js/coselmar-controllers.js | 10 +++++++ .../main/webapp/views/questions/editquestion.html | 32 ++++++++++++++++------ 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/coselmar-ui/src/main/webapp/css/coselmar.css b/coselmar-ui/src/main/webapp/css/coselmar.css index 34deb6a..ae0dc24 100644 --- a/coselmar-ui/src/main/webapp/css/coselmar.css +++ b/coselmar-ui/src/main/webapp/css/coselmar.css @@ -432,6 +432,17 @@ dl > dd { .tag-input input[type="text"]:focus { box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6) inset; } +/*FIXME #CSS Leo pour l'utilisation d'ui-select */ +.tag-input .input-zone { + border: 0; + display: inline-block; + width: auto; + background: transparent; + box-shadow: none; +} +.tag-input .input-zone:focus { + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6) inset; +} .tag-input .tag-input-add { display: inline; diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 567d35d..cfff85e 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -1242,6 +1242,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam $scope.topWords = [{text:"coselmar", weight: 10}, {text: "Ifremer", weight: 5}]; //FIXME Leo #CSS si tu veux trouver de belles couleurs pour le nuage, c'est là :) $scope.cloudColors = []; + $scope.toAddTheme = {}; // Preload exiting types and themes questionsService.findAllTypes(function(results) { @@ -1544,6 +1545,14 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam } }; + $scope.getExistingThemes = function(search) { + var newThemes = $scope.existing.themes.slice(); + if (search && newThemes.indexOf(search) === -1) { + newThemes.unshift(search); + } + return newThemes; + } + $scope.addTheme = function(themeList) { if (!$scope.question.themes) { $scope.question.themes = []; @@ -1558,6 +1567,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam } } $scope.keywordsError = false; + $scope.toAddTheme = {};// reset field }; $scope.removeTheme = function(theme) { diff --git a/coselmar-ui/src/main/webapp/views/questions/editquestion.html b/coselmar-ui/src/main/webapp/views/questions/editquestion.html index f89b1fa..7ff0d4b 100644 --- a/coselmar-ui/src/main/webapp/views/questions/editquestion.html +++ b/coselmar-ui/src/main/webapp/views/questions/editquestion.html @@ -135,15 +135,31 @@ </button> </span> - <input type="text" class="form-control" name="themes" - placeholder="{{ 'placeholder.project.addTag' | translate }}" - data-ng-model="toAddTheme" list="existingThemes" /> - <button type="button" class="btn btn-primary tag-input-add" value="add" ng-click="addTheme(toAddTheme); toAddTheme=''"><span class="fa fa-plus"></span></button> - - <datalist id="existingThemes"> - <option data-ng-repeat="theme in existing.themes" value="{{theme}}"> - </datalist> + <!--<input type="text" class="form-control" name="themes"--> + <!--placeholder="{{ 'placeholder.project.addTag' | translate }}"--> + <!--data-ng-model="toAddTheme" list="existingThemes" />--> + <!--FIXME #CSS Leo--> + <span class="input-zone"> + <ui-select ng-model="toAddTheme.selected" + theme="bootstrap" reset-search-input="true" ng-change="addTheme(toAddTheme.selected)"> + + <ui-select-match placeholder="{{ 'placeholder.project.addTag' | translate }}"> + {{$select.selected}} + </ui-select-match> + + <ui-select-choices repeat="theme in getExistingThemes($select.search) | filter : $select.search" > + {{theme}} + </ui-select-choices> + </ui-select> + </span> + + <!--<button type="button" class="btn btn-primary tag-input-add" value="add" ng-click="addTheme(toAddTheme); toAddTheme=''"><span class="fa fa-plus"></span></button>--> + + <!--<datalist id="existingThemes">--> + <!--<option data-ng-repeat="theme in existing.themes" value="{{theme}}">--> + <!--</datalist>--> </div> + {{toAddTheme.selected}} <p ng-show="(question.themes.length < 1 && !questionForm.themes.$pristine) || themesError == true" class="help-block">{{ 'question.message.requiredThemes' | translate }}</p> </div> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.