diff --git a/src/app/components/proposal-list/proposal-list.directive.js b/src/app/components/proposal-list/proposal-list.directive.js index ca95143..ad04b9e 100644 --- a/src/app/components/proposal-list/proposal-list.directive.js +++ b/src/app/components/proposal-list/proposal-list.directive.js @@ -9,11 +9,12 @@ function proposalList() { /** @ngInject */ - function ProposalListController(ArticleService, $scope, $element, $timeout, $log) { + function ProposalListController(ArticleService, $state, $scope, $element, $timeout, $log) { $log.debug('ProposalListController'); var vm = this; vm.ArticleService = ArticleService; + vm.$state = $state; vm.$scope = $scope; vm.$element = $element; vm.$timeout = $timeout; @@ -49,7 +50,7 @@ vm.pages = (vm.proposalsLength / vm.per_page) +1; }; - vm.arraypages = new Array(vm.pages); + vm.arraypages = new Array(Math.ceil(vm.pages)); }; @@ -87,6 +88,18 @@ vm.currentPageIndex = pageIndex; }; + ProposalListController.prototype.showContent = function (proposal) { + var vm = this; + + vm.$state.go('programa-conteudo', { + slug: proposal.parent.slug, + proposal_id: proposal.id + }, { + location: true + }); + + } + function attachPopover(){ var vm = this; diff --git a/src/app/components/proposal-list/proposal-list.html b/src/app/components/proposal-list/proposal-list.html index 8da44c3..b608aaa 100644 --- a/src/app/components/proposal-list/proposal-list.html +++ b/src/app/components/proposal-list/proposal-list.html @@ -16,7 +16,7 @@ - {{::($index+1)}}º + {{::proposal.ranking_position}}º
@@ -26,7 +26,7 @@
- -- libgit2 0.21.2