diff --git a/src/app/components/auth/auth.service.js b/src/app/components/auth/auth.service.js index 44eda26..ed58330 100644 --- a/src/app/components/auth/auth.service.js +++ b/src/app/components/auth/auth.service.js @@ -110,26 +110,26 @@ }; } - /** @ngInject */ - function AuthResolver($q, $rootScope, $state){ - return { - resolve: function () { - var deferred = $q.defer(); - var unwatch = $rootScope.$watch('currentUser', function (currentUser) { - if (angular.isDefined(currentUser)) { - if (currentUser) { - deferred.resolve(currentUser); - } else { - deferred.reject(); - // TODO: too many responsibilities? - $state.go('login'); - } - unwatch(); - } - }); - return deferred.promise; - } - }; - } + // /** @ngInject */ + // function AuthResolver($q, $rootScope, $state){ + // return { + // resolve: function () { + // var deferred = $q.defer(); + // var unwatch = $rootScope.$watch('currentUser', function (currentUser) { + // if (angular.isDefined(currentUser)) { + // if (currentUser) { + // deferred.resolve(currentUser); + // } else { + // deferred.reject(); + // // TODO: too many responsibilities? + // $state.go('login'); + // } + // unwatch(); + // } + // }); + // return deferred.promise; + // } + // }; + // } })(); diff --git a/src/app/components/breadcrumb/breadcrumb.scss b/src/app/components/breadcrumb/breadcrumb.scss index 64d1fa2..ff165e1 100644 --- a/src/app/components/breadcrumb/breadcrumb.scss +++ b/src/app/components/breadcrumb/breadcrumb.scss @@ -2,4 +2,9 @@ .breadcrumb > li + li:before { content: '>'; } + + .contraste & .breadcrumb { + background-color: #000; + border: 1px solid #fff; + } } diff --git a/src/app/components/navbar/navbar.scss b/src/app/components/navbar/navbar.scss index 0fed1c3..7a18031 100644 --- a/src/app/components/navbar/navbar.scss +++ b/src/app/components/navbar/navbar.scss @@ -23,4 +23,12 @@ .navbar-toggle .icon-bar { background-color: #333; } + + .contraste & { + .nav > li > a:hover, + .nav > li > a:focus { + color: #000; + } + + } } diff --git a/src/app/components/proposal-ranking/proposal-ranking-list.scss b/src/app/components/proposal-ranking/proposal-ranking-list.scss index d688224..3864d1c 100644 --- a/src/app/components/proposal-ranking/proposal-ranking-list.scss +++ b/src/app/components/proposal-ranking/proposal-ranking-list.scss @@ -61,6 +61,22 @@ } } + .abstract { + color: #393939; + font-size: 18px; + } + + .row-actions { + padding-top: 20px; + } + + .btn-rate { + padding: 0; + font-size: 20px; + font-weight: bold; + text-decoration: blink; + } + // override bootstrap .table-striped > tbody > tr:nth-of-type(odd) { // impar diff --git a/src/app/components/proposal-ranking/proposal-ranking.directive.js b/src/app/components/proposal-ranking/proposal-ranking.directive.js index decbe93..0db6c99 100644 --- a/src/app/components/proposal-ranking/proposal-ranking.directive.js +++ b/src/app/components/proposal-ranking/proposal-ranking.directive.js @@ -27,11 +27,12 @@ var vm = this; vm.activeIndex = 1; - vm.attachedPopover = false; vm.loading = false; - if(!angular.isNumber(vm.limit)){ + if(angular.isDefined(vm.limit) && angular.isString(vm.limit)){ vm.limit = parseInt(vm.limit); + }else{ + vm.limit = 3; } vm.loadData(); @@ -46,13 +47,45 @@ // simulate delay vm.$timeout(function(){ vm.loading = false; + + // Fake Data + // vm.proposals = vm.ArticleService.getProposals(); + vm.proposals = [{ + id: 4159, + abstract: 'Ut odio unde porro in. Aut fuga magni adipisci. Recusandae ipsum distinctio omnis ut illum.', + effective_support: 0.1572052401746725, + hits: 4159, + votes_against: 3779, + votes_for: 1780 + },{ + id: 935, + abstract: 'Magni sunt ut molestiae. A porro et quod saepe placeat amet nihil. Aut ut id voluptatem doloribus quia.', + effective_support: 0.1572052401746725, + hits: 8602, + votes_against: 7005, + votes_for: 8728 + },{ + id: 1008, + abstract: 'Cum quas assumenda nihil delectus eos. Minus fugit velit voluptatem nisi nam esse ut id.', + effective_support: 0.1572052401746725, + hits: 9181, + votes_against: 612, + votes_for: 1786 + }]; + + if(vm.display === 'list'){ + // wait until DOM be created + vm.$timeout(function(){ + attachPopover.call(vm); + }, 20); + } }, 2000); }; ProposalRankingController.prototype.switchProposal = function (index) { var vm = this; - if(index > 0 && index <= limit) { + if(index > 0 && index <= vm.limit) { vm.activeIndex = index; }else{ vm.$log.warn('[switchProposal] "index" not handled:', index); @@ -66,28 +99,18 @@ vm.$scope.$emit('see-proposals'); }; - ProposalRankingController.prototype.showPopover = function ($event) { + function attachPopover(){ var vm = this; - $event.stopPropagation(); - - var target = $event.target; - var elPopover = angular.element(target); - - if(!vm.attachedPopover){ - elPopover.popover({ - html: true, - placement: 'top', - animation: true, - title: 'Regra de posição das propostas', - content: '

É calculada pelo saldo de interações das propostas (curtidas - não curtidas) dividido pela diferença de exibições entre elas.

O objetivo dessa correção é compensar o saldo de interações e a diferença de exibições das propostas que não tiveram muitas oportunidades de visualização ou das propostas que tiveram mais oportunidades de visualização que a média.

Com essa correção, é possível comparar propostas que entraram em diferentes momentos, durante todo o período da consulta.

' - }); - vm.attachedPopover = true; - } - - - elPopover.popover('toggle'); - }; + vm.popover = angular.element(vm.$element.find('.btn-question')); + vm.popover.popover({ + html: true, + placement: 'top', + animation: true, + title: 'Regra de posição das propostas', + content: '

É calculada pelo saldo de interações das propostas (curtidas - não curtidas) dividido pela diferença de exibições entre elas.

O objetivo dessa correção é compensar o saldo de interações e a diferença de exibições das propostas que não tiveram muitas oportunidades de visualização ou das propostas que tiveram mais oportunidades de visualização que a média.

Com essa correção, é possível comparar propostas que entraram em diferentes momentos, durante todo o período da consulta.

' + }); + } var directive = { restrict: 'E', diff --git a/src/app/components/proposal-ranking/proposal-ranking.html b/src/app/components/proposal-ranking/proposal-ranking.html index db59312..f0cb59f 100644 --- a/src/app/components/proposal-ranking/proposal-ranking.html +++ b/src/app/components/proposal-ranking/proposal-ranking.html @@ -1,5 +1,4 @@ -
- +