Author: garandel Date: 2014-05-06 10:56:15 +0200 (Tue, 06 May 2014) New Revision: 3915 Url: http://forge.chorem.org/projects/pollen/repository/revisions/3915 Log: update settings popup, and date popup Modified: trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js trunk/pollen-ui-angular/src/main/webapp/partials/big-poll.html trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html Modified: trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js 2014-05-05 15:39:10 UTC (rev 3914) +++ trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js 2014-05-06 08:56:15 UTC (rev 3915) @@ -172,7 +172,30 @@ var PollPopupSettingsCtrl = function ($scope, $filter, $modalInstance, poll) { $scope.poll = poll; + $scope.toDay = new Date(); + $scope.$watch('poll.beginDate', function() { + if (poll.beginChoiceDate) { + if (poll.beginChoiceDate < poll.beginDate) { + poll.beginChoiceDate = poll.beginDate; + } + } + else { + poll.beginChoiceDate = poll.beginDate; + } + }); + + $scope.$watch('poll.endDate', function() { + if (poll.endChoiceDate) { + if (poll.endChoiceDate > poll.endDate) { + poll.endChoiceDate = poll.endDate; + } + } + else { + poll.endChoiceDate = poll.endDate; + } + }); + if (!angular.isDefined($scope.poll.continuousResults)) { $scope.poll.continuousResults = false; } @@ -196,7 +219,6 @@ return 'Non'; } } - } Modified: trunk/pollen-ui-angular/src/main/webapp/partials/big-poll.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/partials/big-poll.html 2014-05-05 15:39:10 UTC (rev 3914) +++ trunk/pollen-ui-angular/src/main/webapp/partials/big-poll.html 2014-05-06 08:56:15 UTC (rev 3915) @@ -41,7 +41,12 @@ {{choice.date | date:'dd/MM/yyyy'}} </h3> <h3 ng-show="showEdit || isOpen"> - <input type="text" ng-model="choice.date" datepicker-popup="dd/MM/yyyy" is-open="isOpen" focus-me="showEdit" ng-exit="showEdit = false" required/> + <input type="text" ng-model="choice.date" + datepicker-popup="dd/MM/yyyy" + is-open="isOpen" + focus-me="showEdit" + ng-exit="showEdit = false" + ng-click="isOpen = true" required/> </h3> </div> </div> Modified: trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html 2014-05-05 15:39:10 UTC (rev 3914) +++ trunk/pollen-ui-angular/src/main/webapp/partials/inline-poll.html 2014-05-06 08:56:15 UTC (rev 3915) @@ -36,7 +36,7 @@ <div ng-if="choice.choiceType == 'DATE'" edit-me="showEdit" > <div ng-hide="!globalVariables.voted && showEdit || isOpen" class="fixe-input" title="{{choice.description}}">{{choice.date | date:'dd/MM/yyyy'}} <input type="button" class="btn btn-default" ng-if="!globalVariables.voted && globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice)" value="..."/></div> <div ng-show="!globalVariables.voted && showEdit || isOpen" > - <input type="text" class="form-control" ng-model="choice.date" focus-me="showEdit" datepicker-popup="dd/MM/yyyy" is-open="isOpen" ng-exit="showEdit = false" required/> + <input type="text" class="form-control" ng-model="choice.date" focus-me="showEdit" datepicker-popup="dd/MM/yyyy" is-open="isOpen" ng-exit="showEdit = false" ng-click="isOpen = true" required/> <input type="button" class="btn btn-default" data-toggle="modal" data-target="#popupAddChoice" ng-click="editChoice(choice)" value="..."/> </div> </div> Modified: trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html 2014-05-05 15:39:10 UTC (rev 3914) +++ trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html 2014-05-06 08:56:15 UTC (rev 3915) @@ -49,7 +49,7 @@ <div class="col-sm-6"> <div class="right-inner-addon "> <i class="glyphicon glyphicon-calendar glyphicon-input"></i> - <input id="popNameChoiceDate" class="form-control" datepicker-popup="dd/MM/yyyy" type="text" ng-model="choice.date" is-open="opened"/> + <input id="popNameChoiceDate" class="form-control" datepicker-popup="dd/MM/yyyy" type="text" ng-model="choice.date" is-open="opened" ng-click="opened = true"/> </div> </div> </div> Modified: trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html 2014-05-05 15:39:10 UTC (rev 3914) +++ trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html 2014-05-06 08:56:15 UTC (rev 3915) @@ -35,8 +35,11 @@ <div class="col-lg-8"> <input id="popBeginDate" class="form-control" type="text" datepicker-popup="dd/MM/yyyy" + min-date="toDay" + max-date="poll.endDate" ng-model="poll.beginDate" - is-open="beginDateOpened"/> + is-open="beginDateOpened" + ng-click="beginDateOpened = true" /> </div> </div> @@ -45,8 +48,10 @@ <div class="col-lg-8"> <input id="popEndDate" class="form-control" type="text" datepicker-popup="dd/MM/yyyy" + min-date="poll.beginDate" ng-model="poll.endDate" - is-open="endDateOpened"/> + is-open="endDateOpened" + ng-click="endDateOpened = true" /> </div> </div> @@ -80,20 +85,23 @@ <input class="form-control" type="text" id="popBeginChoiceDate" datepicker-popup="dd/MM/yyyy" min-date="poll.beginDate" - max-date="poll.endDate" + max-date="poll.endChoiceDate" ng-model="poll.beginChoiceDate" - is-open="beginChoiceDateOpened"/> + is-open="beginChoiceDateOpened" + ng-click="beginChoiceDateOpened = true" /> </div> </div> - <div class="form-group" ng-show="poll.choiceAddAllowed" for="popEndChoiceDate"> + <div class="form-group" ng-if="poll.choiceAddAllowed" for="popEndChoiceDate"> <label class="col-lg-4 control-label">Date de fin : </label> <div class="col-lg-8"> <input class="form-control" type="text" id="popEndChoiceDate" datepicker-popup="dd/MM/yyyy" - min-date="poll.beginDate" + min-date="poll.beginChoiceDate" max-date="poll.endDate" + ng-model="poll.endChoiceDate" - is-open="endChoiceDateOpened"/> + is-open="endChoiceDateOpened" + ng-click="endChoiceDateOpened = true" /> </div> </div> @@ -126,7 +134,7 @@ <button type="button" class="btn btn-success" ng-model="poll.voteCountingType" btn-radio="6">Vote alternatif</button> <button type="button" class="btn btn-success" ng-model="poll.voteCountingType" btn-radio="7">Coombs</button> </div> - <p>description type...</p> + <p>Description du types de vote</p> </div> </div> </div> @@ -140,7 +148,6 @@ <button type="button" class="btn btn-success" ng-model="poll.voteVisibility" btn-radio="'ANONYMOUS'">Anonyme</button> </div> </div> - </div> <div class="form-group"> <label class="col-lg-4 control-label">Autoriser les votes anonymes :</label>