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 e39572fc5a484daedeadeb00cc0a90f0853d568a 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 | 16 +++++++++-- .../main/webapp/views/questions/editquestion.html | 32 ++++++++++++++++------ 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/coselmar-ui/src/main/webapp/css/coselmar.css b/coselmar-ui/src/main/webapp/css/coselmar.css index 2859437..df35e09 100644 --- a/coselmar-ui/src/main/webapp/css/coselmar.css +++ b/coselmar-ui/src/main/webapp/css/coselmar.css @@ -439,6 +439,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 fa89666..39eeb3f 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -1257,7 +1257,10 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam 'links' : []}; $scope.existing = {'types' : [], 'themes' : []}; $scope.topWords = [{text:"coselmar", weight: 10}, {text: "Ifremer", weight: 5}]; - $scope.cloudColors = ["#2f8389", "#349198", "#39A0A8", "#3eaeb6", "#48b8c0"]; + //$scope.cloudColors = ["#2f8389", "#349198", "#39A0A8", "#3eaeb6", "#48b8c0"]; + //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) { @@ -1559,6 +1562,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 = []; @@ -1573,6 +1584,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam } } $scope.keywordsError = false; + $scope.toAddTheme = {};// reset field }; $scope.removeTheme = function(theme) { @@ -2264,4 +2276,4 @@ coselmarControllers.directive('paginationTool', function() { // restrict: 'E', templateUrl: 'views/paginationTemplate.html' }; -}); \ No newline at end of file +}); diff --git a/coselmar-ui/src/main/webapp/views/questions/editquestion.html b/coselmar-ui/src/main/webapp/views/questions/editquestion.html index 4f0a779..bc0bf20 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>.