This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.forge.codelutin.com/coselmar.git commit e496b6125047a37c3a62ee573740ab434ae528ba Author: Yannick Martel <martel@©odelutin.com> Date: Tue Feb 16 17:44:39 2016 +0100 refs-90 #7974 Add words cloud on project page --- coselmar-ui/src/main/webapp/i18n/en.js | 1 + coselmar-ui/src/main/webapp/i18n/fr.js | 1 + coselmar-ui/src/main/webapp/js/coselmar-controllers.js | 14 ++++++++++++++ .../src/main/webapp/js/coselmar-questions-services.js | 8 ++++++++ .../src/main/webapp/views/questions/viewquestion.html | 9 +++++++++ 5 files changed, 33 insertions(+) diff --git a/coselmar-ui/src/main/webapp/i18n/en.js b/coselmar-ui/src/main/webapp/i18n/en.js index 1b4f6e3..0d6afcc 100644 --- a/coselmar-ui/src/main/webapp/i18n/en.js +++ b/coselmar-ui/src/main/webapp/i18n/en.js @@ -357,6 +357,7 @@ var translateEN = { </p>", "home.lastProjects" : "Last projects", "home.wordCloud" : "Most used words in the platform", +"project.wordCloud" : "Most used words on the project", "error.message.authentication.title" : "Error with authentication", "error.message.authentication.body" : "Error with authentication, please try to log again.", diff --git a/coselmar-ui/src/main/webapp/i18n/fr.js b/coselmar-ui/src/main/webapp/i18n/fr.js index 4be7333..88f8f0f 100644 --- a/coselmar-ui/src/main/webapp/i18n/fr.js +++ b/coselmar-ui/src/main/webapp/i18n/fr.js @@ -359,6 +359,7 @@ var translateFR = { </p>", "home.lastProjects" : "Derniers projets", "home.wordCloud" : "Mots les plus courants sur la plateforme", +"project.wordCloud" : "Mots les plus courants autour du projet", "error.message.authentication.title" : "Échec d'authentification", "error.message.authentication.body" : "Une erreur avec l'authentification est survenue, veuillez vous reconnecter svp.", diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index b77ebf4..567d35d 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -1239,6 +1239,9 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam 'clients' : [], 'relatedDocuments': [], 'newRelatedDocuments' : [], 'links' : []}; $scope.existing = {'types' : [], 'themes' : []}; + $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 = []; // Preload exiting types and themes questionsService.findAllTypes(function(results) { @@ -1376,6 +1379,17 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam }, errorService.defaultFailOnCall, function() { $scope.$emit('dataLoaded'); }); + + + questionsService.getTopWords($routeParams.questionId, function(result) { + $scope.topWords = result.data; + for (var i=0; i < $scope.topWords.length; i++) { + $scope.topWords[i].link = "#/referential?onDocuments&onQuestions&keywords=" + $scope.topWords[i].text; + } + }, function(fail) { + $scope.topWords = []; + }); + }; //Deletion diff --git a/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js b/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js index f0d0de1..e3f0613 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-questions-services.js @@ -176,4 +176,12 @@ function Question(resource, http, config){ questionResource.query().$promise.then(successFunction); }; + this.getTopWords = function(questionId, successFunction, failFunction) { + + var topWordsUrl = baseURL + "/" + questionId + "/topwords"; + + http.get(topWordsUrl).then(successFunction, failFunction); + + }; + }; \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/questions/viewquestion.html b/coselmar-ui/src/main/webapp/views/questions/viewquestion.html index cddf909..81f1c4b 100644 --- a/coselmar-ui/src/main/webapp/views/questions/viewquestion.html +++ b/coselmar-ui/src/main/webapp/views/questions/viewquestion.html @@ -145,6 +145,15 @@ <div class="form-group col-md-4 aside"> <div> + <!-- FIXME Leo #CSS --> + <dl class="cloud"> + <dt class="title">{{ "project.wordCloud" | translate }}</dt> + <dd> + <jqcloud words="topWords" width="350" height="150" + colors="{{cloudColors}}" + steps="21" font-size="{from:0.09, to:0.04}"></jqcloud> + </dd> + </dl> <dl> <dt>{{ 'question.metadata.privacy' | translate }}</dt> <dd>{{question.privacy | lowercase}}</dd> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.