r3914 - in trunk/pollen-ui-angular/src/main/webapp: . js/controllers partials
Author: garandel Date: 2014-05-05 17:39:10 +0200 (Mon, 05 May 2014) New Revision: 3914 Url: http://forge.chorem.org/projects/pollen/repository/revisions/3914 Log: Add popup setting Added: trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html Modified: trunk/pollen-ui-angular/src/main/webapp/index.html trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js trunk/pollen-ui-angular/src/main/webapp/partials/poll.html Modified: trunk/pollen-ui-angular/src/main/webapp/index.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/index.html 2014-05-05 12:36:59 UTC (rev 3913) +++ trunk/pollen-ui-angular/src/main/webapp/index.html 2014-05-05 15:39:10 UTC (rev 3914) @@ -29,7 +29,7 @@ <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-route.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-resource.min.js"></script> - <script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.min.js"></script> + <script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.11.0/ui-bootstrap-tpls.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/restangular/1.4.0/restangular.min.js"></script> <script src="js/libs/ckeditor/ckeditor.js"></script> 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 12:36:59 UTC (rev 3913) +++ trunk/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js 2014-05-05 15:39:10 UTC (rev 3914) @@ -122,6 +122,18 @@ }); } + $scope.popupSettings = function () { + var modalInstance = $modal.open({ + templateUrl : 'partials/poll-popupSettings.html', + controller : PollPopupSettingsCtrl, + size : 'lg', + resolve : { poll: function () { + return $scope.poll; + } + } + }); + } + $scope.reset = function () { $scope.poll = initPoll(); $scope.voteChoice = $scope.poll.choice; @@ -158,8 +170,36 @@ } + var PollPopupSettingsCtrl = function ($scope, $filter, $modalInstance, poll) { + $scope.poll = poll; + if (!angular.isDefined($scope.poll.continuousResults)) { + $scope.poll.continuousResults = false; + } + if (!angular.isDefined($scope.poll.resultVisibility)) { + $scope.poll.resultVisibility = 'EVERYBODY'; + } + + if (!angular.isDefined($scope.poll.choiceAddAllowed)) { + $scope.poll.choiceAddAllowed = false; + } + + $scope.close = function () { + $modalInstance.dismiss(); + } + + $scope.printCheckbox= function (value) { + if (value) { + return 'Oui'; + } else { + return 'Non'; + } + } + + } + + }]) .controller('PollCreateCtrl', ['$scope', '$controller', 'Restangular', '$http', function ($scope, $controller, Restangular, $http) { Added: trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html (rev 0) +++ trunk/pollen-ui-angular/src/main/webapp/partials/poll-popupSettings.html 2014-05-05 15:39:10 UTC (rev 3914) @@ -0,0 +1,156 @@ +<!-- + #%L + Pollen :: UI (Angular) + %% + Copyright (C) 2009 - 2014 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> + + + +<form class="form-horizontal"> + <div class="modal-header"> + <h3 class="modal-title">Configuration</h3> + </div> + + <div class="modal-body"> + + <h4>Confiuration global</h4> + + <div class="form-group"> + <label class="col-lg-4 control-label" for="popBeginDate">Date de début : </label> + <div class="col-lg-8"> + <input id="popBeginDate" class="form-control" type="text" + datepicker-popup="dd/MM/yyyy" + ng-model="poll.beginDate" + is-open="beginDateOpened"/> + </div> + </div> + + <div class="form-group"> + <label class="col-lg-4 control-label" for="popEndDate">Date de fin : </label> + <div class="col-lg-8"> + <input id="popEndDate" class="form-control" type="text" + datepicker-popup="dd/MM/yyyy" + ng-model="poll.endDate" + is-open="endDateOpened"/> + </div> + </div> + + <div class="form-group"> + <label class="col-lg-4 control-label">Résultat : </label> + <div class="col-lg-8 btn-group"> + <button type="button" class="btn btn-success" ng-model="poll.resultVisibility" btn-radio="'EVERYBODY'">Public</button> + <button type="button" class="btn btn-success" ng-model="poll.resultVisibility" btn-radio="'VOTER'">Participants</button> + <button type="button" class="btn btn-success" ng-model="poll.resultVisibility" btn-radio="'CREATOR'">Créateur</button> + </div> + </div> + + <div class="form-group"> + <label class="col-lg-4 control-label" for="popContinuousResults">Résultat continue : </label> + <div class="col-lg-8"> + <button class="btn btn-default" id="popContinuousResults" ng-model="poll.continuousResults" btn-checkbox>{{printCheckbox(poll.continuousResults)}}</button> + </div> + </div> + + <h4>Configuration des Choix</h4> + + <div class="form-group"> + <label class="col-lg-4 control-label" for="popChoiceAddAllowed">Ajout de choix par les votants :</label> + <div class="col-lg-8"> + <button class="btn btn-default" id="popChoiceAddAllowed" ng-model="poll.choiceAddAllowed" btn-checkbox >{{printCheckbox(poll.choiceAddAllowed)}}</button> + </div> + </div> + <div class="form-group" ng-show="poll.choiceAddAllowed"> + <label class="col-lg-4 control-label" for="popBeginChoiceDate">Date de début : </label> + <div class="col-lg-8"> + <input class="form-control" type="text" id="popBeginChoiceDate" + datepicker-popup="dd/MM/yyyy" + min-date="poll.beginDate" + max-date="poll.endDate" + ng-model="poll.beginChoiceDate" + is-open="beginChoiceDateOpened"/> + </div> + </div> + <div class="form-group" ng-show="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" + max-date="poll.endDate" + ng-model="poll.endChoiceDate" + is-open="endChoiceDateOpened"/> + </div> + </div> + + <div class="form-group"> + <label class="col-lg-4 control-label" for="popLimitedVote">Limiter les votes :</label> + <div class="col-lg-8"> + <button class="btn btn-default" id="popLimitedVote" ng-model="poll.limitedVote" btn-checkbox >{{printCheckbox(poll.limitedVote)}}</button> + </div> + </div> + <div class="form-group" ng-show="poll.limitedVote"> + <label class="col-lg-4 control-label" for="popMaxChoiceNumber">Nombre de vote :</label> + <div class="col-lg-6"> + <input type="text" class="form-control" id="popMaxChoiceNumber" ng-model="poll.maxChoiceNumber"/> + </div> + </div> + + <h4> Configuration des Réponses </h4> + + <div class="form-group"> + <label class="col-lg-4 control-label">Type : </label> + <div class="col-lg-8"> + <div class="btn-group"> + <button type="button" class="btn btn-success" ng-model="poll.voteCountingType" btn-radio="1">Normal</button> + <button type="button" class="btn btn-success" ng-model="poll.voteCountingType" btn-radio="2">Pourcentage</button> + <button type="button" class="btn btn-success" ng-model="poll.voteCountingType" btn-radio="3">Condorcet</button> + <button type="button" class="btn btn-success" ng-model="poll.voteCountingType" btn-radio="4">Nombre</button> + </div> + <div class="btn-group"> + <button type="button" class="btn btn-success" ng-model="poll.voteCountingType" btn-radio="5">Borda</button> + <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> + </div> + </div> + </div> + + <div class="form-group"> + <label class="col-lg-4 control-label">Visibilité : </label> + <div class="col-lg-8 btn-group"> + <button type="button" class="btn btn-success" ng-model="poll.voteVisibility" btn-radio="'EVERYBODY'">Public</button> + <button type="button" class="btn btn-success" ng-model="poll.voteVisibility" btn-radio="'VOTER'">Participants</button> + <button type="button" class="btn btn-success" ng-model="poll.voteVisibility" btn-radio="'CREATOR'">Créateur</button> + <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> + <div class="col-lg-8"> + <button class="btn btn-default" ng-model="poll.anonymousVoteAllowed" btn-checkbox >{{printCheckbox(poll.anonymousVoteAllowed)}}</button> + </div> + </div> + + + <div class="modal-footer"> + <button type="button" class="btn btn-primary" ng-click="close()">close</button> + </div> +</form> \ No newline at end of file Modified: trunk/pollen-ui-angular/src/main/webapp/partials/poll.html =================================================================== --- trunk/pollen-ui-angular/src/main/webapp/partials/poll.html 2014-05-05 12:36:59 UTC (rev 3913) +++ trunk/pollen-ui-angular/src/main/webapp/partials/poll.html 2014-05-05 15:39:10 UTC (rev 3914) @@ -54,6 +54,7 @@ <button class="btn btn-primary" ng-click="save()">Save</button> <button class="btn btn-warning" ng-click="reset();" ng-if="!globalVariables.voted">Reset</button> <button class="btn btn-danger" ng-click="delete();">Delete</button> + <button class="btn btn-default" ng-click="popupSettings()">Settings</button> </div> </form> \ No newline at end of file
participants (1)
-
garandel@users.chorem.org