[pollen] branch develop updated (0bb0135 -> 599e8f1)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen. See http://git.chorem.org/pollen.git from 0bb0135 delete callBack for popup choice new 2053750 show when the vote don't view a choice new 599e8f1 add a pool alert with alert.timeout == -1 The 2 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 599e8f12cf471f38e460ca85a6e74a05d8d3d550 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri Aug 1 18:23:01 2014 +0200 add a pool alert with alert.timeout == -1 commit 20537501b85125aa8bb72afa1e298bd1e3101c40 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri Aug 1 17:14:34 2014 +0200 show when the vote don't view a choice Summary of changes: pollen-ui-angular/src/main/webapp/i18n/en.js | 1 + pollen-ui-angular/src/main/webapp/i18n/fr.js | 1 + pollen-ui-angular/src/main/webapp/index.html | 2 +- .../src/main/webapp/js/controllers/alertCtrl.js | 24 +++++++-- .../src/main/webapp/js/controllers/pollCtrl.js | 13 +++++ pollen-ui-angular/src/main/webapp/less/style.less | 61 +++++++++------------- .../src/main/webapp/less/variables.less | 36 +++++++++++++ .../src/main/webapp/partials/alerts.html | 14 ++++- .../src/main/webapp/partials/inline-poll.html | 13 +++-- .../src/test/unit/alertControllersTest.js | 53 +++++++++++++++++-- 10 files changed, 166 insertions(+), 52 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 20537501b85125aa8bb72afa1e298bd1e3101c40 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri Aug 1 17:14:34 2014 +0200 show when the vote don't view a choice --- pollen-ui-angular/src/main/webapp/i18n/en.js | 1 + pollen-ui-angular/src/main/webapp/i18n/fr.js | 1 + .../src/main/webapp/js/controllers/pollCtrl.js | 13 +++++++++++++ pollen-ui-angular/src/main/webapp/partials/inline-poll.html | 13 +++++++++---- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index 63dd438..551e046 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -109,6 +109,7 @@ var translateEN = { 'poll.config.value.visibility.creator' : 'Creator', 'poll.config.value.visibility.anonymous' : 'Anonymous', 'poll.config.value.visibility.nobody' : 'Nobody', +'poll.info.vote.noViewChoice' : 'This choice does not exist in the vote', 'poll.error.noResource' : 'No resource has send', 'poll.error.listEmpty' : 'No poll find', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index c9dedc9..78c910d 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -109,6 +109,7 @@ var translateFR = { 'poll.config.value.visibility.creator' : 'Créateur', 'poll.config.value.visibility.anonymous' : 'Anonyme', 'poll.config.value.visibility.nobody' : 'Personne', +'poll.info.vote.noViewChoice' : 'Ce choix n\'existait pas lors du vote', 'poll.error.noResource' : 'Aucune ressource a envoyer', 'poll.error.listEmpty' : 'Aucun sondage trouvé', diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index 1c8e103..faa9b13 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -1169,6 +1169,9 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr }); PollVote.get({pollId:$routeParams.pollId, voteId:returnRequest.id, permission:returnRequest.permission}, function (newVote) { + angular.forEach(newVote.choice, function (choice) { + choice.voteValue = $scope.getVoteValue(choice.voteValue); + }) $scope.data.votants.push(newVote); }) @@ -1246,6 +1249,16 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr // edit vote PollVote.update({pollId:$routeParams.pollId}, sendVote, function (data) { vote.onEdit = false; + for (var i = 0; i < data.choice.length; i++) { + for (var j = 0; j < vote.choice.length; j++) { + if (vote.choice[i].choiceId == data.choice[i].choiceId) { + vote.choice[i].id = data.choice[i].id; + vote.choice[i].voteValue = $scope.getVoteValue(data.choice[i].voteValue); + + break; + } + } + } delete $scope.data.vote.restError; $rootScope.$broadcast('newSuccess', 'vote.added'); diff --git a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html index dc36e4b..b330c1b 100644 --- a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html @@ -106,11 +106,16 @@ voteFalse:(choice.voteValue == null || (choice.voteValue == false && data.voteCountingType.renderType == 'checkbox'))}"> <div ng-hide="vote.onEdit"> - <div ng-show="data.voteCountingType.renderType == 'checkbox'" > - <span class="glyphicon glyphicon-ok text-success" ng-show="choice.voteValue"></span> + <div ng-show="choice.id"> + <div ng-show="data.voteCountingType.renderType == 'checkbox'" > + <span class="glyphicon glyphicon-ok text-success" ng-show="choice.voteValue"></span> + </div> + <div ng-show="data.voteCountingType.renderType != 'checkbox'"> + {{choice.voteValue}} + </div> </div> - <div ng-show="data.voteCountingType.renderType != 'checkbox'"> - {{choice.voteValue}} + <div ng-hide="choice.id"> + <span class="glyphicon glyphicon-eye-close text-danger" tooltip="{{ 'poll.info.vote.noViewChoice' | translate }}"></span> </div> </div> <div ng-show="vote.onEdit"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 599e8f12cf471f38e460ca85a6e74a05d8d3d550 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri Aug 1 18:23:01 2014 +0200 add a pool alert with alert.timeout == -1 --- pollen-ui-angular/src/main/webapp/index.html | 2 +- .../src/main/webapp/js/controllers/alertCtrl.js | 24 +++++++-- pollen-ui-angular/src/main/webapp/less/style.less | 61 +++++++++------------- .../src/main/webapp/less/variables.less | 36 +++++++++++++ .../src/main/webapp/partials/alerts.html | 14 ++++- .../src/test/unit/alertControllersTest.js | 53 +++++++++++++++++-- 6 files changed, 142 insertions(+), 48 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/index.html b/pollen-ui-angular/src/main/webapp/index.html index 83c7714..956b387 100644 --- a/pollen-ui-angular/src/main/webapp/index.html +++ b/pollen-ui-angular/src/main/webapp/index.html @@ -170,7 +170,7 @@ </div> </nav> -<div ng-include="'partials/alerts.html'" class="pool-alert"></div> +<div ng-include="'partials/alerts.html'" ng-controller="printAlertCtrl"></div> <div ng-view class='container-fluid' id="content"></div> diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js index 2123092..6f81b28 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js @@ -29,6 +29,7 @@ angular.module('alertControllers', []) } $scope.data.alerts = []; + $scope.data.persistentAlerts = []; $scope.$on('newError', function (event, error, timeout) { var alert = {msg:error, type:'danger', glyphicon:'glyphicon-remove'}; @@ -69,7 +70,15 @@ angular.module('alertControllers', []) $scope.addAlert = function (alert, timeout) { var alertNotExist = true; - angular.forEach($scope.data.alerts, function (oneAlert, key) { + var poolAlert; + + if (angular.isDefined(timeout) && timeout >= 0) { + poolAlert = $scope.data.alerts; + } else { + poolAlert = $scope.data.persistentAlerts; + } + + angular.forEach(poolAlert, function (oneAlert, key) { if (angular.equals(oneAlert.msg, alert.msg) && angular.equals(oneAlert.type, alert.type)) { $timeout.cancel(oneAlert.timeoutPromise); alert = oneAlert; @@ -78,7 +87,7 @@ angular.module('alertControllers', []) }); if (alertNotExist) { - $scope.data.alerts.push(alert); + poolAlert.push(alert); } if (angular.isDefined(timeout) && timeout >= 0) { @@ -92,9 +101,16 @@ angular.module('alertControllers', []) } $scope.hideAlert = function (alert) { - var index = $scope.data.alerts.indexOf(alert); + var poolAlert; + if (angular.isDefined(alert.timeout) && alert.timeout >= 0) { + poolAlert = $scope.data.alerts; + } else { + poolAlert = $scope.data.persistentAlerts; + } + + var index = poolAlert.indexOf(alert); if (index >= 0) { - $scope.data.alerts.splice(index, 1); + poolAlert.splice(index, 1); } } diff --git a/pollen-ui-angular/src/main/webapp/less/style.less b/pollen-ui-angular/src/main/webapp/less/style.less index 1fbf93d..c1c3ae3 100644 --- a/pollen-ui-angular/src/main/webapp/less/style.less +++ b/pollen-ui-angular/src/main/webapp/less/style.less @@ -35,12 +35,11 @@ body { #pollenMenu { position:fixed; width:100%; - height:50px; + height:@height-pollen-menu; top:0px; left:0px; } #content { - padding-top:60px; .fade(); #poll-content .anim-fade { @@ -150,8 +149,8 @@ body { margin-left: @width-max; &.maxi-content-remove { - .transition(margin linear @short-time-transition); - } + .transition(margin linear @short-time-transition); + } &.maxi-content { margin-left: @width-min; @@ -163,11 +162,20 @@ body { } } + + + .pool-persistent-alert { + padding-top: @height-pollen-menu + 10px; + margin-left: @width-max + 10px; + margin-right:15px; + + .alert() + } } /* width < @responsive-large-width */ @media screen and (max-width: @responsive-large-width) { - @foot-height : 125px; + @foot-height : 100px + @height-footer; #poll-link { text-align:center; @@ -199,6 +207,14 @@ body { #poll-content { margin-bottom: @foot-height; } + + .pool-persistent-alert { + padding-top: @height-pollen-menu + 10px; + margin-left:15px; + margin-right:15px; + + .alert() + } } @@ -345,39 +361,12 @@ body { .pool-alert { position: fixed; - top:65px; - left:20%; + top:@height-pollen-menu + 10px; + right:15px; width:60%; - font-size:1.1em; - font-weight:bold; z-index: 100000; - .alert { - opacity:0.9; - - .transition(opacity @short-time-transition ease); - - &:hover { - opacity:1; - - .transition(opacity @short-time-transition ease); - } - - .glyphicon { - display:inline-block; - font-size:1.4em; - top:5px; - font-weight:bolder; - margin-right: 15px; - } - - .alert-message { - margin-right:20px; - margin-left: 30px; - margin-top: -12px; - - } - } + .alert(); } .danger { @@ -506,7 +495,7 @@ footer { right: 0; bottom: 0; left: 0; - height:20px; + height:@height-footer; width: 100%; background-color: #222; color: #999; diff --git a/pollen-ui-angular/src/main/webapp/less/variables.less b/pollen-ui-angular/src/main/webapp/less/variables.less index 07cf640..911be87 100644 --- a/pollen-ui-angular/src/main/webapp/less/variables.less +++ b/pollen-ui-angular/src/main/webapp/less/variables.less @@ -30,6 +30,9 @@ @danger-color : @brand-danger; @danger-hover-color : darken(@danger-color, 15%); +@height-pollen-menu : 50px; +@height-footer: 20px; + @responsive-large-width : 1024px; @responsive-min-width : 770px; @responsive-height: 600px; @@ -74,4 +77,37 @@ .fade() { .fade(@short-time-transition); +} + + +.alert() { + font-size:1.1em; + font-weight:bold; + + .alert { + opacity:0.9; + + .transition(opacity @short-time-transition ease); + + &:hover { + opacity:1; + + .transition(opacity @short-time-transition ease); + } + + .glyphicon { + display:inline-block; + font-size:1.4em; + top:5px; + font-weight:bolder; + margin-right: 15px; + } + + .alert-message { + margin-right:20px; + margin-left: 30px; + margin-top: -12px; + + } + } } \ No newline at end of file diff --git a/pollen-ui-angular/src/main/webapp/partials/alerts.html b/pollen-ui-angular/src/main/webapp/partials/alerts.html index f5aa327..0509336 100644 --- a/pollen-ui-angular/src/main/webapp/partials/alerts.html +++ b/pollen-ui-angular/src/main/webapp/partials/alerts.html @@ -1,7 +1,17 @@ -<div ng-controller="printAlertCtrl" > +<div class="pool-alert"> <alert ng-repeat="alert in data.alerts" type="{{alert.type}}" ng-mouseenter="hoverAlert(alert)" ng-mouseleave="leaveAlert(alert)" close="hideAlert(alert)"><span class="glyphicon" ng-class="alert.glyphicon"></span> <div class="alert-message" ng-bind-html="toHTML(alert.msg)"></div> </alert> -</div> \ No newline at end of file +</div> + + +<div class="pool-persistent-alert"> + <alert ng-repeat="alert in data.persistentAlerts" + type="{{alert.type}}" + ng-mouseenter="hoverAlert(alert)" + ng-mouseleave="leaveAlert(alert)" + close="hideAlert(alert)"><span class="glyphicon" ng-class="alert.glyphicon"></span> <div class="alert-message" ng-bind-html="toHTML(alert.msg)"></div> </alert> +</div> + diff --git a/pollen-ui-angular/src/test/unit/alertControllersTest.js b/pollen-ui-angular/src/test/unit/alertControllersTest.js index 91b760a..ade98dc 100644 --- a/pollen-ui-angular/src/test/unit/alertControllersTest.js +++ b/pollen-ui-angular/src/test/unit/alertControllersTest.js @@ -36,7 +36,7 @@ describe('Alert controller', function () { var nbAlert = $scope.data.alerts.length; var alert = {msg:'message alert', type:'type'}; - $scope.addAlert(alert, -1); + $scope.addAlert(alert, 1000); expect($scope.data.alerts.length).toEqual(nbAlert + 1); }); @@ -45,7 +45,7 @@ describe('Alert controller', function () { var nbAlert = $scope.data.alerts.length; var alert = {msg:'message alert', type:'type'}; - $scope.addAlert(alert, -1); + $scope.addAlert(alert, 1000); $scope.hideAlert(alert); expect($scope.data.alerts.length).toEqual(nbAlert); @@ -55,8 +55,8 @@ describe('Alert controller', function () { var nbAlert = $scope.data.alerts.length; var alert = {msg:'message alert', type:'type'}; - $scope.addAlert(alert, -1); - $scope.addAlert(alert, -1); + $scope.addAlert(alert, 1000); + $scope.addAlert(alert, 1000); expect($scope.data.alerts.length).toEqual(nbAlert + 1); }); @@ -74,5 +74,48 @@ describe('Alert controller', function () { // check now is hidden expect($scope.data.alerts.length).toEqual(nbAlert); - }); + }); + + it('should init alerts persistent array', function () { + expect($scope.data.persistentAlerts.length).toBeGreaterThan(-1); + }); + + it('should can\'t duplicate alert with different timeout', function () { + var nbAlert = $scope.data.alerts.length; + var alert = {msg:'message alert', type:'type'}; + + $scope.addAlert(alert, 1000); + $scope.addAlert(alert, 500); + + expect($scope.data.alerts.length).toEqual(nbAlert + 1); + }); + + it('should can add a persistent alert', function () { + var nbAlert = $scope.data.persistentAlerts.length; + var alert = {msg:'message alert', type:'type'}; + + $scope.addAlert(alert, -1); + + expect($scope.data.persistentAlerts.length).toEqual(nbAlert + 1); + }); + + it('should can delete a persistent alert', function () { + var nbAlert = $scope.data.persistentAlerts.length; + var alert = {msg:'message alert', type:'type'}; + + $scope.addAlert(alert, -1); + $scope.hideAlert(alert); + + expect($scope.data.persistentAlerts.length).toEqual(nbAlert); + }); + + it('should can\'t duplicate persistent alert ', function () { + var nbAlert = $scope.data.persistentAlerts.length; + var alert = {msg:'message alert', type:'type'}; + + $scope.addAlert(alert, -1); + $scope.addAlert(alert, -1); + + expect($scope.data.persistentAlerts.length).toEqual(nbAlert + 1); + }); }); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm