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 d504e8c607af605d4f42bfa660111807a39762a0 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Jun 26 18:04:06 2014 +0200 refont home tab --- pollen-ui-angular/src/main/webapp/css/style.css | 99 ++++++++++++++++++++++ pollen-ui-angular/src/main/webapp/i18n/en.js | 4 +- pollen-ui-angular/src/main/webapp/i18n/fr.js | 4 +- pollen-ui-angular/src/main/webapp/index.html | 4 +- .../src/main/webapp/js/controllers/pollCtrl.js | 37 ++++---- .../src/main/webapp/partials/poll-comment.html | 4 +- .../src/main/webapp/partials/poll-link.html | 34 +++++--- .../src/main/webapp/partials/poll.html | 4 +- 8 files changed, 153 insertions(+), 37 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/css/style.css b/pollen-ui-angular/src/main/webapp/css/style.css index 7047243..ea6da2c 100644 --- a/pollen-ui-angular/src/main/webapp/css/style.css +++ b/pollen-ui-angular/src/main/webapp/css/style.css @@ -20,6 +20,23 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ +#pollenMenu { + position:fixed; + width:100%; + height:50px; + top:0px; + left:0px; +} +#content { + margin-top:60px; +} + +@media screen and (max-width:770px) { + #content, #pollenMenu, #pollenMenu .container-fluid, #poll-link { + width:770px !important; + } +} + .navbar .dropdown-menu.form { width:250px; } @@ -92,6 +109,81 @@ i.icon-collapse { color: rgb(150, 150, 150); } + +@media screen and (min-width: 1025px) { + #poll-link { + position:fixed; + top:0px; + left:0px; + width:300px; + height:100%; + padding-top:60px; + padding-left:5px; + padding-right:5px; + border-right:2px solid #EEE; + background-color:#DDD; + overflow:hidden; + z-index:50; + } + + #poll-link ul { + list-style-type:none; + margin-left:0px; + padding-left:0px; + } + + #poll-link ul li { + margin-bottom:15px; + } + + #poll-content { + margin-right:0px; + margin-left:300px; + } +} + +@media screen and (max-width: 1024px) { + #poll-link { + text-align:center; + position:fixed; + bottom:0px; + left:0px; + width:100%; + height:80px; + border-top:2px solid #EEE; + background-color:#DDD; + overflow:hidden; + z-index:50; + } + + #poll-link ul { + display:inline-block; + margin-left:3.247%; + margin-right:3.247%; + } + + #poll-link input { + display:none; + } + + #poll-content { + margin-bottom:80px; + } + + @media screen and (max-height:600px) { + #poll-link { + position:relative; + background-color:inherit; + border-color: #DDD; + } + #poll-content { + margin-bottom:0px; + } + } + +} + + .pollTitle, .pollDesc { margin-top:15px; min-height:60px; @@ -222,6 +314,13 @@ i.icon-collapse { cursor:pointer; } +.input-mini { + font-size: 8pt; + height:16px; + margin:0px; + padding:0px; +} + #comments { margin-top:30px; width:100%; diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index 650853b..d6f2bd2 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -44,8 +44,8 @@ var translateEN = { 'poll.tab.conf' : 'Configuration', 'poll.tab.participant' : 'Participants', -'poll.link.edit' : 'Edit Url:', -'poll.link.vote' : 'Vote Url:', +'poll.link.edit' : 'Edit Url', +'poll.link.vote' : 'Vote Url', 'poll.edit' : 'Click to edit', 'poll.desc' : 'Description is optional. This message will not visible in vote page.', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index 0222bd1..ac2b420 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -44,8 +44,8 @@ var translateFR = { 'poll.tab.conf' : 'Configuration', 'poll.tab.participant' : 'Participants', -'poll.link.edit' : 'Lien d\'édition :', -'poll.link.vote' : 'Lien de partage pour le vote :', +'poll.link.edit' : 'Lien d\'édition', +'poll.link.vote' : 'Lien de partage pour le vote', 'poll.edit' : 'Clique pour éditer', 'poll.desc' : 'Description (Facultatif). Ce cadre disparait si aucune description n\'est mise', diff --git a/pollen-ui-angular/src/main/webapp/index.html b/pollen-ui-angular/src/main/webapp/index.html index 922dc6d..a07a804 100644 --- a/pollen-ui-angular/src/main/webapp/index.html +++ b/pollen-ui-angular/src/main/webapp/index.html @@ -62,7 +62,7 @@ </head> <body> -<nav class="navbar navbar-inverse navbar-static-top"> +<nav id="pollenMenu" class="navbar navbar-inverse navbar-static-top"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">Pollen</a> @@ -157,7 +157,7 @@ <alert ng-repeat="alert in data.alerts track by $index" type="{{alert.type}}" class="fakeLink" close="hideAlert(alert)" ng-click="hideAlert(alert)"> {{ alert.msg | translate }} </alert> </div> -<div ng-view class='container' id="content"></div> +<div ng-view class='container-fluid' id="content"></div> </body> </html> 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 9c353ac..917f491 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -103,7 +103,8 @@ angular.module('pollControllers', []) }); pollDeferred.promise.then(function () { - var baseUrl = window.location.origin+window.location.pathname; + console.log($location); + var baseUrl = window.location.protocol+'//'+window.location.hostname+window.location.pathname; $scope.globalVariables.linkHome = baseUrl; $scope.globalVariables.linkVote = baseUrl; $scope.globalVariables.linkComment = baseUrl; @@ -209,6 +210,23 @@ angular.module('pollControllers', []) return false; } + $scope.deletePoll = function () { + if (angular.isDefined($scope.data.poll.id)) { + var confirmMessage; + $translate('action.message.confirmDelete').then(function (msg) { + confirmMessage = msg; + }).then( function () { + var confirmDelete = confirm(confirmMessage); + if (confirmDelete == true) { + $scope.data.poll.$remove({permission:$scope.globalVariables.pollToken}, function() { + $rootScope.$broadcast('newSuccess', 'poll.deleted'); + $location.path('/'); + }); + } + }); + } + }; + }]) .controller('PollAdminCtrl', ['$scope', '$controller', '$modal', '$timeout', '$routeParams', function ($scope, $controller, $modal, $timeout, $routeParams) { @@ -763,20 +781,6 @@ angular.module('pollControllers', []) }); } - $scope.deletePoll = function () { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - $scope.data.poll.$remove({permission:$scope.globalVariables.pollToken}, function() { - $rootScope.$broadcast('newSuccess', 'poll.deleted'); - $location.path('/'); - }); - } - }); - }; }]) .controller('PollVoteCtrl', ['$scope', '$rootScope', '$q', '$controller', '$routeParams', 'Poll', 'PollChoice', 'PollVote', '$translate', @@ -845,7 +849,7 @@ angular.module('pollControllers', []) var sendVote = angular.copy($scope.data.vote); if ($scope.voteCountingIsBoolean()) { angular.forEach(sendVote.choice, function (choice) { - choice.voteValue = $scope.getChoiceValue(choice.voteValue); + choice.voteValue = (choice.voteValue)?1.0:0.0; }); } @@ -976,6 +980,7 @@ angular.module('pollControllers', []) }); $scope.postComment = function () { + delete $scope.restError; var commentPromise if (angular.isDefined($scope.comment.id)) { // edit diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html index 6966b23..a584ca5 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html @@ -30,7 +30,7 @@ <info-error error="restError['author.name'][0]" data="comment.authorName"></info-error> </div> <div class="col-sm-9"> - <input type="text" ng-model="comment.authorName" class="form-control" focus-me="comment.id != null" /> + <input type="text" ng-model="comment.authorName" class="form-control" focus-me="comment.id != null || restError['author.name'] !== undefined" /> </div> </div> @@ -38,7 +38,7 @@ <label class="col-sm-2"> {{ 'comment' | translate }} </label> <div class="col-sm-1"><info-error error="restError.text[0]" data="comment.text"></info-error></div> <div class="col-sm-9"> - <textarea ck-editor ng-model="comment.text" focus-me="comment.id != null"></textarea> + <textarea ck-editor ng-model="comment.text" focus-me="comment.id != null || restError.text[0] !== undefined"></textarea> </div> </div> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-link.html b/pollen-ui-angular/src/main/webapp/partials/poll-link.html index fc2b4cb..f959584 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-link.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-link.html @@ -18,16 +18,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #L% --> -<div> - <h1>{{data.poll.title}}</h1> - <h2>Sondage:</h2> +<ul> + <li> + <a href="{{globalVariables.linkVote}}">{{ 'poll.link.vote' | translate }}</a> + <input type="text" select-on-click value="{{globalVariables.linkVote}}" readonly class="form-control input-mini"/> + </li> + <li> + <a href="{{globalVariables.linkResult}}">{{ 'poll.link.result' | translate }}</a> + <input type="text" select-on-click value="{{globalVariables.linkResult}}" readonly class="form-control input-mini"/> + </li> +</ul> +<ul> + <li> + <a href="{{globalVariables.linkEdit}}">{{ 'poll.link.edit' | translate }}</a> + <input type="text" select-on-click value="{{globalVariables.linkEdit}}" readonly class="form-control input-mini"/> + </li> + <li><a class="fakeLink">{{ 'poll.link.clone' | translate }} (disabled)</a></li> + <li><a class="fakeLink">{{ 'poll.link.export' | translate }} (disabled)</a></li> +</ul> +<ul> + <li><a class="fakeLink danger">{{ 'poll.link.close' | translate }}</a></li> + <li><a class="fakeLink danger" ng-click="deletePoll()">{{ 'poll.link.delete' | translate }}</a></li> +</ul> - <alert type="warning" ng-if="globalVariables.linkEdit && data.poll.permission"> - {{ 'poll.link.edit' | translate }} - <input type="text" select-on-click value="{{globalVariables.linkEdit}}" readonly class="form-control"/> - </alert> - <alert type="success" ng-if="globalVariables.linkVote"> - {{ 'poll.link.vote' | translate }} - <input type="text" select-on-click value="{{globalVariables.linkVote}}" readonly class="form-control"/> - </alert> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll.html b/pollen-ui-angular/src/main/webapp/partials/poll.html index b974c20..5956368 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll.html @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #L% --> -<div> +<div id="poll-content"> <ul class="nav nav-tabs"> <li ng-class="{active: tab == 'home'}"><a href="{{globalVariables.linkHome || '#/poll/create/home' }}" ng-click="tab = 'home'"> <span class="glyphicon glyphicon-home"></span> </a></li> <li ng-class="{active: tab == 'vote'}" ng-show="data.poll.id"><a href="{{globalVariables.linkVote}}" ng-click="tab = 'vote'">{{ 'poll.tab.vote' | translate }}</a></li> @@ -43,4 +43,6 @@ <div ng-include="'./partials/poll-listParticipant.html'" ng-if="tab == 'participant'"></div> + <div ng-include="'./partials/poll-link.html'" id="poll-link" ></div> + </div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.