01/03: add link for edit poll and vote
This is an automated email from the git hooks/post-receive script. unknown user pushed a commit to branch devel in repository Pollen. commit 9a28b0a317a40876e16788f9c33ab5190a2eb72b Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri May 23 10:34:17 2014 +0200 add link for edit poll and vote --- pollen-ui-angular/src/main/webapp/css/style.css | 6 +++--- pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js | 7 +++++++ pollen-ui-angular/src/main/webapp/partials/poll.html | 8 +++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/css/style.css b/pollen-ui-angular/src/main/webapp/css/style.css index de2d910..d6ef705 100644 --- a/pollen-ui-angular/src/main/webapp/css/style.css +++ b/pollen-ui-angular/src/main/webapp/css/style.css @@ -199,9 +199,9 @@ i.icon-collapse { } .alert-float { - position: absolute; - width: 80%; - left: 10%; + position: fixed; + left:20%; + width:60%; z-index: 100000; opacity: 0.9; } 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 da513f3..16cf767 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -208,6 +208,11 @@ angular.module('pollControllers', []) $controller('PollAdminCtrl', {$scope:$scope}); $scope.globalVariables.edit = true; + $scope.globalVariables.hostName = $location.protocol()+'://'+$location.host(); + + if (angular.isDefined($routeParams.token)) { + $scope.globalVariables.linkEdit = $location.protocol()+'://'+$location.host()+'/#/poll/edit/'+$routeParams.pollId; + } $scope.callBackAddChoice = function (choice) { PollChoice.add({pollId:$routeParams.pollId, permission:$routeParams.token}, choice, function (data) { @@ -284,6 +289,8 @@ angular.module('pollControllers', []) .controller('PollVoteCtrl', ['$scope', '$filter', '$controller', '$routeParams', 'Poll', 'PollChoice', 'PollVote', function ($scope, $filter, $controller, $routeParams, Poll, PollChoice, PollVote) { $controller('PollCtrl', {$scope:$scope}); + $scope.globalVariables.results = true; + var initPoll = function () { Poll.get({pollId:$routeParams.pollId}, function (poll) { $scope.data.poll = poll; diff --git a/pollen-ui-angular/src/main/webapp/partials/poll.html b/pollen-ui-angular/src/main/webapp/partials/poll.html index 54929d7..d8529fb 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll.html @@ -18,15 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #L% --> - <form class="form-horizontal" novalidate> - <alert type="warning" ng-if="globalVariables.voted"> Les votes ont commencé, certaine modification sont inaccessible.. </alert> - <alert type="success" ng-if="globalVariables.edit"> Lien de vote : <a href="#/poll/vote/{{data.poll.id}}"> http://pollen/#/poll/vote/{{data.poll.id}}</a> </alert> - <alert type="danger" class="alert-float" ng-if="restError.choice" close="restError.choice = false"> Vous devez avoir au moins 1 choix </alert> <alert type="success" class="alert-float" ng-if="globalVariables.editMode && globalVariables.saved" close="globalVariables.saved = false"> Sondage sauvegardé..</alert> <alert type="success" class="alert-float" ng-if="!globalVariables.editMode && globalVariables.saved" close="globalVariables.saved = false"> Vote effectué..</alert> + <alert type="warning" ng-if="globalVariables.linkEdit"> Lien d'édition : <a href="{{globalVariables.linkEdit}}">{{globalVariables.linkEdit}}</a> </alert> + <alert type="success" ng-if="globalVariables.edit"> Lien de vote : <a href="#/poll/vote/{{data.poll.id}}"> {{globalVariables.hostName}}/#/poll/vote/{{data.poll.id}}</a> </alert> <tabset> <tab heading="Sondage"> @@ -64,7 +62,7 @@ </tab> </tabset> - <div ng-include="'./partials/poll-result.html'"></div> + <div ng-include="'./partials/poll-result.html'" ng-if="globalVariables.results"></div> <div ng-if="globalVariables.create"> <hr/> -- To stop receiving notification emails like this one, please contact Chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
Chorem.org scm