[pollen] branch develop updated (4e502e2 -> 77569dc)
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 4e502e2 remove debug code new 77569dc fixes #1088 remove invalid date message 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 77569dcb43361917efbf777e2cd52e2fe05a6e63 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Aug 28 17:38:05 2014 +0200 fixes #1088 remove invalid date message Summary of changes: pollen-ui-angular/src/main/webapp/i18n/en.js | 2 +- pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js | 10 +++++++--- pollen-ui-angular/src/main/webapp/js/directives.js | 7 ++++++- pollen-ui-angular/src/main/webapp/partials/poll-info.html | 4 ++-- 4 files changed, 16 insertions(+), 7 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 77569dcb43361917efbf777e2cd52e2fe05a6e63 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Aug 28 17:38:05 2014 +0200 fixes #1088 remove invalid date message --- pollen-ui-angular/src/main/webapp/i18n/en.js | 2 +- pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js | 10 +++++++--- pollen-ui-angular/src/main/webapp/js/directives.js | 7 ++++++- pollen-ui-angular/src/main/webapp/partials/poll-info.html | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index b879eb8..df98f17 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -152,7 +152,7 @@ var translateEN = { 'poll.config.value.visibility.anonymous' : 'Anonymous', 'poll.config.value.visibility.nobody' : 'Nobody', 'poll.info.closed' : 'Poll is closed', -'poll.info.timeoutVote' : 'Poll is finnish since {{time}}', +'poll.info.timeoutVote' : 'Poll is finish since {{time}}', 'poll.info.beginVote' : 'Start of voting {{time}}', 'poll.info.endVote' : 'End of voting {{time}}', 'poll.info.noEndDate' : 'No End Date is fixed', 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 05a4d25..dddaa28 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -362,9 +362,13 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr if (angular.isUndefined( $scope.data.poll)) { return ; } - var poll = $scope.data.poll; + var poll = angular.copy($scope.data.poll); var now = new Date(); + if (angular.isUndefined(poll.beginDate) || poll.beginDate === null) { + poll.beginDate = now; + } + $scope.timeOfEndVote = moment(poll.endDate).format('LL'); $scope.timeToBeginVote = moment(poll.beginDate).fromNow(); @@ -374,11 +378,11 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.timeToEndVote.label = moment(poll.endDate).fromNow(); $scope.timeToEndVote.type = getType($scope.timeToEndVote.value); - if (angular.isUndefined(poll.beginChoiceDate)) { + if (angular.isUndefined(poll.beginChoiceDate) || poll.beginChoiceDate === null) { poll.beginChoiceDate = poll.beginDate; } - if (angular.isUndefined(poll.endChoiceDate) && angular.isUndefined(poll.endDate)) { + if (angular.isUndefined(poll.endChoiceDate) || poll.endChoiceDate === null) { poll.endChoiceDate = poll.endDate; } diff --git a/pollen-ui-angular/src/main/webapp/js/directives.js b/pollen-ui-angular/src/main/webapp/js/directives.js index 5448c15..3504360 100644 --- a/pollen-ui-angular/src/main/webapp/js/directives.js +++ b/pollen-ui-angular/src/main/webapp/js/directives.js @@ -595,7 +595,7 @@ angular.module('pollenDirective', []) ///////////////////////////////////////////////////////// // DATE TIME PICKER DIRECTIVE // -// http://eonasdan.github.io/bootstrap-datetimepicker/ // +// http://dralagen.github.io/bootstrap-datetimepicker/ // ///////////////////////////////////////////////////////// .directive("datetimepicker", ["$timeout", "$route", "SessionStorage", function ($timeout, $route, SessionStorage) { return { @@ -688,6 +688,11 @@ angular.module('pollenDirective', []) } dp.hide(); } + + // set ngModel if not set + if (scope.ngModel == null) { + scope.ngModel = new Date(scope.dateTimePicker.data("DateTimePicker").getDate()).getTime(); + } }); scope.exit = function() { diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-info.html b/pollen-ui-angular/src/main/webapp/partials/poll-info.html index ba704fe..7b294eb 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-info.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-info.html @@ -23,7 +23,7 @@ <h4 class="text-warning">{{ 'poll.info.closed' | translate }}</h4> </div> -<div ng-if="!data.poll.isClosed && data.poll.endDate <= now" class="anim"> +<div ng-if="!data.poll.isClosed && data.poll.endDate && data.poll.endDate <= now" class="anim"> <h4 class="text-warning">{{ 'poll.info.timeoutVote' | translate:{'time':timeOfEndVote} }}</h4> </div> @@ -60,7 +60,7 @@ </p> </div> -<div ng-if="!data.poll.isClosed && data.poll.limitedVote" class="anim"> +<div ng-if="!data.poll.isClosed && data.poll.limitedVote && data.poll.maxChoiceNumber > 0" class="anim"> <h4>{{ 'poll.info.limitedChoice' | translate:{'nb':data.poll.maxChoiceNumber} }}</h4> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm