From aa257e877c43dc30cec415b19b00660202c435f7 Mon Sep 17 00:00:00 2001
From: Leonardo Merlin
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.
"})}a.$inject=["ArticleService","$state","$scope","$element","$timeout","$log"],a.prototype.init=function(){var a=this;if(!a.proposals)throw{name:"NotDefined",message:'The attribute "proposals" is undefined.'};a.per_page||(a.per_page=5),a.initPorposalList()},a.prototype.initPorposalList=function(){var a=this;a.currentPageIndex=0,a.proposalsPerPage=a.getProposalsPerPage(0),a.proposalsLength=a.proposals.length,a.pages=a.proposalsLength%a.per_page===0?a.proposalsLength/a.per_page:a.proposalsLength/a.per_page+1,a.arraypages=new Array(Math.floor(a.pages))},a.prototype.loadData=function(){var a=this;a.$timeout(function(){e.call(a)},1e3)},a.prototype.attachListeners=function(){var a=this;a.$scope.$watch("vm.proposals",function(){a.initPorposalList()})},a.prototype.getProposalsPerPage=function(a){var e=this,o=a*e.per_page,s=o+e.per_page;return e.proposals.slice(o,s)},a.prototype.showPage=function(a){var e=this;0>a&&(a=0),a>e.arraypages.length-1&&(a=e.arraypages.length-1),e.proposalsPerPage=e.getProposalsPerPage(a),e.currentPageIndex=a},a.prototype.showContent=function(a){var e=this;e.$state.go("programa-conteudo",{slug:a.parent.slug,proposal_id:a.id},{location:!0})};var o={restrict:"E",templateUrl:"app/components/proposal-list/proposal-list.html",scope:{proposals:"=",per_page:"="},controller:a,controllerAs:"vm",bindToController:!0};return o}angular.module("dialoga").directive("proposalList",a)}(),function(){"use strict";function a(){function a(a,e,o,s,t,r){r.debug("ProposalGridController");var i=this;i.$scope=a,i.$rootScope=e,i.$element=o,i.$location=s,i.$filter=t,i.$log=r,i.init(),i.attachListeners()}a.$inject=["$scope","$rootScope","$element","$location","$filter","$log"],a.prototype.init=function(){},a.prototype.attachListeners=function(){};var e={restrict:"E",templateUrl:"app/components/proposal-grid/proposal-grid.html",scope:{proposals:"="},controller:a,controllerAs:"vm",bindToController:!0};return e}angular.module("dialoga").directive("proposalGrid",a)}(),function(){"use strict";function a(){function a(a,e,o,s){s.debug("ProposalCarouselController");var t=this;t.$scope=a,t.$element=e,t.$timeout=o,t.$log=s,t.init()}a.$inject=["$scope","$element","$timeout","$log"],a.prototype.init=function(){var a=this;if(!a.proposals)throw{name:"NotDefined",message:'The attribute "proposals" is undefined.'};a.activeIndex=0,a.loading=!1,a.proposalsLength=a.proposals.length},a.prototype.swipeLeft=function(){var a=this;a.activeIndex=a.activeIndex