Commit 8dbfc7f0e6f84f0d5af92a9b9abb0f0a299966ba

Authored by Leonardo Merlin
2 parents a2b48f84 f6e53716

Merge branch 'merlin' into rafael

Showing 76 changed files with 1258 additions and 659 deletions   Show diff stats
@@ -43,9 +43,13 @@ gulp.task('html', ['inject', 'partials'], function () { @@ -43,9 +43,13 @@ gulp.task('html', ['inject', 'partials'], function () {
43 .pipe(assets = $.useref.assets()) 43 .pipe(assets = $.useref.assets())
44 .pipe($.rev()) 44 .pipe($.rev())
45 .pipe(jsFilter) 45 .pipe(jsFilter)
46 - .pipe($.if($.util.env.server === 'production', $.replace('$logProvider.debugEnabled(true);', '$logProvider.debugEnabled(false);')))  
47 - .pipe($.if($.util.env.server === 'production', $.replace('http://hom.dialoga.gov.br', 'http://login.dialoga.gov.br')))  
48 - .pipe($.if($.util.env.server === 'production', $.replace('http://hom.login.dialoga.gov.br', 'http://login.dialoga.gov.br'))) 46 + // production
  47 + .pipe($.if($.util.env.production, $.replace('$logProvider.debugEnabled(true);', '$logProvider.debugEnabled(false);')))
  48 + .pipe($.if($.util.env.production, $.replace('http://hom.dialoga.gov.br', 'http://login.dialoga.gov.br')))
  49 + .pipe($.if($.util.env.production, $.replace('http://hom.login.dialoga.gov.br', 'http://login.dialoga.gov.br')))
  50 + // staging
  51 + .pipe($.if($.util.env.staging, $.replace('http://dialoga.gov.br', 'http://hom.dialoga.gov.br')))
  52 + .pipe($.if($.util.env.staging, $.replace('http://login.dialoga.gov.br', 'http://hom.login.dialoga.gov.br')))
49 .pipe($.ngAnnotate()) 53 .pipe($.ngAnnotate())
50 .pipe($.uglify({ preserveComments: $.uglifySaveLicense })).on('error', conf.errorHandler('Uglify')) 54 .pipe($.uglify({ preserveComments: $.uglifySaveLicense })).on('error', conf.errorHandler('Uglify'))
51 .pipe(jsFilter.restore()) 55 .pipe(jsFilter.restore())
src/app/components/app-footer/app-footer.html
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 <div class="container"> 2 <div class="container">
3 <div class="row"> 3 <div class="row">
4 <div class="col-xs-12 text-center"> 4 <div class="col-xs-12 text-center">
5 - <a id="termos-de-uso" ui-sref="termos-de-uso">Termos de uso</a>  
6 <a href="#header" style="position:absolute;right:0;top:-10px;" ng-click="scrollTo('#header')">Voltar para o topo</a> 5 <a href="#header" style="position:absolute;right:0;top:-10px;" ng-click="scrollTo('#header')">Voltar para o topo</a>
7 </div> 6 </div>
8 </div> 7 </div>
src/app/components/app-paginator/app-paginator.directive.js 0 → 100644
@@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
  1 +(function() {
  2 + 'use strict';
  3 +
  4 + angular
  5 + .module('dialoga')
  6 + .directive('appPaginator', appPaginator);
  7 +
  8 + /** @ngInject */
  9 + function appPaginator() {
  10 +
  11 + /** @ngInject */
  12 + function AppPaginatorController($log) {
  13 + var vm = this;
  14 +
  15 + vm.$log = $log;
  16 +
  17 + vm.init();
  18 +
  19 + $log.debug('AppPaginatorController');
  20 + }
  21 +
  22 + AppPaginatorController.prototype.init = function() {
  23 + var vm = this;
  24 +
  25 + vm.page = vm.page || 1;
  26 + vm.perPage = vm.perPage || 20;
  27 + vm.total = vm.total || 0;
  28 +
  29 + if ((vm.total % vm.perPage) === 0) {
  30 + vm.pages = vm.total / vm.perPage;
  31 + } else {
  32 + vm.pages = (vm.total / vm.perPage) + 1;
  33 + }
  34 +
  35 + vm.arraypages = new Array(Math.floor(vm.pages));
  36 + };
  37 +
  38 + AppPaginatorController.prototype.showPage = function(pageIndex) {
  39 + var vm = this;
  40 +
  41 + if (pageIndex < 1) {
  42 + pageIndex = 1;
  43 + }
  44 +
  45 + if (pageIndex > vm.pages) {
  46 + pageIndex = vm.pages;
  47 + }
  48 +
  49 + if (vm.changePage) {
  50 + vm.changePage({pageIndex: pageIndex});
  51 + }
  52 + };
  53 +
  54 + var directive = {
  55 + restrict: 'E',
  56 + templateUrl: 'app/components/app-paginator/app-paginator.html',
  57 + scope: {
  58 + page: '=',
  59 + perPage: '=',
  60 + total: '=',
  61 + changePage: '&'
  62 + },
  63 + controller: AppPaginatorController,
  64 + controllerAs: 'vm',
  65 + bindToController: true
  66 + };
  67 +
  68 + return directive;
  69 + }
  70 +
  71 +})();
src/app/components/app-paginator/app-paginator.html 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +<nav class="app-paginator" ng-if="vm.arraypages.length > 1">
  2 + <ul class="pagination">
  3 + <li ng-style="{'visibility': (vm.page === 1) ? 'hidden' : 'visible'}">
  4 + <a class="btn-pagination" href="#" aria-label="Previous" ng-click="vm.showPage(vm.page-1)">
  5 + <span aria-hidden="true" class="glyphicon glyphicon-chevron-left pagination-icon"></span>
  6 + </a>
  7 + </li>
  8 + <li ng-repeat="paginas in vm.arraypages track by $index" ng-class="{ 'active' : ($index) === (vm.page - 1) }" >
  9 + <a class="btn-pagination" href="#" ng-click="vm.showPage($index + 1)">{{::($index)+1}}</a>
  10 + </li>
  11 + <li ng-style="{'visibility': (vm.page === vm.arraypages.length) ? 'hidden' : 'visible'}">
  12 + <a class="btn-pagination" href="#" aria-label="Next" ng-click="vm.showPage(vm.page+1)">
  13 + <span aria-hidden="true" class="glyphicon glyphicon-chevron-right pagination-icon"></span>
  14 + </a>
  15 + </li>
  16 + </ul>
  17 +</nav>
src/app/components/app-paginator/app-paginator.scss 0 → 100644
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
  1 +.app-paginator {
  2 + text-align: center;
  3 +
  4 + .btn-pagination {
  5 + background-color: transparent;
  6 + border: none;
  7 + border-radius: 100%;
  8 + font-weight: bold;
  9 + font-size: 20px;
  10 + padding: 0px 8px;
  11 + width: 28px;
  12 + height: 28px;
  13 + text-decoration: underline;
  14 + color: $defaultblue;
  15 + }
  16 +
  17 + .pagination-icon {
  18 + color: $defaultblue;
  19 + }
  20 +
  21 + .pagination > .active > a,
  22 + .pagination > .active > a:hover,
  23 + .pagination > .active > a:focus,
  24 + .pagination > .active > span,
  25 + .pagination > .active > span:hover,
  26 + .pagination > .active > span:focus {
  27 + background-color: $defaultblue;
  28 + text-decoration: none;
  29 +
  30 + }
  31 +
  32 + .pagination > .disabled > span,
  33 + .pagination > .disabled > span:hover,
  34 + .pagination > .disabled > span:focus,
  35 + .pagination > .disabled > a,
  36 + .pagination > .disabled > a:hover,
  37 + .pagination > .disabled > a:focus {
  38 + background-color: transparent;
  39 + }
  40 +}
src/app/components/article-service/article.service.js
@@ -96,25 +96,11 @@ @@ -96,25 +96,11 @@
96 } 96 }
97 97
98 function getProposals (params, cbSuccess, cbError) { 98 function getProposals (params, cbSuccess, cbError) {
99 - // Ex.: /api/v1/articles/103358?fields=  
100 -  
101 - // var url = service.apiArticles + API.articleId.home;  
102 -  
103 - // var paramsExtended = angular.extend({  
104 - // // 'fields[]': ['id', 'title', 'slug', 'abstract', 'categories', 'setting', 'children', 'children_count'],  
105 - // 'content_type':'ProposalsDiscussionPlugin::Proposal'  
106 - // }, params);  
107 -  
108 - // UtilService.get(url, {params: paramsExtended}).then(function(data){  
109 - // cbSuccess(data);  
110 - // }).catch(function(error){  
111 - // cbError(error);  
112 - // });  
113 -  
114 - //  
115 - searchProposals({ 99 + var paramsExtended = angular.extend({
116 query: '' 100 query: ''
117 - }, cbSuccess, cbError); 101 + }, params);
  102 +
  103 + searchProposals(paramsExtended, cbSuccess, cbError);
118 } 104 }
119 105
120 function getProposalById (proposalId, params, cbSuccess, cbError) { 106 function getProposalById (proposalId, params, cbSuccess, cbError) {
@@ -257,8 +243,9 @@ @@ -257,8 +243,9 @@
257 // Ex.: /api/v1/search/article?type=ProposalsDiscussionPlugin::Proposal&query=cisternas 243 // Ex.: /api/v1/search/article?type=ProposalsDiscussionPlugin::Proposal&query=cisternas
258 var url = '/api/v1/search/article'; 244 var url = '/api/v1/search/article';
259 var paramsExtended = angular.extend({ 245 var paramsExtended = angular.extend({
260 - // 'fields[]': ['id', 'title', 'slug', 'abstract', 'categories', 'setting', 'children_count', 'hits'],  
261 - 'type': 'ProposalsDiscussionPlugin::Proposal' 246 + page: 1,
  247 + per_page: 20,
  248 + type: 'ProposalsDiscussionPlugin::Proposal'
262 }, params); 249 }, params);
263 250
264 UtilService.get(url, {params: paramsExtended}).then(function(data){ 251 UtilService.get(url, {params: paramsExtended}).then(function(data){
src/app/components/auth-user/auth-user.html
1 <div class="auth-user"> 1 <div class="auth-user">
2 <div ng-if="vm.currentUser" class="pull-right"> 2 <div ng-if="vm.currentUser" class="pull-right">
3 - <span>{{::vm.currentUser.login}}</span> 3 + <span ng-if="vm.currentUser.person">{{::vm.currentUser.person.name}}</span>
  4 + <span ng-if="!vm.currentUser.person">{{::vm.currentUser.login}}</span>
4 <span>|</span> 5 <span>|</span>
5 <button type="button" class="btn btn-link" ng-click="vm.onClickLogout()">Sair</button> 6 <button type="button" class="btn btn-link" ng-click="vm.onClickLogout()">Sair</button>
6 </div> 7 </div>
7 8
8 <div ng-if="!vm.currentUser"> 9 <div ng-if="!vm.currentUser">
9 - <button type="button" class="btn btn-link pull-right" ui-sref="entrar">  
10 - <!-- <span class="icon icon-user" aria-hidden="true"></span> -->  
11 - <!-- <span class="glyphicon glyphicon-user"></span> -->  
12 - Entrar  
13 - </button> 10 + <button type="button" class="btn btn-link pull-right" ui-sref="entrar">Entrar</button>
14 </div> 11 </div>
15 </div> 12 </div>
src/app/components/auth/auth.service.js
@@ -39,6 +39,7 @@ @@ -39,6 +39,7 @@
39 39
40 var currentUser = Session.create(response.data); 40 var currentUser = Session.create(response.data);
41 41
  42 + $rootScope.currentUser = currentUser;
42 $rootScope.$broadcast(AUTH_EVENTS.registerSuccess, currentUser); 43 $rootScope.$broadcast(AUTH_EVENTS.registerSuccess, currentUser);
43 $rootScope.$broadcast(AUTH_EVENTS.loginSuccess, currentUser); 44 $rootScope.$broadcast(AUTH_EVENTS.loginSuccess, currentUser);
44 45
@@ -101,10 +102,13 @@ @@ -101,10 +102,13 @@
101 }); 102 });
102 } 103 }
103 104
104 - function forgotPassword (form){  
105 - var url = '/api/v1/forgot_password';  
106 - var data = form.serialize();  
107 - var encodedData = data; 105 + function forgotPassword (data){
  106 + var url = 'http://hom.login.dialoga.gov.br/api/v1/forgot_password';
  107 + var encodedData = ([
  108 + 'value=' + data.login,
  109 + 'captcha_text=' + data.captcha_text,
  110 + 'txtToken_captcha_serpro_gov_br=' + data.txtToken_captcha_serpro_gov_br
  111 + ]).join('&');
108 112
109 return $http 113 return $http
110 .post(url, encodedData) 114 .post(url, encodedData)
@@ -113,11 +117,14 @@ @@ -113,11 +117,14 @@
113 117
114 // 'Verifique seu email para efetuar a troca da senha.' 118 // 'Verifique seu email para efetuar a troca da senha.'
115 $rootScope.$broadcast(AUTH_EVENTS.forgotPasswordSuccess, response); 119 $rootScope.$broadcast(AUTH_EVENTS.forgotPasswordSuccess, response);
  120 +
116 return response; 121 return response;
117 }, function(response) { 122 }, function(response) {
118 // 'Não foi possível requisitar a troca de senha para os dados informados.' 123 // 'Não foi possível requisitar a troca de senha para os dados informados.'
119 $log.debug('AuthService.forgotPassword [FAIL] response', response); 124 $log.debug('AuthService.forgotPassword [FAIL] response', response);
120 $rootScope.$broadcast(AUTH_EVENTS.forgotPasswordFailed); 125 $rootScope.$broadcast(AUTH_EVENTS.forgotPasswordFailed);
  126 +
  127 + return response;
121 }); 128 });
122 } 129 }
123 130
src/app/components/category-list/category-list.directive.js
@@ -32,6 +32,17 @@ @@ -32,6 +32,17 @@
32 } 32 }
33 }; 33 };
34 34
  35 + CategoryListController.prototype._disableUnselect = function() {
  36 + var vm = this;
  37 +
  38 + if(vm.disableUnselect && vm.disableUnselect === 'true'){
  39 + return true;
  40 + }
  41 +
  42 + return false;
  43 + };
  44 +
  45 +
35 CategoryListController.prototype.selectCategory = function(category, $event) { 46 CategoryListController.prototype.selectCategory = function(category, $event) {
36 var vm = this; 47 var vm = this;
37 48
@@ -39,9 +50,14 @@ @@ -39,9 +50,14 @@
39 $event.stopPropagation(); 50 $event.stopPropagation();
40 51
41 if (category !== vm.selectedCategory) { 52 if (category !== vm.selectedCategory) {
42 - // selected new filter  
43 vm.selectedCategory = category; 53 vm.selectedCategory = category;
44 - } else { 54 + }else{
  55 +
  56 + if(vm._disableUnselect()){
  57 + vm.$log.info('Unselect is disabled.');
  58 + return;
  59 + }
  60 +
45 vm.selectedCategory = null; 61 vm.selectedCategory = null;
46 } 62 }
47 63
@@ -65,7 +81,8 @@ @@ -65,7 +81,8 @@
65 templateUrl: 'app/components/category-list/category-list.html', 81 templateUrl: 'app/components/category-list/category-list.html',
66 scope: { 82 scope: {
67 categories: '=', 83 categories: '=',
68 - selectedCategory: '=' 84 + selectedCategory: '=',
  85 + disableUnselect: '@'
69 }, 86 },
70 controller: CategoryListController, 87 controller: CategoryListController,
71 controllerAs: 'vm', 88 controllerAs: 'vm',
src/app/components/category-list/category-list.html
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 ng-click="vm.selectCategory(category, $event)"> 13 ng-click="vm.selectCategory(category, $event)">
14 14
15 <span class="category-list--icon-circle" aria-hidden="true" ng-class="category.slug"></span> 15 <span class="category-list--icon-circle" aria-hidden="true" ng-class="category.slug"></span>
16 - <span class="category-list--icon icon" aria-hidden="true" ng-class="'icon-tema-' + category.slug"></span> 16 + <span class="category-list--icon icon" aria-hidden="true" ng-class="'icon-tema-' + category.slug + '-small'"></span>
17 <span class="category-list--label">{{::category.name}}</span> 17 <span class="category-list--label">{{::category.name}}</span>
18 <span class="category-list--icon--right glyphicon glyphicon-chevron-right hidden-xs" ng-hide="vm.selectedCategory.slug === category.slug"></span> 18 <span class="category-list--icon--right glyphicon glyphicon-chevron-right hidden-xs" ng-hide="vm.selectedCategory.slug === category.slug"></span>
19 <span class="category-list--icon--right glyphicon glyphicon-remove hidden-xs" ng-show="vm.selectedCategory.slug === category.slug"></span> 19 <span class="category-list--icon--right glyphicon glyphicon-remove hidden-xs" ng-show="vm.selectedCategory.slug === category.slug"></span>
src/app/components/category-list/category-list.scss
@@ -79,9 +79,9 @@ @@ -79,9 +79,9 @@
79 79
80 .category-list--icon { 80 .category-list--icon {
81 position: absolute; 81 position: absolute;
82 - top: -16px;  
83 - left: -14px;  
84 - transform: scale(0.35); 82 + top: 6px;
  83 + left: 6px;
  84 + // transform: scale(0.4);
85 } 85 }
86 86
87 .category-list--icon--right { 87 .category-list--icon--right {
src/app/components/dialoga-service/dialoga.service.js
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 extendedService.getThemeBySlug = getThemeBySlug; 19 extendedService.getThemeBySlug = getThemeBySlug;
20 extendedService.getPrograms = getPrograms; 20 extendedService.getPrograms = getPrograms;
21 extendedService.getProgramBySlug = getProgramBySlug; 21 extendedService.getProgramBySlug = getProgramBySlug;
  22 + extendedService.getProgramsByThemeId = getProgramsByThemeId;
22 extendedService.getProgramsRandom = getProgramsRandom; 23 extendedService.getProgramsRandom = getProgramsRandom;
23 extendedService.getEvents = getEvents; // override 24 extendedService.getEvents = getEvents; // override
24 extendedService.getQuestions = getQuestions; 25 extendedService.getQuestions = getQuestions;
@@ -89,6 +90,7 @@ @@ -89,6 +90,7 @@
89 },cbError); 90 },cbError);
90 } 91 }
91 } 92 }
  93 +
92 function getThemeBySlug (slug, cbSuccess, cbError) { 94 function getThemeBySlug (slug, cbSuccess, cbError) {
93 if( !!CACHE.themes ){ 95 if( !!CACHE.themes ){
94 _getThemeBySlug(CACHE.themes); 96 _getThemeBySlug(CACHE.themes);
@@ -146,6 +148,28 @@ @@ -146,6 +148,28 @@
146 } 148 }
147 } 149 }
148 150
  151 + function getProgramsByThemeId (themeId, cbSuccess, cbError) {
  152 +
  153 + if( !CACHE.programs ){
  154 + getPrograms(_getProgramsByThemeId, cbError);
  155 + } else {
  156 + _getProgramsByThemeId();
  157 + }
  158 +
  159 + function _getProgramsByThemeId(){
  160 + var result = CACHE.programs.filter(function filterProgramBySlug (program) {
  161 + var category = program.categories[0];
  162 +
  163 + if(category && angular.equals(category.id, themeId)) {
  164 + return true;
  165 + }
  166 + return false;
  167 + });
  168 +
  169 + cbSuccess(result);
  170 + }
  171 + }
  172 +
149 // Ex.: /api/v1/dialoga_plugin/random_topics/103358 173 // Ex.: /api/v1/dialoga_plugin/random_topics/103358
150 // TODO: get endpoint for production 174 // TODO: get endpoint for production
151 // TODO: put at cache? 175 // TODO: put at cache?
@@ -202,8 +226,8 @@ @@ -202,8 +226,8 @@
202 ArticleService.searchTopics({query: query}, cbSuccess, cbError); 226 ArticleService.searchTopics({query: query}, cbSuccess, cbError);
203 } 227 }
204 228
205 - function searchProposals (query, cbSuccess, cbError) {  
206 - ArticleService.searchProposals({query: query}, cbSuccess, cbError); 229 + function searchProposals (params, cbSuccess, cbError) {
  230 + ArticleService.searchProposals(params, cbSuccess, cbError);
207 } 231 }
208 232
209 function _pipeHandleYoutube (data) { 233 function _pipeHandleYoutube (data) {
src/app/components/event-list/event-list.directive.js
@@ -40,13 +40,19 @@ @@ -40,13 +40,19 @@
40 vm.isCollapsed = !vm.isCollapsed; 40 vm.isCollapsed = !vm.isCollapsed;
41 }; 41 };
42 42
43 - EventListController.prototype.subscribe = function (event_id) { 43 + EventListController.prototype.subscribe = function (event) {
44 var vm = this; 44 var vm = this;
45 45
  46 + if(event.isOld){
  47 + vm.$log.debug('Event already happened. Abort.');
  48 + return;
  49 + }
  50 +
  51 + var event_id = event.id;
46 vm.$log.debug('event_id', event_id); 52 vm.$log.debug('event_id', event_id);
47 53
48 if(!vm.$rootScope.currentUser){ 54 if(!vm.$rootScope.currentUser){
49 - vm.$log.warn('User is not logged in. Redirect to Auth page.'); 55 + vm.$log.info('User is not logged in. Redirect to Auth page.');
50 vm.$state.go('entrar',{ 56 vm.$state.go('entrar',{
51 redirect_uri: 'state=inicio&task=subscribe&event_id=' + event_id 57 redirect_uri: 'state=inicio&task=subscribe&event_id=' + event_id
52 },{ 58 },{
src/app/components/event-list/event-list.html
@@ -11,10 +11,11 @@ @@ -11,10 +11,11 @@
11 Agenda <b>Dialoga Brasil</b> 11 Agenda <b>Dialoga Brasil</b>
12 </h1> 12 </h1>
13 </div> 13 </div>
14 - <div class="col-sm-6"> 14 + <div class="col-sm-6 text-right">
15 <h2 class="event-bar--trigger-toggle text-right"> 15 <h2 class="event-bar--trigger-toggle text-right">
16 - <span><b>18</b> bate papos <b>agendados</b></span>  
17 - <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span> 16 + <span><b>{{vm.events.length}}</b> bate papos <b>agendados</b></span>
  17 + <span ng-if="vm.isCollapsed" class="glyphicon glyphicon-menu-down" aria-hidden="true"></span>
  18 + <span ng-if="!vm.isCollapsed" class="glyphicon glyphicon-menu-up" aria-hidden="true"></span>
18 </h2> 19 </h2>
19 </div> 20 </div>
20 </div> 21 </div>
@@ -25,46 +26,36 @@ @@ -25,46 +26,36 @@
25 26
26 <section class="section-table"> 27 <section class="section-table">
27 <div class="container"> 28 <div class="container">
28 - <!-- <div class="event-tab--trigger" ng-show="vm.isCollapsed" ng-click="vm.toggleView()">  
29 - <div class="event-tab--header">  
30 - <div class="event-tab--icon">  
31 - <span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>  
32 - </div>  
33 - <div class="event-tab--title">Bate-Papo com ministr@s</div>  
34 - </div>  
35 - <button class="btn btn-link event-tab--button">  
36 - <span class="event-tab--total-scheduled">18</span>  
37 - <span>bate-papos agendados</span>  
38 - <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>  
39 - </button>  
40 - </div> -->  
41 -  
42 <div class="event-list--panel ng-hide" ng-show="!vm.isCollapsed"> 29 <div class="event-list--panel ng-hide" ng-show="!vm.isCollapsed">
43 <div class="event-list--table-wrapper"> 30 <div class="event-list--table-wrapper">
44 <div class="row row-level-1" ng-repeat="event in vm.events | orderBy:'start_date':false"> 31 <div class="row row-level-1" ng-repeat="event in vm.events | orderBy:'start_date':false">
45 - <div class="col-xs-12 col-sm-4 col-md-6 vcenter">  
46 - <span class="glyphicon glyphicon-calendar"></span>  
47 - <span class="date">{{event.start_date | date : "dd/MM/yyyy"}}</span>  
48 - <span class="separator">-</span>  
49 - <span class="glyphicon glyphicon-time"></span>  
50 - <span class="time">{{event.start_date | date : "HH:mm"}}</span>  
51 - <span class="separator">-</span>  
52 - <span class="description">{{::event.title}}</span> 32 + <div class="col-xs-12 col-sm-4 col-md-3 vcenter">
  33 + <span class="date-wrapper">
  34 + <span class="glyphicon glyphicon-calendar"></span>
  35 + <span class="date">{{event.start_date | date : "dd/MM/yyyy"}}</span>
  36 + </span>
  37 + <span class="time-wrapper">
  38 + <span class="glyphicon glyphicon-time"></span>
  39 + <span class="time">{{event.start_date | date : "HH:mm"}}</span>
  40 + </span>
53 </div> 41 </div>
54 - <div class="col-xs-12 col-sm-4 col-md-3 text-center vcenter">  
55 - <span class="theme">{{::event.categories[0].name}}</span> 42 + <div class="col-xs-12 col-sm-4 col-md-5 vcenter">
  43 + <span class="description">{{::event.title.split('-')[0]}}</span>
56 </div> 44 </div>
57 - <div class="col-xs-12 col-sm-4 col-md-3 text-right vcenter" style="padding-right: 20px;"> 45 + <!-- <div class="col-xs-12 col-sm-4 col-md-3 text-center vcenter">
  46 + <span class="theme">{{::event.categories[0].name}}</span>
  47 + </div> -->
  48 + <div class="col-xs-12 col-sm-4 col-md-4 text-right vcenter" style="padding-right: 20px;">
58 <div class="row"> 49 <div class="row">
59 - <div class="col-xs-6 text-right" ng-class="{'col-xs-12': event.isOld}"> 50 + <div class="col-xs-6 text-right">
60 <div ng-if="event.followers_count > 50"> 51 <div ng-if="event.followers_count > 50">
61 <b>{{::event.followers_count}}</b> 52 <b>{{::event.followers_count}}</b>
62 <br/> 53 <br/>
63 <span>Inscritos</span> 54 <span>Inscritos</span>
64 </div> 55 </div>
65 </div> 56 </div>
66 - <div class="col-xs-6" ng-if="!event.isOld">  
67 - <button type="button" class="btn color-theme-common-bg" ng-click="vm.subscribe(event.id)"> 57 + <div class="col-xs-6">
  58 + <button type="button" class="btn color-theme-common-bg btn-disabled" disabled ng-click="vm.subscribe(event)">
68 Inscreva-se 59 Inscreva-se
69 <span class="sr-only">no bate-papo com (ministro) no dia {event.start_date | date : "dd/MM/yyyy"}} as {{event.start_date | date : "HH:mm"}} horas</span> 60 <span class="sr-only">no bate-papo com (ministro) no dia {event.start_date | date : "dd/MM/yyyy"}} as {{event.start_date | date : "HH:mm"}} horas</span>
70 </button> 61 </button>
@@ -75,5 +66,17 @@ @@ -75,5 +66,17 @@
75 </div> 66 </div>
76 </div> 67 </div>
77 </div> 68 </div>
  69 + <div class="container visible-xs" ng-show="!vm.isCollapsed">
  70 + <div class="minimize" ng-click="vm.toggleView()">
  71 + <div class="row color-theme-common-bg">
  72 + <div class="col-xs-6">
  73 + <button type="button" class="btn btn-link" ng-click="">MINIMIZAR</button>
  74 + </div>
  75 + <div class="col-xs-5 text-right">
  76 + <span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span>
  77 + </div>
  78 + </div>
  79 + </div>
  80 + </div>
78 </section> 81 </section>
79 </div> 82 </div>
src/app/components/event-list/event-list.scss
@@ -10,37 +10,41 @@ @@ -10,37 +10,41 @@
10 } 10 }
11 11
12 .event-list--panel { 12 .event-list--panel {
13 - height: 310px;  
14 - padding: 0px;  
15 - margin: 20px 0;  
16 - line-height: 20px; 13 + width: 100%;
  14 + height: 240px;
  15 + margin: 8px 0;
  16 + padding: 0 20px;
  17 + overflow-x: hidden;
  18 + overflow-y: scroll;
17 transition: .3s linear all; 19 transition: .3s linear all;
18 - overflow: hidden;  
19 20
20 &.ng-hide { 21 &.ng-hide {
21 height: 0; 22 height: 0;
22 line-height: 0; 23 line-height: 0;
23 } 24 }
24 25
25 - // .event-list--header {  
26 - // border-bottom: 1px solid #333333;  
27 - // }  
28 -  
29 - // .event-list--icon {  
30 - // font-size: 25px;  
31 - // display: inline-block;  
32 - // }  
33 -  
34 - // .event-list--title {  
35 - // margin: 0 10px;  
36 - // display: inline-block;  
37 - // }  
38 -  
39 - // .event-list--minimize {  
40 - // display: inline-block;  
41 - // float: right;  
42 - // width: 100px;  
43 - // } 26 + .btn {
  27 + color: #e1e1e1;
  28 + text-transform: uppercase;
  29 + font-weight: bold;
  30 + }
  31 +
  32 + .row-level-1 {
  33 + // height: 48px;
  34 + line-height: 20px;
  35 + padding: 5px 0;
  36 + border-bottom: 1px solid #ccc;
  37 + }
  38 +
  39 + .row-level-1:last-child {
  40 + border-bottom: none;
  41 + }
  42 +
  43 +
  44 + @media screen and (max-width: $screen-sm) {
  45 + height: auto;
  46 + overflow: visible;
  47 + }
44 } 48 }
45 49
46 &--table{ 50 &--table{
@@ -61,10 +65,7 @@ @@ -61,10 +65,7 @@
61 line-height: 20px; 65 line-height: 20px;
62 cursor: pointer; 66 cursor: pointer;
63 67
64 - -webkit-transition: -webkit-transform 0.3s linear all;  
65 - -moz-transition: -moz-transform 0.3s linear all;  
66 - -o-transition: -o-transform 0.3s linear all;  
67 - transition: transform 0.3s linear all; 68 + transition: all 0.3s linear all;
68 69
69 overflow: hidden; 70 overflow: hidden;
70 z-index: 100; 71 z-index: 100;
@@ -90,38 +91,29 @@ @@ -90,38 +91,29 @@
90 91
91 .icon-circle { 92 .icon-circle {
92 font-size: 28px; 93 font-size: 28px;
  94 + line-height: 33px;
93 border-radius: 100%; 95 border-radius: 100%;
94 padding: 8px 8px 8px 10px; 96 padding: 8px 8px 8px 10px;
95 background-color: #fff; 97 background-color: #fff;
96 } 98 }
97 99
98 &-toggle { 100 &-toggle {
  101 + display: inline-block;
  102 + text-transform: uppercase;
  103 + font-size: 16px;
  104 +
99 .glyphicon { 105 .glyphicon {
100 position: relative; 106 position: relative;
101 top: 5px; 107 top: 5px;
  108 + font-size: 30px;
102 } 109 }
103 } 110 }
104 } 111 }
105 112
106 .event-list--panel { 113 .event-list--panel {
107 - width: 100%;  
108 - height: 260px;  
109 - overflow-y: scroll;  
110 -  
111 - .btn {  
112 - color: #e1e1e1;  
113 - text-transform: uppercase;  
114 - font-weight: bold;  
115 - }  
116 -  
117 - .row-level-1 {  
118 - padding: 5px 0;  
119 - border-top: 1px solid #ccc;  
120 - }  
121 -  
122 - .row-level-1:last-child {  
123 - border-bottom: 1px solid #ccc;  
124 - } 114 + .date-wrapper {margin-left: 16px; }
  115 + .time-wrapper {margin-left: 22px; }
  116 + // .description {margin-left: 22px; }
125 } 117 }
126 118
127 .event-tab--icon { 119 .event-tab--icon {
@@ -139,4 +131,18 @@ @@ -139,4 +131,18 @@
139 width: 100%; 131 width: 100%;
140 white-space: normal; 132 white-space: normal;
141 } 133 }
  134 +
  135 + .minimize {
  136 + cursor: pointer;
  137 +
  138 + .btn,
  139 + .glyphicon {
  140 + color: #fff;
  141 + font-weight: bold;
  142 + }
  143 +
  144 + .glyphicon {
  145 + line-height: 32px;
  146 + }
  147 + }
142 } 148 }
src/app/components/navbar/navbar.html
1 <div class="app-navbar"> 1 <div class="app-navbar">
2 - <div id="dialoga-nas-redes">  
3 - <div class="text text-right">  
4 - <p>Dialoga<br>Nas Redes</p>  
5 - </div>  
6 - <social-share></social-share>  
7 - </div>  
8 <nav id="navigation" class="header-navbar navbar navbar-static-top" role="navigation"> 2 <nav id="navigation" class="header-navbar navbar navbar-static-top" role="navigation">
9 <div class="navbar-header"> 3 <div class="navbar-header">
10 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"> 4 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
@@ -15,7 +9,6 @@ @@ -15,7 +9,6 @@
15 </button> 9 </button>
16 <a class="navbar-brand" ui-sref="inicio"> 10 <a class="navbar-brand" ui-sref="inicio">
17 <img src="/assets/images/logo.png" alt="Dialoga Brasil | O país fica melhor quando você participa" /> 11 <img src="/assets/images/logo.png" alt="Dialoga Brasil | O país fica melhor quando você participa" />
18 - <!-- <span class="glyphicon glyphicon-home"></span> Início -->  
19 </a> 12 </a>
20 </div> 13 </div>
21 14
@@ -29,48 +22,41 @@ @@ -29,48 +22,41 @@
29 <li role="separator" class="divider hidden-xs hidden-sm"><span>|</span></li> 22 <li role="separator" class="divider hidden-xs hidden-sm"><span>|</span></li>
30 <li class="dropdown"> 23 <li class="dropdown">
31 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Compartilhar <span aria-hidden="true" class="icon icon-social-share-small"></span></a> 24 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Compartilhar <span aria-hidden="true" class="icon icon-social-share-small"></span></a>
32 - <social-share class="dropdown-menu dropdown-menu-right"></social-share>  
33 - <!-- <ul class="dropdown-menu dropdown-menu-right dropdown-menu-social">  
34 - <li>  
35 - <a socialshare  
36 - socialshare-provider="facebook"  
37 - socialshare-url="http://dialoga.gov.br"  
38 - socialshare-text="Conheça o Dialoga Brasil. Dialoga Brasil | O País fica melhor quando VOCÊ PARTICIPA."  
39 - title="Compartilhar no Facebook">  
40 - <span class="icon-circle icon-small icon-circle-social-facebook"><span class="icon icon-social-facebook"></span></span>  
41 - <span class="sr-only">Compartilhar no Facebook</span>  
42 - </a>  
43 - </li>  
44 - <li>  
45 - <a socialshare  
46 - socialshare-provider="twitter"  
47 - socialshare-url="http://dialoga.gov.br"  
48 - socialshare-text="Conheça o Dialoga Brasil. Dialoga Brasil | O País fica melhor quando VOCÊ PARTICIPA."  
49 - socialshare-hastags="dialogabrasil"  
50 - title="Compartilhar no Twitter">  
51 - <span class="icon-circle icon-small icon-circle-social-twitter"><span class="icon icon-social-twitter"></span></span>  
52 - <span class="sr-only">Compartilhar no Twitter</span>  
53 - </a>  
54 - </li>  
55 - <li>  
56 - <a socialshare  
57 - socialshare-provider="gplus"  
58 - socialshare-url="http://dialoga.gov.br"  
59 - socialshare-text="Conheça o Dialoga Brasil. Dialoga Brasil | O País fica melhor quando VOCÊ PARTICIPA."  
60 - title="Compartilhar no Google Plus">  
61 - <span class="icon-circle icon-small icon-circle-social-googleplus"><span class="icon icon-social-googleplus"></span></span>  
62 - <span class="sr-only">Compartilhar no Google Plus</span>  
63 - </a>  
64 - </li>  
65 - <li>  
66 - <a href="mailto:contato@dialoga.gov.br?subject=Conheça o Dialoga Brasil" title="Enviar por email">  
67 - <span class="icon-circle icon-small icon-circle-social-whatsapp"><span class="icon icon-social-whatsapp"></span></span>  
68 - <span class="sr-only">Enviar por email</span>  
69 - </a>  
70 - </li>  
71 - </ul> --> 25 + <social-share class="dropdown-menu dropdown-menu-right" arrow-class="social-share--arrow"></social-share>
72 </li> 26 </li>
73 </ul> 27 </ul>
74 </div> 28 </div>
75 </nav> 29 </nav>
  30 +
  31 + <div id="dialoga-nas-redes">
  32 + <div class="text text-right">
  33 + <p>DIALOGA<br><b>NAS REDES</b></p>
  34 + </div>
  35 + <ul class="social-share list-inline">
  36 + <li>
  37 + <a href="https://www.facebook.com/DialogaBrasil" target="_blank">
  38 + <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-facebook"><span class="icon icon-social-facebook"></span></span>
  39 + <span class="sr-only">Visitar perfil no Facebook</span>
  40 + </a>
  41 + </li>
  42 + <li>
  43 + <a href="https://twitter.com/dialogabrasil" target="_blank">
  44 + <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-twitter"><span class="icon icon-social-twitter"></span></span>
  45 + <span class="sr-only">Visitar perfil no Twitter</span>
  46 + </a>
  47 + </li>
  48 + <li>
  49 + <a href="https://www.youtube.com/channel/UCtjaJwOWwGu2legqFVAzhIA" target="_blank">
  50 + <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-youtube"><span class="icon icon-social-youtube"></span></span>
  51 + <span class="sr-only">Visitar canal no Youtube</span>
  52 + </a>
  53 + </li>
  54 + <li>
  55 + <a href="https://www.flickr.com/photos/dialogabrasil" target="_blank">
  56 + <span aria-hidden="true" class="icon-circle icon-small icon-circle-social-flickr"><span class="icon icon-social-flickr"></span></span>
  57 + <span class="sr-only">Visitar canal no Flickr</span>
  58 + </a>
  59 + </li>
  60 + </ul>
  61 + </div>
76 </div> 62 </div>
src/app/components/proposal-box/proposal-box.directive.js
@@ -34,6 +34,10 @@ @@ -34,6 +34,10 @@
34 vm.errorOnSkip = false; 34 vm.errorOnSkip = false;
35 vm.showAuthMessage = null; 35 vm.showAuthMessage = null;
36 vm.voteProposalRedirectURI = null; 36 vm.voteProposalRedirectURI = null;
  37 +
  38 + var slug = vm.topic.slug;
  39 + var proposal_id = vm.proposal.id;
  40 + vm.voteProposalRedirectURI = 'state=programa&task=vote-proposal&slug=' + slug + '&proposal_id=' + proposal_id;
37 }; 41 };
38 42
39 ProposalBoxController.prototype.addListeners = function () { 43 ProposalBoxController.prototype.addListeners = function () {
@@ -64,14 +68,6 @@ @@ -64,14 +68,6 @@
64 68
65 vm.message = data.message; 69 vm.message = data.message;
66 }); 70 });
67 -  
68 - vm.$scope.$watch('vm.voteProposalRedirectURI', function(newValue, oldValue){  
69 - if(newValue && newValue !== oldValue){  
70 - var slug = vm.topic.slug;  
71 - var proposal_id = vm.proposal.id;  
72 - vm.voteProposalRedirectURI = 'state=programa&task=vote-proposal&slug=' + slug + '&proposal_id=' + proposal_id;  
73 - }  
74 - });  
75 }; 71 };
76 72
77 ProposalBoxController.prototype.showContent = function (slug) { 73 ProposalBoxController.prototype.showContent = function (slug) {
src/app/components/proposal-box/proposal-box.html
@@ -75,7 +75,6 @@ @@ -75,7 +75,6 @@
75 <p>Você precisa estar logado para votar na proposta</p> 75 <p>Você precisa estar logado para votar na proposta</p>
76 <br> 76 <br>
77 <p> 77 <p>
78 - <!-- <a ui-sref="entrar({redirect_uri: vm.voteProposalRedirectURI})">Clique aqui</a> para ir para a página de login. -->  
79 <a ui-sref="entrar({redirect_uri: vm.voteProposalRedirectURI})">Clique aqui para ir para a página de login</a> 78 <a ui-sref="entrar({redirect_uri: vm.voteProposalRedirectURI})">Clique aqui para ir para a página de login</a>
80 </p> 79 </p>
81 </div> 80 </div>
@@ -95,9 +94,8 @@ @@ -95,9 +94,8 @@
95 <div ng-show="!vm.errorOnSkip"> 94 <div ng-show="!vm.errorOnSkip">
96 <p>Carregando...</p> 95 <p>Carregando...</p>
97 </div> 96 </div>
98 - <div ng-show="!vm.errorOnSkip"> 97 + <div ng-show="vm.errorOnSkip">
99 <p>Erro ao carregar nova proposta proposta.</p> 98 <p>Erro ao carregar nova proposta proposta.</p>
100 - <p>{{vm.errorOnSkip}}</p>  
101 </div> 99 </div>
102 </div> 100 </div>
103 </div> 101 </div>
@@ -117,7 +115,6 @@ @@ -117,7 +115,6 @@
117 <div ng-hide="vm.canVote" class="proposal-box--join"> 115 <div ng-hide="vm.canVote" class="proposal-box--join">
118 <button class="btn btn-link color-theme-common-fg" ng-click="vm.showContent(vm.topic.slug)"> 116 <button class="btn btn-link color-theme-common-fg" ng-click="vm.showContent(vm.topic.slug)">
119 Participe 117 Participe
120 - <span class="glyphicon glyphicon-menu-right color-theme-common-fg" aria-hidde="true"></span>  
121 </button> 118 </button>
122 </div> 119 </div>
123 <div ng-show="vm.canVote" class="proposal-box--actions text-center"> 120 <div ng-show="vm.canVote" class="proposal-box--actions text-center">
src/app/components/proposal-box/proposal-box.scss
@@ -69,6 +69,7 @@ @@ -69,6 +69,7 @@
69 .proposal-box--join { 69 .proposal-box--join {
70 .btn { 70 .btn {
71 font-weight: bold; 71 font-weight: bold;
  72 + padding: 6px 0;
72 } 73 }
73 } 74 }
74 75
src/app/components/proposal-carousel/proposal-carousel.directive.js
@@ -9,11 +9,12 @@ @@ -9,11 +9,12 @@
9 function proposalCarousel() { 9 function proposalCarousel() {
10 10
11 /** @ngInject */ 11 /** @ngInject */
12 - function ProposalCarouselController($scope, $element, $timeout, $log) { 12 + function ProposalCarouselController($scope, $state, $element, $timeout, $log) {
13 $log.debug('ProposalCarouselController'); 13 $log.debug('ProposalCarouselController');
14 14
15 var vm = this; 15 var vm = this;
16 vm.$scope = $scope; 16 vm.$scope = $scope;
  17 + vm.$state = $state;
17 vm.$element = $element; 18 vm.$element = $element;
18 vm.$timeout = $timeout; 19 vm.$timeout = $timeout;
19 vm.$log = $log; 20 vm.$log = $log;
@@ -63,6 +64,18 @@ @@ -63,6 +64,18 @@
63 vm.$scope.$emit('proposal-carousel:showProposalsList'); 64 vm.$scope.$emit('proposal-carousel:showProposalsList');
64 }; 65 };
65 66
  67 + ProposalCarouselController.prototype.showContent = function (proposal) {
  68 + var vm = this;
  69 +
  70 + vm.$state.go('programa', {
  71 + slug: proposal.parent.slug,
  72 + proposal_id: proposal.id
  73 + }, {
  74 + location: true,
  75 + reload: true
  76 + });
  77 + };
  78 +
66 var directive = { 79 var directive = {
67 restrict: 'E', 80 restrict: 'E',
68 templateUrl: 'app/components/proposal-carousel/proposal-carousel.html', 81 templateUrl: 'app/components/proposal-carousel/proposal-carousel.html',
src/app/components/proposal-carousel/proposal-carousel.html
@@ -16,7 +16,15 @@ @@ -16,7 +16,15 @@
16 <div class="proposal-carousel-middle" ng-swipe-left="vm.swipeLeft()" ng-swipe-right="vm.swipeRight()"> 16 <div class="proposal-carousel-middle" ng-swipe-left="vm.swipeLeft()" ng-swipe-right="vm.swipeRight()">
17 <div ng-repeat="proposal in vm.proposals" class="animation-swipe"> 17 <div ng-repeat="proposal in vm.proposals" class="animation-swipe">
18 <div class="content"> 18 <div class="content">
19 - <div ng-show="vm.activeIndex === $index">{{::proposal.abstract}}</div> 19 + <div ng-show="vm.activeIndex === $index">
  20 + <div class="inner">{{::proposal.abstract}}</div>
  21 + </div>
  22 + </div>
  23 + <div class="join" ng-show="vm.activeIndex === $index">
  24 + <button type="button" class="btn btn-link btn-rate color-theme-common-fg" ng-click="vm.showContent(proposal)">
  25 + Participe
  26 + <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  27 + </button>
20 </div> 28 </div>
21 <div class="proposal-carousel-middle-watermark" ng-show="vm.activeIndex === $index"> 29 <div class="proposal-carousel-middle-watermark" ng-show="vm.activeIndex === $index">
22 <span>{{::($index+1)}}º</span> 30 <span>{{::($index+1)}}º</span>
@@ -26,7 +34,7 @@ @@ -26,7 +34,7 @@
26 <div class="proposal-carousel-bottom color-theme-common-bg" ng-click="vm.showProposalsList()"> 34 <div class="proposal-carousel-bottom color-theme-common-bg" ng-click="vm.showProposalsList()">
27 <div>Veja as propostas mais votadas</div> 35 <div>Veja as propostas mais votadas</div>
28 <div class="proposal-carousel-bottom-icon"> 36 <div class="proposal-carousel-bottom-icon">
29 - <span class="glyphicon glyphicon-chevron-down pull-right color-theme-common-fg"></span> 37 + <span class="glyphicon glyphicon-chevron-down pull-right color-theme-common-fg" aria-hidden="true"></span>
30 </div> 38 </div>
31 </div> 39 </div>
32 </div> 40 </div>
src/app/components/proposal-carousel/proposal-carousel.scss
@@ -9,12 +9,12 @@ @@ -9,12 +9,12 @@
9 color: #fff; 9 color: #fff;
10 font-weight: bold; 10 font-weight: bold;
11 font-size: 25px; 11 font-size: 25px;
12 - padding: 20px 15px; 12 + padding: 10px 15px;
13 13
14 &-triggers { 14 &-triggers {
15 position: absolute; 15 position: absolute;
16 right: 15px; 16 right: 15px;
17 - top: 20px; 17 + top: 8px;
18 18
19 button { 19 button {
20 border: 1px solid #fff; 20 border: 1px solid #fff;
@@ -46,14 +46,26 @@ @@ -46,14 +46,26 @@
46 46
47 .content { 47 .content {
48 position: relative; 48 position: relative;
49 - z-index: 2; 49 + z-index: 10;
  50 + }
  51 +
  52 + .join {
  53 + position: absolute;
  54 + bottom: 32px;
  55 + z-index: 10;
  56 +
  57 + .btn {
  58 + padding: 0;
  59 + font-weight: bold;
  60 + font-size: 16px;
  61 + }
50 } 62 }
51 63
52 &-watermark { 64 &-watermark {
53 position: absolute; 65 position: absolute;
54 bottom: 1px; 66 bottom: 1px;
55 left: -5px; 67 left: -5px;
56 - color: #ddd; 68 + color: #e6e6e6;
57 font-size: 150px; 69 font-size: 150px;
58 font-weight: bold; 70 font-weight: bold;
59 line-height: 116px; 71 line-height: 116px;
src/app/components/proposal-list/proposal-list.directive.js
@@ -9,20 +9,16 @@ @@ -9,20 +9,16 @@
9 function proposalList() { 9 function proposalList() {
10 10
11 /** @ngInject */ 11 /** @ngInject */
12 - function ProposalListController(ArticleService, $state, $scope, $element, $timeout, $log) { 12 + function ProposalListController($state, $element, $timeout, $log) {
13 $log.debug('ProposalListController'); 13 $log.debug('ProposalListController');
14 14
15 var vm = this; 15 var vm = this;
16 - vm.ArticleService = ArticleService;  
17 vm.$state = $state; 16 vm.$state = $state;
18 - vm.$scope = $scope;  
19 vm.$element = $element; 17 vm.$element = $element;
20 vm.$timeout = $timeout; 18 vm.$timeout = $timeout;
21 vm.$log = $log; 19 vm.$log = $log;
22 20
23 vm.init(); 21 vm.init();
24 - vm.loadData();  
25 - vm.attachListeners();  
26 } 22 }
27 23
28 ProposalListController.prototype.init = function () { 24 ProposalListController.prototype.init = function () {
@@ -33,75 +29,11 @@ @@ -33,75 +29,11 @@
33 throw { name: 'NotDefined', message: 'The attribute "proposals" is undefined.'}; 29 throw { name: 'NotDefined', message: 'The attribute "proposals" is undefined.'};
34 } 30 }
35 31
36 - if(!vm.perPage){  
37 - vm.perPage = 5;  
38 - }  
39 -  
40 - vm.initPorposalList();  
41 - };  
42 -  
43 - ProposalListController.prototype.initPorposalList = function () {  
44 - var vm = this;  
45 -  
46 - vm.currentPageIndex = 0;  
47 -  
48 - vm.proposalsPerPage = vm.getProposalsPerPage(0);  
49 -  
50 - vm.proposalsLength = vm.proposals.length;  
51 -  
52 -  
53 - if ((vm.proposalsLength % vm.perPage) === 0) {  
54 - vm.pages = vm.proposalsLength / vm.perPage;  
55 - } else{  
56 - vm.pages = (vm.proposalsLength / vm.perPage) + 1;  
57 - }  
58 -  
59 - // vm.arraypages = new Array(Math.ceil(vm.pages));  
60 - vm.arraypages = new Array(Math.floor(vm.pages));  
61 - };  
62 -  
63 - ProposalListController.prototype.loadData = function () {  
64 - // async values  
65 - var vm = this;  
66 -  
67 - // requeue to wait until DOM be created  
68 vm.$timeout(function(){ 32 vm.$timeout(function(){
69 attachPopover.call(vm); 33 attachPopover.call(vm);
70 }, 1000); 34 }, 1000);
71 }; 35 };
72 36
73 - ProposalListController.prototype.attachListeners = function () {  
74 - var vm = this;  
75 -  
76 - vm.$scope.$watch('vm.proposals', function(/*newValue, oldValue*/) {  
77 - vm.initPorposalList();  
78 - });  
79 - };  
80 -  
81 - ProposalListController.prototype.getProposalsPerPage = function (pageIndex) {  
82 - var vm = this;  
83 -  
84 - var initialIndex = pageIndex * vm.perPage;  
85 - var finalIndex = initialIndex + vm.perPage;  
86 -  
87 - return vm.proposals.slice(initialIndex, finalIndex);  
88 - };  
89 -  
90 - ProposalListController.prototype.showPage = function (pageIndex) {  
91 - var vm = this;  
92 -  
93 - if (pageIndex < 0) {  
94 - pageIndex = 0;  
95 - }  
96 -  
97 - if (pageIndex > (vm.arraypages.length-1)) {  
98 - pageIndex = vm.arraypages.length-1;  
99 - }  
100 -  
101 - vm.proposalsPerPage = vm.getProposalsPerPage(pageIndex);  
102 - vm.currentPageIndex = pageIndex;  
103 - };  
104 -  
105 ProposalListController.prototype.showContent = function (proposal) { 37 ProposalListController.prototype.showContent = function (proposal) {
106 var vm = this; 38 var vm = this;
107 39
@@ -131,8 +63,7 @@ @@ -131,8 +63,7 @@
131 restrict: 'E', 63 restrict: 'E',
132 templateUrl: 'app/components/proposal-list/proposal-list.html', 64 templateUrl: 'app/components/proposal-list/proposal-list.html',
133 scope: { 65 scope: {
134 - proposals: '=',  
135 - perPage: '=' 66 + proposals: '='
136 }, 67 },
137 controller: ProposalListController, 68 controller: ProposalListController,
138 controllerAs: 'vm', 69 controllerAs: 'vm',
src/app/components/proposal-list/proposal-list.html
1 <div class="proposal-list"> 1 <div class="proposal-list">
2 - <div class="" ng-if="vm.loading">  
3 - <div class="">Carregando...</div>  
4 - </div>  
5 - <div class="" ng-if="!vm.loading && vm.proposalsPerPage"> 2 + <div class="" ng-if="vm.proposals">
6 <table class="table table-striped"> 3 <table class="table table-striped">
7 <thead> 4 <thead>
8 <tr> 5 <tr>
@@ -14,7 +11,7 @@ @@ -14,7 +11,7 @@
14 </tr> 11 </tr>
15 </thead> 12 </thead>
16 <tbody> 13 <tbody>
17 - <tr ng-repeat="proposal in vm.proposalsPerPage"> 14 + <tr ng-repeat="proposal in vm.proposals">
18 <td class="color-theme-fg"> 15 <td class="color-theme-fg">
19 <span class="position">{{::proposal.ranking_position}}º</span> 16 <span class="position">{{::proposal.ranking_position}}º</span>
20 </td> 17 </td>
@@ -38,22 +35,5 @@ @@ -38,22 +35,5 @@
38 </tr> 35 </tr>
39 </tbody> 36 </tbody>
40 </table> 37 </table>
41 - <nav ng-if="vm.arraypages.length > 1">  
42 - <ul class="pagination">  
43 - <li ng-style="{'visibility': (vm.currentPageIndex === 0) ? 'hidden' : 'visible'}">  
44 - <a class="btn-pagination" href="#" aria-label="Previous" ng-click="vm.showPage(vm.currentPageIndex-1)">  
45 - <span aria-hidden="true" class="glyphicon glyphicon-chevron-left pagination-icon"></span>  
46 - </a>  
47 - </li>  
48 - <li ng-repeat="paginas in vm.arraypages track by $index" ng-class="{ 'active' : ($index) == vm.currentPageIndex }" >  
49 - <a class="btn-pagination" href="#" ng-click="vm.showPage($index)">{{::($index)+1}}</a>  
50 - </li>  
51 - <li ng-style="{'visibility': (vm.currentPageIndex === (vm.arraypages.length -1)) ? 'hidden' : 'visible'}">  
52 - <a class="btn-pagination" href="#" aria-label="Next" ng-click="vm.showPage(vm.currentPageIndex+1)">  
53 - <span aria-hidden="true" class="glyphicon glyphicon-chevron-right pagination-icon"></span>  
54 - </a>  
55 - </li>  
56 - </ul>  
57 - </nav>  
58 </div> 38 </div>
59 </div> 39 </div>
src/app/components/proposal-list/proposal-list.scss
@@ -80,45 +80,4 @@ @@ -80,45 +80,4 @@
80 } 80 }
81 } 81 }
82 82
83 - .btn-pagination {  
84 - background-color: transparent;  
85 - border: none;  
86 - border-radius: 100%;  
87 - font-weight: bold;  
88 - font-size: 20px;  
89 - padding: 0px 8px;  
90 - width: 28px;  
91 - height: 28px;  
92 - text-decoration: underline;  
93 - color: $defaultblue;  
94 - }  
95 -  
96 - .pagination-icon {  
97 - color: $defaultblue;  
98 - }  
99 -  
100 - .pagination > .active > a,  
101 - .pagination > .active > a:hover,  
102 - .pagination > .active > a:focus,  
103 - .pagination > .active > span,  
104 - .pagination > .active > span:hover,  
105 - .pagination > .active > span:focus {  
106 - background-color: $defaultblue;  
107 - text-decoration: none;  
108 -  
109 - }  
110 -  
111 - .pagination > .disabled > span,  
112 - .pagination > .disabled > span:hover,  
113 - .pagination > .disabled > span:focus,  
114 - .pagination > .disabled > a,  
115 - .pagination > .disabled > a:hover,  
116 - .pagination > .disabled > a:focus {  
117 - background-color: transparent;  
118 - }  
119 -  
120 - nav {  
121 - text-align: center;  
122 - }  
123 -  
124 } 83 }
src/app/components/proposal-stats/proposal-stats.html
1 <div class="proposal-stats"> 1 <div class="proposal-stats">
2 <ul class="list-inline"> 2 <ul class="list-inline">
3 - <li class="proposal-stats-views">  
4 - <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>  
5 - <span>{{proposal.hits}}</span>  
6 - </li>  
7 <li class="proposal-stats-up"> 3 <li class="proposal-stats-up">
8 <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> 4 <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
9 <span>{{proposal.votes_for}}</span> 5 <span>{{proposal.votes_for}}</span>
@@ -12,5 +8,9 @@ @@ -12,5 +8,9 @@
12 <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> 8 <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
13 <span>{{proposal.votes_against}}</span> 9 <span>{{proposal.votes_against}}</span>
14 </li> 10 </li>
  11 + <li class="proposal-stats-views">
  12 + <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
  13 + <span>{{proposal.hits}}</span>
  14 + </li>
15 </ul> 15 </ul>
16 </div> 16 </div>
src/app/components/social-share/social-share.directive.js
@@ -14,6 +14,7 @@ @@ -14,6 +14,7 @@
14 url: '=', 14 url: '=',
15 image: '=', 15 image: '=',
16 text: '=', 16 text: '=',
  17 + arrowClass: '@',
17 }, 18 },
18 controller: SocialShareController, 19 controller: SocialShareController,
19 controllerAs: 'vm', 20 controllerAs: 'vm',
src/app/components/social-share/social-share.html
  1 +<div ng-if="vm.arrowClass">
  2 + <div ng-class="vm.arrowClass"></div>
  3 +</div>
1 <ul class="social-share list-inline"> 4 <ul class="social-share list-inline">
2 <li> 5 <li>
  6 + <!-- socialshare-via="687948707977695" -->
3 <a href="#" role="button" 7 <a href="#" role="button"
4 socialshare 8 socialshare
5 socialshare-provider="facebook" 9 socialshare-provider="facebook"
src/app/components/social-share/social-share.scss
1 .social-share { 1 .social-share {
2 - min-width: 200px; 2 + min-width: 205px;
3 padding: 5px; 3 padding: 5px;
4 - height: 47px; 4 + height: 50px;
5 5
6 &:after { 6 &:after {
7 clear: both; 7 clear: both;
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 margin: 0; 16 margin: 0;
17 width: 45px; 17 width: 45px;
18 text-align: center; 18 text-align: center;
  19 + transform: scale(0.9);
19 20
20 & > a { 21 & > a {
21 padding: 0; 22 padding: 0;
@@ -25,5 +26,46 @@ @@ -25,5 +26,46 @@
25 // margin-left: 5px; 26 // margin-left: 5px;
26 } 27 }
27 } 28 }
  29 +
  30 + .dropdown-menu & {
  31 +
  32 + // .dropdown-menu .social-share
  33 + background-color: #E0E0E0;
  34 + border-radius: 5px;
  35 +
  36 + @media screen and (max-width: $screen-xs) {
  37 + background-color: #fff;
  38 + }
  39 +
  40 + li {
  41 + margin: 0 2px;
  42 +
  43 + &:first-child { margin-left: 0;}
  44 + &:last-child { margin-right: 0;}
  45 + }
  46 + }
28 } 47 }
29 48
  49 +.social-share--arrow {
  50 + position: absolute;
  51 + width: 0;
  52 + height: 0;
  53 + border-color: transparent;
  54 + border-style: solid;
  55 +
  56 + .dropdown-menu-right & {
  57 + top: -10px;
  58 + right: 20px;
  59 + border-width: 0 10px 10px;
  60 + border-bottom-color: #E0E0E0;
  61 + }
  62 +
  63 + @media screen and (max-width: $screen-xs) {
  64 + display: none;
  65 + }
  66 +}
  67 +
  68 +.dropdown-menu {
  69 + box-shadow: none;
  70 + border: none;
  71 +}
src/app/components/topic-list/topic-list.directive.js
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 var vm = this; 31 var vm = this;
32 32
33 if (!vm.article) { 33 if (!vm.article) {
34 - vm.$log.warn('no article to display. Tip: use a ng-if before use this directive'); 34 + vm.$log.debug('no article to display. Tip: use a ng-if before use this directive');
35 return; 35 return;
36 } 36 }
37 37
src/app/components/topics-select/topics-select.directive.js 0 → 100644
@@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
  1 +(function() {
  2 + 'use strict';
  3 +
  4 + angular
  5 + .module('dialoga')
  6 + .directive('topicsSelect', topicsSelect);
  7 +
  8 + /** @ngInject */
  9 + function topicsSelect() {
  10 +
  11 + /** @ngInject */
  12 + function TopicsSelectController($rootScope, $log) {
  13 + $log.debug('TopicsSelectController');
  14 +
  15 + // alias
  16 + var vm = this;
  17 +
  18 + // dependencies
  19 + vm.$rootScope = $rootScope;
  20 + vm.$log = $log;
  21 +
  22 + // initialization
  23 + vm.init();
  24 + }
  25 +
  26 + TopicsSelectController.prototype.init = function() {
  27 + // var vm = this;
  28 + };
  29 +
  30 + TopicsSelectController.prototype.selectTopic = function() {
  31 + var vm = this;
  32 +
  33 + if (vm.selectedTopic === null) {
  34 + vm.$log.debug('Default topic selected.');
  35 + return;
  36 + }
  37 +
  38 + // send event to all controllers
  39 + vm.$rootScope.$broadcast('change-selectedTopic', vm.selectedTopic);
  40 + };
  41 +
  42 + var directive = {
  43 + restrict: 'E',
  44 + templateUrl: 'app/components/topics-select/topics-select.html',
  45 + scope: {
  46 + topics: '=',
  47 + selectedTopic: '='
  48 + },
  49 + controller: TopicsSelectController,
  50 + controllerAs: 'vm',
  51 + bindToController: true
  52 + };
  53 +
  54 + return directive;
  55 + }
  56 +
  57 +})();
src/app/components/topics-select/topics-select.html 0 → 100644
@@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
  1 +<div class="topics-dropdown">
  2 + <select
  3 + ng-model="vm.selectedTopic"
  4 + ng-change="vm.selectTopic()"
  5 + ng-options="topic.title for topic in vm.topics track by topic.slug"
  6 + class="form-control">
  7 + </select>
  8 +</div>
src/app/components/util-service/utils.service.js
@@ -48,6 +48,7 @@ @@ -48,6 +48,7 @@
48 */ 48 */
49 function handleSuccess (response) { 49 function handleSuccess (response) {
50 $log.debug('[SUCCESS]', response); 50 $log.debug('[SUCCESS]', response);
  51 + response.data._obj = response;
51 return response.data; 52 return response.data;
52 } 53 }
53 54
src/app/index.constants.js
@@ -8,6 +8,10 @@ @@ -8,6 +8,10 @@
8 host: 'http://hom.dialoga.gov.br', 8 host: 'http://hom.dialoga.gov.br',
9 image: 'http://hom.login.dialoga.gov.br' 9 image: 'http://hom.login.dialoga.gov.br'
10 }) 10 })
  11 + .constant('APP', {
  12 + facebook_app_id: '1',
  13 + google_app_id: '4',
  14 + })
11 .constant('API', { 15 .constant('API', {
12 token: null, 16 token: null,
13 articleId: { 17 articleId: {
@@ -33,15 +37,24 @@ @@ -33,15 +37,24 @@
33 notAuthorized: 'auth-not-authorized' 37 notAuthorized: 'auth-not-authorized'
34 }) 38 })
35 .constant('VOTE_STATUS', { 39 .constant('VOTE_STATUS', {
36 - SUCCESS: 0x1,  
37 - ERROR: 0x10,  
38 - LOADING: 0x100 40 + SUCCESS: 1,
  41 + ERROR: 2,
  42 + LOADING: 4,
  43 + LOADED: 8
39 }) 44 })
40 .constant('VOTE_OPTIONS', { 45 .constant('VOTE_OPTIONS', {
41 UP: 1, 46 UP: 1,
42 DOWN: -1, 47 DOWN: -1,
43 SKIP: 0 48 SKIP: 0
44 }) 49 })
  50 + .constant('PROPOSAL_STATUS', {
  51 + SUCCESS: 1,
  52 + ERROR: 2,
  53 + LOADING: 4,
  54 + LOADED: 8,
  55 + SENDING: 16,
  56 + SENT: 32
  57 + })
45 .constant('USER_ROLES', { 58 .constant('USER_ROLES', {
46 all: '*', 59 all: '*',
47 admin: 'admin', 60 admin: 'admin',
src/app/index.route.js
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 }) 33 })
34 .state('recuperar', { 34 .state('recuperar', {
35 url: '/recuperar', 35 url: '/recuperar',
36 - ncyBreadcrumb: {label: 'Recuperar'}, 36 + ncyBreadcrumb: {label: 'Recuperar senha'},
37 views: { 37 views: {
38 'main': { 38 'main': {
39 templateUrl: 'app/pages/auth/recover.html', 39 templateUrl: 'app/pages/auth/recover.html',
@@ -106,26 +106,12 @@ @@ -106,26 +106,12 @@
106 .state('ranking', { 106 .state('ranking', {
107 url: '/ranking?tema&programa&filtro', 107 url: '/ranking?tema&programa&filtro',
108 reloadOnSearch: false, 108 reloadOnSearch: false,
109 - ncyBreadcrumb: {label: 'Propostas'}, 109 + ncyBreadcrumb: {label: 'Ranking'},
110 views: { 110 views: {
111 'main': { 111 'main': {
112 - templateUrl: 'app/pages/propostas/ranking.html',  
113 - controller: 'PropostasPageController',  
114 - controllerAs: 'pagePropostas'  
115 - }  
116 - }  
117 - })  
118 - .state('propostas-conteudo', {  
119 - url: '/propostas/:id',  
120 - ncyBreadcrumb: {  
121 - label: '{{$parent.$root.contentTitle}}',  
122 - parent: 'propostas'  
123 - },  
124 - views: {  
125 - 'main': {  
126 - templateUrl: 'app/pages/propostas/proposta.html',  
127 - controller: 'PropostasPageController',  
128 - controllerAs: 'pagePropostas' 112 + templateUrl: 'app/pages/ranking/ranking.html',
  113 + controller: 'RankingPageController',
  114 + controllerAs: 'pageRanking'
129 } 115 }
130 } 116 }
131 }) 117 })
@@ -151,19 +137,7 @@ @@ -151,19 +137,7 @@
151 } 137 }
152 } 138 }
153 }) 139 })
154 - .state('termos-de-uso', {  
155 - url: '/termos-de-uso',  
156 - ncyBreadcrumb: {label: 'Termos de Uso'},  
157 - controller: 'ArticlePageController',  
158 - views: {  
159 - 'main': {  
160 - templateUrl: 'app/pages/article/article.html',  
161 - controller: 'ArticlePageController',  
162 - controllerAs: 'pageArticle'  
163 - }  
164 - }  
165 - })  
166 - .state('mapa-do-site', { 140 + .state('mapa-do-site', {
167 url: '/mapa-do-site', 141 url: '/mapa-do-site',
168 ncyBreadcrumb: {label: 'Mapa do Site'}, 142 ncyBreadcrumb: {label: 'Mapa do Site'},
169 views: { 143 views: {
src/app/index.run.js
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 } 81 }
82 82
83 /** @ngInject */ 83 /** @ngInject */
84 - function runSocialAuth($window, $rootScope, $interval, $log) { 84 + function runSocialAuth($window, $rootScope, $interval) {
85 85
86 $window.oauthClientAction = function(url) { 86 $window.oauthClientAction = function(url) {
87 var child = $window.open(url, '_blank'); 87 var child = $window.open(url, '_blank');
@@ -103,7 +103,7 @@ @@ -103,7 +103,7 @@
103 }; 103 };
104 104
105 $window.addEventListener('message', function(eventMessage) { 105 $window.addEventListener('message', function(eventMessage) {
106 - $log.debug('eventMessage', eventMessage); 106 + // $log.debug('eventMessage', eventMessage);
107 107
108 if (eventMessage.data.message === 'oauthClientPluginResult') { 108 if (eventMessage.data.message === 'oauthClientPluginResult') {
109 $rootScope.$broadcast('oauthClientPluginResult', eventMessage); 109 $rootScope.$broadcast('oauthClientPluginResult', eventMessage);
@@ -142,10 +142,10 @@ @@ -142,10 +142,10 @@
142 142
143 if (mainContentArea) { 143 if (mainContentArea) {
144 $timeout(function() { 144 $timeout(function() {
145 - $rootScope.scrollTo(mainContentArea, $event); 145 + $rootScope.scrollTo(angular.element(mainContentArea), $event);
146 }, 90); // force queue 146 }, 90); // force queue
147 } else { 147 } else {
148 - $log.warn('role="main" not found.'); 148 + $log.info('role="main" not found.');
149 } 149 }
150 }; 150 };
151 151
src/app/index.scss
@@ -23,8 +23,42 @@ $defaultblue: #5E749D; @@ -23,8 +23,42 @@ $defaultblue: #5E749D;
23 // ------------- 23 // -------------
24 24
25 // 1.4 - dicionarios 25 // 1.4 - dicionarios
26 -$categories: (saude: #3449b7, seguranca-publica: #e34748, educacao: #f39720, reducao-da-pobreza: #3ebb8f, cultura: #a63738);  
27 -$categories-descriptions: (saude: "Saúde é direito de todos e dever do Estado. O Sistema Único de Saúde (SUS) é universal, integral e de responsabilidade do Governo Federal, estados e municípios. Atende a todos os brasileiros.", seguranca-publica: "A segurança pública é um direito fundamental dos cidadãos. A proteção da vida, a disseminação da cultura da paz e a integração dos órgãos e instituições municipais, estaduais e federais são os maiores compromissos dessa política pública.", educacao: "Uma pátria educadora se faz com oportunidades para todos. Nos últimos anos, o Brasil criou esse caminho de oportunidades. Ampliamos o acesso à educação em todos os níveis de ensino – da creche à pós-graduação – e para todos os brasileiros, independentemente de sua classe social. E ainda há muito a fazer. O Plano Nacional de Educação (PNE) estabelece novas metas para que o governo federal trabalhe em parceria com a sociedade, com os estados e os municípios na construção de um futuro melhor. Queremos agora um salto na qualidade do ensino.", reducao-da-pobreza: "Com o esforço do Brasil para reduzir a pobreza e a desigualdade, 36 milhões de pessoas superaram a miséria na última década e o país saiu do Mapa da Fome das Nações Unidas.", cultura: "O que nos singulariza no conjunto das nações é, em última instância, nossa cultura. É por ela que nos identificamos como brasileiros de norte a sul deste país. Uma grande nação precisa ter um desenvolvimento cultural à altura de sua grandeza, contemplando as dimensões simbólica, econômica e cidadã da cultura, que são parte central do projeto de um país democrático e plural. A pluralidade é nossa singularidade."); 26 +$categories: (
  27 + saude: #3359a7,
  28 + seguranca-publica: #e95052,
  29 + educacao: #cc6cd9,
  30 + reducao-da-pobreza: #38c7a4,
  31 + cultura: #a63738,
  32 + esporte: #f15b31,
  33 + meio-ambiente: #3cc667
  34 +);
  35 +
  36 +$categories-complementary-1: (
  37 + saude: #4f8add,
  38 + seguranca-publica: #fb7c7f,
  39 + educacao: #ee9cff,
  40 + reducao-da-pobreza: #57e9cd,
  41 + cultura: #dc5557,
  42 + esporte: #fd8d4c,
  43 + meio-ambiente: #339950
  44 +);
  45 +
  46 +$categories-complementary-2: (
  47 + saude: #2a4781,
  48 + seguranca-publica: #c43e3e,
  49 + educacao: #93549e,
  50 + reducao-da-pobreza: #2a9677,
  51 + cultura: #862f2f,
  52 + esporte: #ce472c,
  53 + meio-ambiente: lighten(#3cc667, 10%)
  54 +);
  55 +
  56 +// $categories-descriptions: (
  57 +// saude: "Saúde é direito de todos e dever do Estado. O Sistema Único de Saúde (SUS) é universal, integral e de responsabilidade do Governo Federal, estados e municípios. Atende a todos os brasileiros.",
  58 +// seguranca-publica: "A segurança pública é um direito fundamental dos cidadãos. A proteção da vida, a disseminação da cultura da paz e a integração dos órgãos e instituições municipais, estaduais e federais são os maiores compromissos dessa política pública.",
  59 +// educacao: "Uma pátria educadora se faz com oportunidades para todos. Nos últimos anos, o Brasil criou esse caminho de oportunidades. Ampliamos o acesso à educação em todos os níveis de ensino – da creche à pós-graduação – e para todos os brasileiros, independentemente de sua classe social. E ainda há muito a fazer. O Plano Nacional de Educação (PNE) estabelece novas metas para que o governo federal trabalhe em parceria com a sociedade, com os estados e os municípios na construção de um futuro melhor. Queremos agora um salto na qualidade do ensino.",
  60 +// reducao-da-pobreza: "Com o esforço do Brasil para reduzir a pobreza e a desigualdade, 36 milhões de pessoas superaram a miséria na última década e o país saiu do Mapa da Fome das Nações Unidas.",
  61 +// cultura: "O que nos singulariza no conjunto das nações é, em última instância, nossa cultura. É por ela que nos identificamos como brasileiros de norte a sul deste país. Uma grande nação precisa ter um desenvolvimento cultural à altura de sua grandeza, contemplando as dimensões simbólica, econômica e cidadã da cultura, que são parte central do projeto de um país democrático e plural. A pluralidade é nossa singularidade.");
28 62
29 // Programs 63 // Programs
30 $scale: 1.1; 64 $scale: 1.1;
@@ -53,6 +87,11 @@ body { @@ -53,6 +87,11 @@ body {
53 color: #fff; 87 color: #fff;
54 padding: 5px; 88 padding: 5px;
55 margin-top: -5px; 89 margin-top: -5px;
  90 +
  91 + &.icon-small {
  92 + width: 35px;
  93 + height: 35px;
  94 + }
56 } 95 }
57 button { 96 button {
58 border-left: none; 97 border-left: none;
@@ -90,7 +129,7 @@ body { @@ -90,7 +129,7 @@ body {
90 @each $category, $color in $categories { 129 @each $category, $color in $categories {
91 .#{$category} & { 130 .#{$category} & {
92 background-color: $color; 131 background-color: $color;
93 - border-bottom: 3px solid darken($color, $darken); 132 + border-bottom: 3px solid map-get($categories-complementary-2, $category);
94 } 133 }
95 } 134 }
96 135
@@ -98,7 +137,7 @@ body { @@ -98,7 +137,7 @@ body {
98 &:focus { 137 &:focus {
99 @each $category, $color in $categories { 138 @each $category, $color in $categories {
100 .#{$category} & { 139 .#{$category} & {
101 - background-color: darken($color, $darken); 140 + background-color: map-get($categories-complementary-2, $category);
102 } 141 }
103 } 142 }
104 } 143 }
@@ -181,7 +220,6 @@ body { @@ -181,7 +220,6 @@ body {
181 height: 40px; 220 height: 40px;
182 221
183 .icon { 222 .icon {
184 - // transform: scale(0.7);  
185 position: relative; 223 position: relative;
186 top: -8px; 224 top: -8px;
187 left: -8px; 225 left: -8px;
@@ -198,7 +236,7 @@ body { @@ -198,7 +236,7 @@ body {
198 background-color: #4AC97A; 236 background-color: #4AC97A;
199 237
200 &:hover { background-color: lighten(#4AC97A, 10%); } 238 &:hover { background-color: lighten(#4AC97A, 10%); }
201 - 239 +
202 &:active, 240 &:active,
203 &:focus { background-color: darken(#4AC97A, 10%)} 241 &:focus { background-color: darken(#4AC97A, 10%)}
204 } 242 }
@@ -206,7 +244,7 @@ body { @@ -206,7 +244,7 @@ body {
206 background-color: #EEB453; 244 background-color: #EEB453;
207 245
208 &:hover { background-color: lighten(#EEB453, 10%); } 246 &:hover { background-color: lighten(#EEB453, 10%); }
209 - 247 +
210 &:active, 248 &:active,
211 &:focus { background-color: darken(#EEB453, 10%)} 249 &:focus { background-color: darken(#EEB453, 10%)}
212 } 250 }
@@ -214,7 +252,7 @@ body { @@ -214,7 +252,7 @@ body {
214 background-color: #EC4C68; 252 background-color: #EC4C68;
215 253
216 &:hover { background-color: lighten(#EC4C68, 10%); } 254 &:hover { background-color: lighten(#EC4C68, 10%); }
217 - 255 +
218 &:active, 256 &:active,
219 &:focus { background-color: darken(#EC4C68, 10%)} 257 &:focus { background-color: darken(#EC4C68, 10%)}
220 } 258 }
@@ -233,8 +271,8 @@ body { @@ -233,8 +271,8 @@ body {
233 .#{$category} { 271 .#{$category} {
234 .color-theme-fg { color: $color; } 272 .color-theme-fg { color: $color; }
235 .color-theme-bg { background-color: $color;} 273 .color-theme-bg { background-color: $color;}
236 - .color-theme-bg-complementar-1 { background-color: lighten($color, 10%);}  
237 - .color-theme-bg-complementar-2 { background-color: darken($color, 10%);} 274 + .color-theme-bg-complementar-1 { background-color: map-get($categories-complementary-1, $category);}
  275 + .color-theme-bg-complementar-2 { background-color: map-get($categories-complementary-2, $category);}
238 276
239 .contraste & .color-theme-fg { color: #fff; } 277 .contraste & .color-theme-fg { color: #fff; }
240 .contraste & .color-theme-bg { background-color: #000;} 278 .contraste & .color-theme-bg { background-color: #000;}
src/app/layout.scss
@@ -123,6 +123,11 @@ @@ -123,6 +123,11 @@
123 margin-left: -2px; 123 margin-left: -2px;
124 } 124 }
125 125
  126 +.vertical-padding {
  127 + padding-top: 15px;
  128 + padding-bottom: 15px;
  129 +}
  130 +
126 .no-space-left { margin-left: 0; padding-left: 0;} 131 .no-space-left { margin-left: 0; padding-left: 0;}
127 .no-space-right { margin-right: 0; padding-right: 0;} 132 .no-space-right { margin-right: 0; padding-right: 0;}
128 133
src/app/pages/article/article.controller.js
@@ -6,10 +6,11 @@ @@ -6,10 +6,11 @@
6 .controller('ArticlePageController', ArticlePageController); 6 .controller('ArticlePageController', ArticlePageController);
7 7
8 /** @ngInject */ 8 /** @ngInject */
9 - function ArticlePageController(DialogaService, $state, $sce, $log) { 9 + function ArticlePageController(DialogaService, $rootScope, $state, $sce, $log) {
10 var vm = this; 10 var vm = this;
11 11
12 vm.DialogaService = DialogaService; 12 vm.DialogaService = DialogaService;
  13 + vm.$rootScope = $rootScope;
13 vm.$state = $state; 14 vm.$state = $state;
14 vm.$sce = $sce; 15 vm.$sce = $sce;
15 vm.$log = $log; 16 vm.$log = $log;
@@ -17,6 +18,8 @@ @@ -17,6 +18,8 @@
17 vm.init(); 18 vm.init();
18 vm.loadData(); 19 vm.loadData();
19 20
  21 + vm.$rootScope.focusMainContent();
  22 +
20 vm.$log.debug('ArticlePageController'); 23 vm.$log.debug('ArticlePageController');
21 } 24 }
22 25
@@ -41,7 +44,7 @@ @@ -41,7 +44,7 @@
41 vm.DialogaService.getTerms(handleSuccess, handleError); 44 vm.DialogaService.getTerms(handleSuccess, handleError);
42 break; 45 break;
43 default: 46 default:
44 - vm.$log.warn('Page not handled:', vm.page); 47 + vm.$log.debug('Page not handled:', vm.page);
45 break; 48 break;
46 } 49 }
47 50
src/app/pages/auth/auth.controller.js
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 .controller('AuthPageController', AuthPageController); 6 .controller('AuthPageController', AuthPageController);
7 7
8 /** @ngInject */ 8 /** @ngInject */
9 - function AuthPageController($scope, $rootScope, $window, $location, $state, $timeout, $interval, AUTH_EVENTS, AuthService, DialogaService, Session, $log) { 9 + function AuthPageController($scope, $rootScope, $window, $location, $state, $timeout, $interval, APP, AUTH_EVENTS, AuthService, DialogaService, Session, $log) {
10 var vm = this; 10 var vm = this;
11 11
12 vm.$scope = $scope; 12 vm.$scope = $scope;
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 vm.$state = $state; 16 vm.$state = $state;
17 vm.$timeout = $timeout; 17 vm.$timeout = $timeout;
18 vm.$interval = $interval; 18 vm.$interval = $interval;
  19 + vm.APP = APP;
19 vm.AUTH_EVENTS = AUTH_EVENTS; 20 vm.AUTH_EVENTS = AUTH_EVENTS;
20 vm.AuthService = AuthService; 21 vm.AuthService = AuthService;
21 vm.DialogaService = DialogaService; 22 vm.DialogaService = DialogaService;
@@ -26,6 +27,8 @@ @@ -26,6 +27,8 @@
26 vm.loadData(); 27 vm.loadData();
27 vm.attachListeners(); 28 vm.attachListeners();
28 29
  30 + vm.$rootScope.focusMainContent();
  31 +
29 vm.$log.debug('AuthPageController'); 32 vm.$log.debug('AuthPageController');
30 } 33 }
31 34
@@ -34,7 +37,7 @@ @@ -34,7 +37,7 @@
34 37
35 // init variables 38 // init variables
36 vm.signin = {}; 39 vm.signin = {};
37 - vm.singup = {}; 40 + vm.signup = {};
38 vm.terms = null; 41 vm.terms = null;
39 vm.loadingTerms = null; 42 vm.loadingTerms = null;
40 vm.delay = 3; // segundos 43 vm.delay = 3; // segundos
@@ -119,16 +122,23 @@ @@ -119,16 +122,23 @@
119 vm.AuthService.logout(); 122 vm.AuthService.logout();
120 }; 123 };
121 124
122 - AuthPageController.prototype.submitSingup = function(credentials) { 125 + AuthPageController.prototype.submitSignup = function($event, credentials) {
123 var vm = this; 126 var vm = this;
124 127
  128 + var target = $event.target;
  129 + var $target = angular.element(target);
  130 + var $captcha = $target.find('[name="txtToken_captcha_serpro_gov_br"]');
  131 + credentials.txtToken_captcha_serpro_gov_br = $captcha.val();
  132 +
  133 + // vm.signupFormStatus = 'SENDIN';
125 vm.AuthService.register(credentials).then(function(response) { 134 vm.AuthService.register(credentials).then(function(response) {
126 vm.$log.debug('register success.response', response); 135 vm.$log.debug('register success.response', response);
127 136
128 // TODO: mensagens de sucesso 137 // TODO: mensagens de sucesso
129 // 'Cadastro efetuado com sucesso.' 138 // 'Cadastro efetuado com sucesso.'
130 // 'Verifique seu email para confirmar o cadastro.' 139 // 'Verifique seu email para confirmar o cadastro.'
131 - vm.successMessage = '<h3>Cadastro efetuado com sucesso.</h3>' + '<p>Verifique seu <b>email</b> para confirmar o cadastro.</p>'; 140 + vm.messageTitle = 'Cadastro efetuado com sucesso!';
  141 + vm.successMessage = 'Verifique seu e-mail para confirmar o cadastro.';
132 vm.redirectBack(); 142 vm.redirectBack();
133 }, function(response) { 143 }, function(response) {
134 vm.$log.debug('register error.response', response); 144 vm.$log.debug('register error.response', response);
@@ -163,11 +173,46 @@ @@ -163,11 +173,46 @@
163 }); 173 });
164 }; 174 };
165 175
  176 + AuthPageController.prototype.submitRecover = function($event, recoverForm) {
  177 + var vm = this;
  178 +
  179 + // get form data
  180 + var data = {
  181 + login: recoverForm.login.$modelValue,
  182 + captcha_text: recoverForm.captcha_text.$modelValue
  183 + };
  184 +
  185 + // get captcha token
  186 + var target = $event.target;
  187 + var $target = angular.element(target);
  188 + var $captcha = $target.find('[name="txtToken_captcha_serpro_gov_br"]');
  189 + data.txtToken_captcha_serpro_gov_br = $captcha.val();
  190 +
  191 + vm.AuthService.forgotPassword(data).then(function(response) {
  192 + vm.$log.debug('recover success.response', response);
  193 +
  194 + vm.successRecoverMessageTitle = 'Pedido enviado sucesso!';
  195 + vm.successRecoverMessage = 'Verifique seu e-mail. Em instantes você receberá um e-mail com um link para redefinir sua senha.';
  196 + // vm.redirectBack();
  197 + }, function(response){
  198 + vm.$log.debug('recover error.response', response);
  199 +
  200 + var message = response.data.message;
  201 + vm.errorRecoverMessage = message;
  202 +
  203 + if(response.data.code === 500){
  204 + vm.internalError = true;
  205 + }
  206 + }).catch(function(error){
  207 + vm.$log.debug('recover catch.error', error);
  208 + });
  209 + };
  210 +
166 AuthPageController.prototype.redirectBack = function() { 211 AuthPageController.prototype.redirectBack = function() {
167 var vm = this; 212 var vm = this;
168 213
169 if (!vm.hasRedirect) { 214 if (!vm.hasRedirect) {
170 - vm.$log.warn('No redirect params defined.'); 215 + vm.$log.debug('No redirect params defined.');
171 return; 216 return;
172 } 217 }
173 218
@@ -207,14 +252,15 @@ @@ -207,14 +252,15 @@
207 252
208 AuthPageController.prototype.authWithFacebook = function() { 253 AuthPageController.prototype.authWithFacebook = function() {
209 var vm = this; 254 var vm = this;
210 - var url = 'http://login.dialoga.gov.br/plugin/oauth_client/facebook?oauth_client_popup=true&id=1'; 255 + // var url = 'http://login.dialoga.gov.br/plugin/oauth_client/facebook?oauth_client_popup=true&id=1';
  256 + var url = 'http://login.dialoga.gov.br/plugin/oauth_client/facebook?oauth_client_popup=true&id=' + vm.APP.facebook_app_id;
211 vm.$window.oauthClientAction(url); 257 vm.$window.oauthClientAction(url);
212 }; 258 };
213 259
214 AuthPageController.prototype.authWithGooglePlus = function() { 260 AuthPageController.prototype.authWithGooglePlus = function() {
215 var vm = this; 261 var vm = this;
216 262
217 - var url = 'http://login.dialoga.gov.br/plugin/oauth_client/google_oauth2?oauth_client_popup=true&id=4'; 263 + var url = 'http://login.dialoga.gov.br/plugin/oauth_client/google_oauth2?oauth_client_popup=true&id=' + vm.APP.goople_app_id;
218 vm.$window.oauthClientAction(url); 264 vm.$window.oauthClientAction(url);
219 }; 265 };
220 })(); 266 })();
src/app/pages/auth/auth.scss
@@ -92,6 +92,10 @@ @@ -92,6 +92,10 @@
92 } 92 }
93 } 93 }
94 } 94 }
  95 +
  96 + .feedback-message {
  97 + padding: 20px 0;
  98 + }
95 } 99 }
96 100
97 .modal-dialog { 101 .modal-dialog {
src/app/pages/auth/recover.html
1 -<div class="container">  
2 - <div class="row">  
3 - <div class="col-sm-12">  
4 - <h2>Esqueci minha senha</h2>  
5 - <h5>  
6 - Calma, podemos ajudar! Informe o seu e-mail que a gente envia um link de alteração.  
7 - </h5>  
8 - </div>  
9 - </div>  
10 -</div>  
11 -<section role="main" class="section-gray"> 1 +<div class="page--recover">
12 <div class="container"> 2 <div class="container">
13 <div class="row"> 3 <div class="row">
14 - <div ng-if="pageSignin.currentUser">  
15 - <div class="row">  
16 - <div class="col-sm-8 col-sm-offset-2">  
17 - <h3>Você está logado!</h3>  
18 - <button type="button" ng-click="pageSignin.onClickLogout()" class="btn btn-primary">Sair</button>  
19 - </div>  
20 - </div> 4 + <div class="col-sm-12">
  5 + <h2>Esqueci minha senha</h2>
  6 + <h5>
  7 + Calma, podemos ajudar! Informe o seu e-mail que a gente envia um link de alteração.
  8 + </h5>
21 </div> 9 </div>
22 - <div ng-if="!pageSignin.currentUser">  
23 - <br>  
24 - <div class="col-sm-8 col-sm-offset-2">  
25 - <div class="row">  
26 - <div class="col-md-12">  
27 - <form name="recoverPassForm" ng-submit="pageSignin.login(pageSignin.credentials)">  
28 - <div class="form-group">  
29 - <label for="inputUsername">E-mail*</label>  
30 - <input type="email" id="inputUsername" name="inputUsername" class="form-control input-lg" ng-class="{ 'has-error' : recoverPassForm.inputUsername.$invalid && recoverPassForm.inputUsername.$touched }" ng-model="pageSignin.credentials.username" required />  
31 - <validation-messages field=" recoverPassForm.inputUsername"/>  
32 - </div>  
33 - <div class="form-group">  
34 - <div class="input-group">  
35 - <label for="inputPassword">Digite o texto desta imagem</label>  
36 - <br>  
37 - <span>Aqui vai um CAPTCHA</span> 10 + </div>
  11 + </div>
  12 + <section role="main" class="section-gray vertical-padding">
  13 + <div class="container">
  14 + <div class="row">
  15 + <div ng-if="pageSignin.successRecoverMessage">
  16 + <div class="col-sm-8 col-sm-offset-2">
  17 + <div class="feedback-message">
  18 + <show-message
  19 + type="'success'"
  20 + title="pageSignin.successRecoverMessageTitle || 'Pronto!'"
  21 + message="pageSignin.successRecoverMessage"
  22 + ></show-message>
  23 + <div class="row">
  24 + <div class="col-sm-8 col-sm-offset-4">
  25 + <p><a ui-sref="inicio">Ir para página inicial</a></p>
  26 + </div>
  27 + </div>
  28 + </div>
  29 + </div>
  30 + </div>
  31 + <div ng-if="!pageSignin.successRecoverMessage">
  32 + <br>
  33 + <div class="col-sm-8 col-sm-offset-2">
  34 + <div class="row" ng-if="pageSignin.errorRecoverMessage">
  35 + <div class="col-sm-12">
  36 + <div class="alert alert-danger">{{pageSignin.errorRecoverMessage}}</div>
  37 + <div ng-if="vm.internalError">
  38 + <p>Este erro parece ser um problema interno.<br/>Por favor, tente novamente mais tarde.</p>
  39 + <p>Caso o problema persista, entre em contato!</p>
  40 + <p><a ui-sref="duvidas">Ir para página de contato</a></p>
  41 + </div>
  42 + </div>
  43 + </div>
  44 + <div class="row">
  45 + <div class="col-md-12">
  46 + <form name="recoverPassForm" ng-submit="pageSignin.submitRecover($event, recoverPassForm)">
  47 + <div class="form-group">
  48 + <label for="recover-login">E-mail*</label>
  49 + <input type="email" id="recover-login" name="login" class="form-control input-lg" ng-class="{ 'has-error' : recoverPassForm.login.$invalid && recoverPassForm.login.$touched }" ng-model="pageSignin.credentials.username" required />
  50 + <validation-messages field=" recoverPassForm.login"></validation-messages>
38 </div> 51 </div>
39 - </div>  
40 - <div class="form-group">  
41 - <button class="btn btn-lg btn-block btn-submit" type="submit">Solicitar alteração de senha</button>  
42 - </div>  
43 - </form> 52 + <div class="form-group">
  53 + <div id="serpro_captcha" class="captcha">
  54 + </div>
  55 + <div class="captcha">
  56 + Digite os caracteres acima:
  57 + </div>
  58 + <div class="captcha">
  59 + <input type="text" name="captcha_text" id="captcha_text" aria-label="Escreva os caracteres do captcha aqui" ng-model="pageSignin.signup.captcha_text" ng-minlength="" ng-maxlength="" required>
  60 + <validation-messages field="recoverPassForm.captcha_text"></validation-messages>
  61 + </div>
  62 + </div>
  63 + <div class="form-group">
  64 + <button class="btn btn-lg btn-submit" type="submit">Solicitar alteração de senha</button>
  65 + </div>
  66 + </form>
  67 + </div>
44 </div> 68 </div>
45 </div> 69 </div>
  70 + <br>
46 </div> 71 </div>
47 - <br>  
48 </div> 72 </div>
49 </div> 73 </div>
50 - </div>  
51 -</section> 74 + </section>
  75 +</div>
src/app/pages/auth/signin.html
@@ -11,15 +11,26 @@ @@ -11,15 +11,26 @@
11 <div ng-if="pageSignin.currentUser"> 11 <div ng-if="pageSignin.currentUser">
12 <div class="row"> 12 <div class="row">
13 <div class="col-sm-8 col-sm-offset-2"> 13 <div class="col-sm-8 col-sm-offset-2">
14 - <div>  
15 - <h3 ng-if="!pageSignin.successMessage">Você está logado!</h3>  
16 - <h3 ng-if="pageSignin.successMessage" ng-bind-html="pageSignin.successMessage"></h3>  
17 - <div ng-if="pageSignin.countdown > 0">  
18 - <p>  
19 - Você será redirecionado em menos de <b>{{pageSignin.countdown}} segundos</b>...  
20 - </p> 14 + <div class="feedback-message">
  15 + <show-message
  16 + type="'success'"
  17 + title="pageSignin.messageTitle || 'Você está logado!'"
  18 + message="pageSignin.successMessage"
  19 + ></show-message>
  20 +
  21 + <div class="row">
  22 + <div class="col-sm-4"></div>
  23 + <div class="col-sm-8 text-center-sm">
  24 + <!-- <div ng-if="pageSignin.redirect > 0">
  25 + </div> -->
  26 + <div ng-if="pageSignin.countdown > 0">
  27 + <p>
  28 + Você será redirecionado em menos de <b>{{pageSignin.countdown}} segundos</b>...
  29 + </p>
  30 + </div>
  31 + <button type="button" ng-click="pageSignin.onClickLogout()" class="btn btn-primary">Sair</button>
  32 + </div>
21 </div> 33 </div>
22 - <button type="button" ng-click="pageSignin.onClickLogout()" class="btn btn-primary">Sair</button>  
23 </div> 34 </div>
24 </div> 35 </div>
25 </div> 36 </div>
@@ -28,22 +39,25 @@ @@ -28,22 +39,25 @@
28 <div class="col-sm-5"> 39 <div class="col-sm-5">
29 <div class="row"> 40 <div class="row">
30 <div class="col-md-12"> 41 <div class="col-md-12">
31 - <h2>Já possui cadastro</h2> 42 + <h2>Já possui cadastro?</h2>
32 <p>Use seus dados para acessar o Dialoga Brasil</p> 43 <p>Use seus dados para acessar o Dialoga Brasil</p>
33 <form role="form" name="signinForm" ng-submit="pageSignin.submitSignin(pageSignin.signin)" novalidate> 44 <form role="form" name="signinForm" ng-submit="pageSignin.submitSignin(pageSignin.signin)" novalidate>
34 <div class="form-group"> 45 <div class="form-group">
35 <label for="signin-form--login">E-mail*</label> 46 <label for="signin-form--login">E-mail*</label>
36 <input type="email" id="signin-form--login" name="login" class="form-control input-lg" ng-class="{ 'has-error' : signinForm.login.$invalid && signinForm.login.$touched }" ng-model="pageSignin.signin.username" required/> 47 <input type="email" id="signin-form--login" name="login" class="form-control input-lg" ng-class="{ 'has-error' : signinForm.login.$invalid && signinForm.login.$touched }" ng-model="pageSignin.signin.username" required/>
37 - <validation-messages field="signinForm.login"/> 48 + <validation-messages field="signinForm.login"></validation-messages>
38 </div> 49 </div>
39 <div class="form-group"> 50 <div class="form-group">
40 <label for="signin-form--password">Senha*</label> 51 <label for="signin-form--password">Senha*</label>
41 <input type="password" id="signin-form--password" name="password" class="form-control input-lg" ng-class="{ 'has-error' : signinForm.password.$invalid && signinForm.password.$touched }" ng-model="pageSignin.signin.password" required> 52 <input type="password" id="signin-form--password" name="password" class="form-control input-lg" ng-class="{ 'has-error' : signinForm.password.$invalid && signinForm.password.$touched }" ng-model="pageSignin.signin.password" required>
42 - <validation-messages field="signinForm.password"/> 53 + <validation-messages field="signinForm.password"></validation-messages>
43 </div> 54 </div>
44 <div class="form-group"> 55 <div class="form-group">
45 <button class="btn btn-lg btn-block btn-submit" type="submit">Entrar</button> 56 <button class="btn btn-lg btn-block btn-submit" type="submit">Entrar</button>
46 </div> 57 </div>
  58 + <div class="form-group">
  59 + <a ui-sref="recuperar" class="btn btn-lg btn-link">Esqueci minha senha</a>
  60 + </div>
47 </form> 61 </form>
48 </div> 62 </div>
49 </div> 63 </div>
@@ -96,31 +110,31 @@ @@ -96,31 +110,31 @@
96 </div> 110 </div>
97 <div class="row"> 111 <div class="row">
98 <div class="col-sm-12"> 112 <div class="col-sm-12">
99 - <form name="signupForm" ng-submit="pageSignin.submitSigup(pageSignin.signup)"> 113 + <form name="signupForm" ng-submit="pageSignin.submitSignup($event, pageSignin.signup)">
100 <div class="form-group"> 114 <div class="form-group">
101 <label for="signup-form--name">Nome*:</label> 115 <label for="signup-form--name">Nome*:</label>
102 <span class="pull-right">*Dados obrigatórios</span> 116 <span class="pull-right">*Dados obrigatórios</span>
103 <input type="text" id="signup-form--name" name="name" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.name.$invalid && signupForm.name.$touched }" ng-model="pageSignin.signup.name" ng-minlength="" ng-maxlength="" required> 117 <input type="text" id="signup-form--name" name="name" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.name.$invalid && signupForm.name.$touched }" ng-model="pageSignin.signup.name" ng-minlength="" ng-maxlength="" required>
104 - <validation-messages field="signupForm.name"/> 118 + <validation-messages field="signupForm.name"></validation-messages>
105 </div> 119 </div>
106 <div class="form-group"> 120 <div class="form-group">
107 <label for="signup-form--email">E-mail*:</label> 121 <label for="signup-form--email">E-mail*:</label>
108 <input type="email" id="signup-form--email" name="email" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.email.$invalid && signupForm.email.$touched }" ng-model="pageSignin.signup.email" ng-minlength="" ng-maxlength="" required> 122 <input type="email" id="signup-form--email" name="email" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.email.$invalid && signupForm.email.$touched }" ng-model="pageSignin.signup.email" ng-minlength="" ng-maxlength="" required>
109 - <validation-messages field="signupForm.email"/> 123 + <validation-messages field="signupForm.email"></validation-messages>
110 </div> 124 </div>
111 <div class="row"> 125 <div class="row">
112 <div class="col-sm-6"> 126 <div class="col-sm-6">
113 <div class="form-group"> 127 <div class="form-group">
114 <label for="signup-form--password">Senha*:</label> 128 <label for="signup-form--password">Senha*:</label>
115 <input type="password" id="signup-form--password" name="password" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.password.$invalid && signupForm.password.$touched }" ng-model="pageSignin.signup.password" ng-minlength="" ng-maxlength="" required> 129 <input type="password" id="signup-form--password" name="password" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.password.$invalid && signupForm.password.$touched }" ng-model="pageSignin.signup.password" ng-minlength="" ng-maxlength="" required>
116 - <validation-messages field="signupForm.password"/> 130 + <validation-messages field="signupForm.password"></validation-messages>
117 </div> 131 </div>
118 </div> 132 </div>
119 <div class="col-sm-6"> 133 <div class="col-sm-6">
120 <div class="form-group"> 134 <div class="form-group">
121 <label for="signup-form--password-confirmation">Confirmar Senha*:</label> 135 <label for="signup-form--password-confirmation">Confirmar Senha*:</label>
122 <input type="password" id="signup-form--password-confirmation" name="password_confirmation" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.password_confirmation.$invalid && signupForm.password_confirmation.$touched }" ng-model="pageSignin.signup.password_confirmation" ng-minlength="" ng-maxlength="" required> 136 <input type="password" id="signup-form--password-confirmation" name="password_confirmation" class="form-control input-lg" ng-class="{ 'has-error' : signupForm.password_confirmation.$invalid && signupForm.password_confirmation.$touched }" ng-model="pageSignin.signup.password_confirmation" ng-minlength="" ng-maxlength="" required>
123 - <validation-messages field="signupForm.password_confirmation"/> 137 + <validation-messages field="signupForm.password_confirmation"></validation-messages>
124 </div> 138 </div>
125 </div> 139 </div>
126 </div> 140 </div>
@@ -141,35 +155,35 @@ @@ -141,35 +155,35 @@
141 <div class="form-group"> 155 <div class="form-group">
142 <div class="checkbox"> 156 <div class="checkbox">
143 <label for="user_terms_accepted"> 157 <label for="user_terms_accepted">
144 - <input type="checkbox" id="user_terms_accepted" name="user_terms_accepted" value="aceito" ng-model="pageSignin.signup.user_terms_accepted" required> 158 + <input type="checkbox" id="user_terms_accepted" name="user_terms_accepted" value="aceito" ng-model="pageSignin.signup.user_terms_accepted" required />
145 Já li e concordo com os 159 Já li e concordo com os
146 <button type="button" class="btn btn-link" style="padding:0 0 4px 0;" data-toggle="modal" data-target="#modalTermosDeUso">Termos de Uso</button> 160 <button type="button" class="btn btn-link" style="padding:0 0 4px 0;" data-toggle="modal" data-target="#modalTermosDeUso">Termos de Uso</button>
147 </label> 161 </label>
148 </div> 162 </div>
149 - </input>  
150 - <validation-messages field="signupForm.user_terms_accepted"/>  
151 - </div>  
152 - <div class="form-group">  
153 - <div id="serpro_captcha" class="captcha"> 163 + <validation-messages field="signupForm.user_terms_accepted"></validation-messages>
154 </div> 164 </div>
155 - <div class="captcha">  
156 - Digite os caracteres acima: 165 + <div class="form-group">
  166 + <div id="serpro_captcha" class="captcha">
  167 + </div>
  168 + <div class="captcha">
  169 + Digite os caracteres acima:
  170 + </div>
  171 + <div class="captcha">
  172 + <input type="text" name="captcha_text" id="captcha_text" aria-label="Escreva os caracteres do captcha aqui" ng-model="pageSignin.signup.captcha_text" ng-minlength="" ng-maxlength="" required>
  173 + <validation-messages field="signupForm.captcha_text"></validation-messages>
  174 + </div>
157 </div> 175 </div>
158 - <div class="captcha">  
159 - <input type="text" name="captcha_text" id="captcha_text" aria-label="Escreva os caracteres do captcha aqui" ng-model="pageSignin.signup.captcha_text"> 176 + <div class="form-group">
  177 + <button type="submit" class="btn btn-lg btn-block btn-submit" ng-class=" {'disabled' : !pageSignin.signup.user_terms_accepted }">Cadastrar</button>
160 </div> 178 </div>
161 - </div>  
162 - <div class="form-group">  
163 - <button class="btn btn-lg btn-block btn-submit" ng-class=" {'disabled' : !pageSignin.signup.user_terms_accepted }" type="submit">Cadastrar</button>  
164 - </div>  
165 - </form> 179 + </form>
  180 + </div>
166 </div> 181 </div>
167 </div> 182 </div>
168 </div> 183 </div>
169 </div> 184 </div>
170 - </section>  
171 -  
172 - 185 + </div>
  186 +</section>
173 <div class="modal fade" id="modalTermosDeUso" tabindex="-1" role="dialog" aria-labelledby="termosDeUsoLabel"> 187 <div class="modal fade" id="modalTermosDeUso" tabindex="-1" role="dialog" aria-labelledby="termosDeUsoLabel">
174 <div class="modal-dialog" role="document"> 188 <div class="modal-dialog" role="document">
175 <div class="modal-content"> 189 <div class="modal-content">
src/app/pages/inicio/inicio.controller.js
@@ -208,7 +208,7 @@ @@ -208,7 +208,7 @@
208 var vm = this; 208 var vm = this;
209 209
210 if (!vm.programs) { 210 if (!vm.programs) {
211 - vm.$log.warn('No programs loaded yet. Abort.'); 211 + vm.$log.debug('No programs loaded yet. Abort.');
212 return null; 212 return null;
213 } 213 }
214 214
@@ -220,7 +220,7 @@ @@ -220,7 +220,7 @@
220 var filter = vm.$filter('filter'); 220 var filter = vm.$filter('filter');
221 221
222 if (selectedTheme) { 222 if (selectedTheme) {
223 - output = _filterByCategory(output, selectedTheme); 223 + output = vm._filterByCategory(output, selectedTheme);
224 } 224 }
225 225
226 if (query) { 226 if (query) {
@@ -234,7 +234,9 @@ @@ -234,7 +234,9 @@
234 return output; 234 return output;
235 }; 235 };
236 236
237 - function _filterByCategory (input, category) { 237 + InicioPageController.prototype._filterByCategory = function (input, category) {
  238 + var vm = this;
  239 +
238 input = input || []; 240 input = input || [];
239 241
240 if (!category) { 242 if (!category) {
@@ -245,6 +247,12 @@ @@ -245,6 +247,12 @@
245 var out = []; 247 var out = [];
246 for (var i = 0; i < input.length; i++) { 248 for (var i = 0; i < input.length; i++) {
247 var program = input[i]; 249 var program = input[i];
  250 +
  251 + if(!program.categories || program.categories.length === 0){
  252 + vm.$log.warn('Program without theme (category)', program.slug);
  253 + continue;
  254 + }
  255 +
248 if (program.categories[0].slug === category.slug) { 256 if (program.categories[0].slug === category.slug) {
249 out.push(program); 257 out.push(program);
250 } 258 }
src/app/pages/inicio/inicio.scss
@@ -25,20 +25,6 @@ @@ -25,20 +25,6 @@
25 } 25 }
26 } 26 }
27 27
28 - .input-group-search {  
29 - .icon-small {  
30 - width: 35px;  
31 - height: 35px;  
32 - }  
33 - .icon-circle {  
34 - color: #fff;  
35 - padding: 5px;  
36 - margin-top: -5px;  
37 - }  
38 - button {  
39 - border-left: none;  
40 - }  
41 - }  
42 .input-group-btn { 28 .input-group-btn {
43 background-color: #fff; 29 background-color: #fff;
44 } 30 }
src/app/pages/programas/programa.controller.js
@@ -6,25 +6,28 @@ @@ -6,25 +6,28 @@
6 .controller('ProgramaPageController', ProgramaPageController); 6 .controller('ProgramaPageController', ProgramaPageController);
7 7
8 /** @ngInject */ 8 /** @ngInject */
9 - function ProgramaPageController(DialogaService, PATH, VOTE_OPTIONS, $state, $location, $scope, $rootScope, $element, $timeout, $log) {  
10 - $log.debug('ProgramaPageController');  
11 - 9 + function ProgramaPageController(DialogaService, PATH, VOTE_OPTIONS, PROPOSAL_STATUS, $state, $location, $scope, $rootScope, $element, $timeout, $sce, $log) {
12 var vm = this; 10 var vm = this;
13 11
14 vm.DialogaService = DialogaService; 12 vm.DialogaService = DialogaService;
15 vm.PATH = PATH; 13 vm.PATH = PATH;
16 vm.VOTE_OPTIONS = VOTE_OPTIONS; 14 vm.VOTE_OPTIONS = VOTE_OPTIONS;
  15 + vm.PROPOSAL_STATUS = PROPOSAL_STATUS;
17 vm.$state = $state; 16 vm.$state = $state;
18 vm.$location = $location; 17 vm.$location = $location;
19 vm.$scope = $scope; 18 vm.$scope = $scope;
20 vm.$rootScope = $rootScope; 19 vm.$rootScope = $rootScope;
21 vm.$element = $element; 20 vm.$element = $element;
22 vm.$timeout = $timeout; 21 vm.$timeout = $timeout;
  22 + vm.$sce = $sce;
23 vm.$log = $log; 23 vm.$log = $log;
24 24
25 vm.init(); 25 vm.init();
26 vm.loadData(); 26 vm.loadData();
27 vm.attachListeners(); 27 vm.attachListeners();
  28 + vm.$rootScope.focusMainContent();
  29 +
  30 + vm.$log.debug('ProgramaPageController');
28 } 31 }
29 32
30 ProgramaPageController.prototype.init = function() { 33 ProgramaPageController.prototype.init = function() {
@@ -46,6 +49,7 @@ @@ -46,6 +49,7 @@
46 var vm = this; 49 var vm = this;
47 50
48 vm.loading = true; 51 vm.loading = true;
  52 + vm.proposalStatus = null;
49 53
50 // Get program by slug 54 // Get program by slug
51 var slug = vm.$state.params.slug; 55 var slug = vm.$state.params.slug;
@@ -73,6 +77,10 @@ @@ -73,6 +77,10 @@
73 }; 77 };
74 } 78 }
75 79
  80 + if(vm.article.body && !vm.article.bodyTrusted){
  81 + vm.article.bodyTrusted = vm.$sce.trustAsHtml(vm.article.body);
  82 + }
  83 +
76 vm.loadingTopProposals = true; 84 vm.loadingTopProposals = true;
77 vm.DialogaService.getProposalsByTopicId(vm.article.id, {}, function(data) { 85 vm.DialogaService.getProposalsByTopicId(vm.article.id, {}, function(data) {
78 vm.proposals = data.articles; 86 vm.proposals = data.articles;
@@ -109,13 +117,17 @@ @@ -109,13 +117,17 @@
109 }); 117 });
110 118
111 vm.$scope.$on('cadastro-proposa:startSendProposal', function(event, proposal) { 119 vm.$scope.$on('cadastro-proposa:startSendProposal', function(event, proposal) {
112 - vm.creatingProposal = true; 120 +
  121 + vm.proposalStatus = vm.PROPOSAL_STATUS.SENDING;
  122 +
113 vm.DialogaService.createProposal(proposal, vm.article.id, function(response) { 123 vm.DialogaService.createProposal(proposal, vm.article.id, function(response) {
114 vm.$log.debug('response', response); 124 vm.$log.debug('response', response);
115 - vm.creatingProposal = false; 125 + // vm.proposalStatus = vm.PROPOSAL_STATUS.SENT | vm.PROPOSAL_STATUS.SUCCESS;
  126 + vm.proposalStatus = vm.PROPOSAL_STATUS.SUCCESS;
116 }, function(error) { 127 }, function(error) {
117 vm.$log.error(error); 128 vm.$log.error(error);
118 - vm.creatingProposal = false; 129 + // vm.proposalStatus = vm.PROPOSAL_STATUS.SENT | vm.PROPOSAL_STATUS.ERROR;
  130 + vm.proposalStatus = vm.PROPOSAL_STATUS.ERROR;
119 }); 131 });
120 }); 132 });
121 133
@@ -253,9 +265,9 @@ @@ -253,9 +265,9 @@
253 vm.$element.find(rule).slideUp(); 265 vm.$element.find(rule).slideUp();
254 }; 266 };
255 267
256 - ProgramaPageController.prototype.sendProposal = function() { 268 + ProgramaPageController.prototype.sendAnotherProposal = function() {
257 var vm = this; 269 var vm = this;
258 270
259 - vm.$log.warn('Not implemented yet: "sendProposal"'); 271 + vm.proposalStatus = null;
260 }; 272 };
261 })(); 273 })();
src/app/pages/programas/programa.html
@@ -18,8 +18,8 @@ @@ -18,8 +18,8 @@
18 </div> 18 </div>
19 </section> 19 </section>
20 20
21 - <div ng-if="pagePrograma.article.body" ng-class="pagePrograma.category.slug">  
22 - <section> 21 + <div role="main">
  22 + <section ng-if="pagePrograma.article.body" ng-class="pagePrograma.category.slug">
23 <div class="container"> 23 <div class="container">
24 <div class="row"> 24 <div class="row">
25 <article class="program-preview"> 25 <article class="program-preview">
@@ -121,6 +121,14 @@ @@ -121,6 +121,14 @@
121 </div> 121 </div>
122 <div class="proposal-extended-section-content"> 122 <div class="proposal-extended-section-content">
123 <proposal-list proposals="pagePrograma.proposalsTopFive"></proposal-list> 123 <proposal-list proposals="pagePrograma.proposalsTopFive"></proposal-list>
  124 + <div class="row">
  125 + <div class="col-xs-12">
  126 + <a ui-sref="ranking({tema: pagePrograma.category.slug, programa: pagePrograma.article.slug})" class="btn btn-link">
  127 + <span ng-if="pagePrograma.proposals.length > 1">Veja todas as {{pagePrograma.proposals.length}} propostas</span>
  128 + <span ng-if="pagePrograma.proposals.length === 1">Ir para a página de ranking</span>
  129 + </a>
  130 + </div>
  131 + </div>
124 </div> 132 </div>
125 </div> 133 </div>
126 </section> 134 </section>
@@ -138,16 +146,34 @@ @@ -138,16 +146,34 @@
138 title="'Você não está logado!'" 146 title="'Você não está logado!'"
139 message="'Você precisa estar logado para enviar uma proposta.'" 147 message="'Você precisa estar logado para enviar uma proposta.'"
140 ></show-message> 148 ></show-message>
141 - <div class="row">  
142 - <div class="col-sm-4"></div>  
143 - <div class="col-sm-8 text-center-sm">  
144 - <a ui-sref="entrar({redirect_uri: pagePrograma.sendProposalRedirectURI})">Clique aqui para ir para a página de login</a>  
145 - </div> 149 + <div class="row">
  150 + <div class="col-sm-4"></div>
  151 + <div class="col-sm-8 text-center-sm">
  152 + <a ui-sref="entrar({redirect_uri: pagePrograma.sendProposalRedirectURI})">Clique aqui para ir para a página de login</a>
146 </div> 153 </div>
  154 + </div>
147 </div> 155 </div>
148 <div ng-if="pagePrograma.$rootScope.currentUser"> 156 <div ng-if="pagePrograma.$rootScope.currentUser">
149 <div class="proposal-extended-section-content"> 157 <div class="proposal-extended-section-content">
150 - <cadastro-proposta program="pagePrograma.article"></cadastro-proposta> 158 + <div ng-if="pagePrograma.proposalStatus === pagePrograma.PROPOSAL_STATUS.SUCCESS">
  159 + <show-message
  160 + type="'success'"
  161 + title="'Proposta enviada com sucesso!'"
  162 + message="'Sua proposta foi enviada para a nossa equipe de moderação. Em aproximadamente 72 horas você receberá em seu endereço de e-mail uma resposta sobre a sua proposta.'"
  163 + ></show-message>
  164 + <div class="row">
  165 + <div class="col-sm-4"></div>
  166 + <div class="col-sm-8 text-center-sm">
  167 + <button type="button" class="btn btn-link" ng-click="pagePrograma.sendAnotherProposal()">
  168 + Clique aqui para enviar outra proposta
  169 + </button>
  170 + </div>
  171 + </div>
  172 + </div>
  173 + <div ng-if="pagePrograma.proposalStatus === pagePrograma.PROPOSAL_STATUS.ERROR"></div>
  174 + <div ng-if="!pagePrograma.proposalStatus">
  175 + <cadastro-proposta program="pagePrograma.article" status="pagePrograma.proposalStatus"></cadastro-proposta>
  176 + </div>
151 </div> 177 </div>
152 </div> 178 </div>
153 </div> 179 </div>
@@ -155,7 +181,7 @@ @@ -155,7 +181,7 @@
155 181
156 <section class="section-content"> 182 <section class="section-content">
157 <article class="program-content" ng-if="pagePrograma.article"> 183 <article class="program-content" ng-if="pagePrograma.article">
158 - <div ng-bind-html="pagePrograma.article.body"></div> 184 + <div ng-bind-html="pagePrograma.article.bodyTrusted"></div>
159 </article> 185 </article>
160 </section> 186 </section>
161 </div> 187 </div>
src/app/pages/programas/programas.controller.js
@@ -6,11 +6,12 @@ @@ -6,11 +6,12 @@
6 .controller('ProgramasPageController', ProgramasPageController); 6 .controller('ProgramasPageController', ProgramasPageController);
7 7
8 /** @ngInject */ 8 /** @ngInject */
9 - function ProgramasPageController(DialogaService, $scope, $location, $filter, $log) { 9 + function ProgramasPageController(DialogaService, $scope, $rootScope, $location, $filter, $log) {
10 var vm = this; 10 var vm = this;
11 11
12 vm.DialogaService = DialogaService; 12 vm.DialogaService = DialogaService;
13 vm.$scope = $scope; 13 vm.$scope = $scope;
  14 + vm.$rootScope = $rootScope;
14 vm.$location = $location; 15 vm.$location = $location;
15 vm.$filter = $filter; 16 vm.$filter = $filter;
16 vm.$log = $log; 17 vm.$log = $log;
@@ -18,8 +19,9 @@ @@ -18,8 +19,9 @@
18 vm.init(); 19 vm.init();
19 vm.loadData(); 20 vm.loadData();
20 vm.attachListeners(); 21 vm.attachListeners();
  22 + vm.$rootScope.focusMainContent();
21 23
22 - $log.debug('ProgramasPageController'); 24 + vm.$log.debug('ProgramasPageController');
23 } 25 }
24 26
25 ProgramasPageController.prototype.init = function () { 27 ProgramasPageController.prototype.init = function () {
@@ -159,7 +161,7 @@ @@ -159,7 +161,7 @@
159 var vm = this; 161 var vm = this;
160 162
161 if(!vm.programs){ 163 if(!vm.programs){
162 - vm.$log.warn('No programs loaded yet. Abort.'); 164 + vm.$log.info('No programs loaded yet. Abort.');
163 return null; 165 return null;
164 } 166 }
165 167
@@ -171,7 +173,7 @@ @@ -171,7 +173,7 @@
171 var filter = vm.$filter('filter'); 173 var filter = vm.$filter('filter');
172 174
173 if (selectedTheme) { 175 if (selectedTheme) {
174 - output = _filterByCategory(output, selectedTheme); 176 + output = vm._filterByCategory(output, selectedTheme);
175 } 177 }
176 178
177 if (query) { 179 if (query) {
@@ -179,13 +181,15 @@ @@ -179,13 +181,15 @@
179 } 181 }
180 182
181 if(!query && !selectedTheme && vm._showAllFlag){ 183 if(!query && !selectedTheme && vm._showAllFlag){
182 - output = _balanceByCategory(output); 184 + output = vm._balanceByCategory(output);
183 } 185 }
184 186
185 return output; 187 return output;
186 }; 188 };
187 189
188 - function _filterByCategory (input, category) { 190 + ProgramasPageController.prototype._filterByCategory = function (input, category) {
  191 + var vm = this;
  192 +
189 input = input || []; 193 input = input || [];
190 194
191 if (!category) { 195 if (!category) {
@@ -196,6 +200,12 @@ @@ -196,6 +200,12 @@
196 var out = []; 200 var out = [];
197 for (var i = 0; i < input.length; i++) { 201 for (var i = 0; i < input.length; i++) {
198 var program = input[i]; 202 var program = input[i];
  203 +
  204 + if(!program.categories || program.categories.length === 0){
  205 + vm.$log.warn('Program without theme (category)', program.slug);
  206 + continue;
  207 + }
  208 +
199 if (program.categories[0].slug === category.slug) { 209 if (program.categories[0].slug === category.slug) {
200 out.push(program); 210 out.push(program);
201 } 211 }
@@ -204,13 +214,21 @@ @@ -204,13 +214,21 @@
204 return out; 214 return out;
205 } 215 }
206 216
207 - function _balanceByCategory (input) { 217 + ProgramasPageController.prototype._balanceByCategory = function (input) {
  218 + var vm = this;
  219 +
208 var result = []; 220 var result = [];
209 var resultByCategory = {}; 221 var resultByCategory = {};
210 222
211 // divide by categories 223 // divide by categories
212 for (var i = 0; i < input.length; i++) { 224 for (var i = 0; i < input.length; i++) {
213 var program = input[i]; 225 var program = input[i];
  226 +
  227 + if(!program.categories || program.categories.length === 0){
  228 + vm.$log.warn('Program without theme (category)', program.slug);
  229 + continue;
  230 + }
  231 +
214 var categorySlug = program.categories[0].slug; 232 var categorySlug = program.categories[0].slug;
215 233
216 if (!resultByCategory[categorySlug]) { 234 if (!resultByCategory[categorySlug]) {
src/app/pages/programas/programas.html
@@ -6,12 +6,12 @@ @@ -6,12 +6,12 @@
6 </div> 6 </div>
7 </div> 7 </div>
8 8
9 -<div class="page--programas"> 9 +<div class="page--programas" role="main">
10 <section class="section--info"> 10 <section class="section--info">
11 <div class="container"> 11 <div class="container">
12 <div class="row"> 12 <div class="row">
13 <div class="col-sm-12"> 13 <div class="col-sm-12">
14 - <h1>Programas de governo</h1> 14 + <h1>Programas</h1>
15 </div> 15 </div>
16 </div> 16 </div>
17 </div> 17 </div>
src/app/pages/programas/programas.scss
@@ -21,6 +21,16 @@ @@ -21,6 +21,16 @@
21 background-position: center; 21 background-position: center;
22 background-size: cover; 22 background-size: cover;
23 background-repeat: no-repeat; 23 background-repeat: no-repeat;
  24 +
  25 +
  26 +
  27 + @media screen and (max-width: $screen-xs) {
  28 + // height: 15px;
  29 +
  30 + // .video {
  31 + // height: 290px;
  32 + // }
  33 + }
24 } 34 }
25 35
26 .program-preview--icon { 36 .program-preview--icon {
@@ -37,8 +47,8 @@ @@ -37,8 +47,8 @@
37 display: block; 47 display: block;
38 position: relative; 48 position: relative;
39 top: -8px; 49 top: -8px;
40 - left: -6px;  
41 - transform: scale($icon-scale); 50 + left: -8px;
  51 + // transform: scale($icon-scale);
42 } 52 }
43 53
44 .contraste & { 54 .contraste & {
src/app/pages/propostas/propostas.controller.js
1 -/**  
2 - * Controlador das páginas:  
3 - * - Propostas  
4 - * - Ranking  
5 - */  
6 (function() { 1 (function() {
7 'use strict'; 2 'use strict';
8 3
@@ -22,7 +17,7 @@ @@ -22,7 +17,7 @@
22 17
23 vm.init(); 18 vm.init();
24 vm.loadData(); 19 vm.loadData();
25 - vm.attachListeners(); 20 + // vm.attachListeners(); // attach listeners after load data (SYNC)
26 21
27 $log.debug('PropostasPageController'); 22 $log.debug('PropostasPageController');
28 } 23 }
@@ -32,6 +27,8 @@ @@ -32,6 +27,8 @@
32 27
33 vm.themes = null; 28 vm.themes = null;
34 vm.selectedTheme = null; 29 vm.selectedTheme = null;
  30 + vm.filtredPrograms = null;
  31 + vm.selectedProgram = null;
35 vm.proposals = null; 32 vm.proposals = null;
36 vm.filtredProposals = null; 33 vm.filtredProposals = null;
37 vm.query = null; 34 vm.query = null;
@@ -46,30 +43,47 @@ @@ -46,30 +43,47 @@
46 43
47 vm.loading = true; 44 vm.loading = true;
48 45
49 - // load Proposals  
50 - vm.loadingProposals = true;  
51 - vm.DialogaService.getProposals({}, function(data){  
52 - vm.proposals = data.articles;  
53 - vm.filtredProposals = vm.proposals;  
54 - vm.loadingProposals = false; 46 + // Behaviour:
  47 + // 1. Load themes
  48 + // 1. Load Proposals per_page
  49 + // END.
  50 +
  51 + // 1. Load themes
  52 + vm.loadingThemes = true;
  53 + vm.DialogaService.getThemes(function(themes){
  54 + vm.themes = themes;
  55 + vm.loadingThemes = false;
55 vm.loading = false; 56 vm.loading = false;
  57 +
  58 + vm.loadProposals(function (){
  59 + vm.attachListeners();
  60 + });
56 }, function (error) { 61 }, function (error) {
57 vm.error = error; 62 vm.error = error;
58 vm.$log.error(error); 63 vm.$log.error(error);
59 - vm.loadingProposals = false; 64 + vm.loadingThemes = false;
60 vm.loading = false; 65 vm.loading = false;
61 }); 66 });
  67 + };
62 68
63 - // load themes  
64 - vm.loadingThemes = true;  
65 - vm.DialogaService.getThemes(function(themes){  
66 - vm.themes = themes;  
67 - vm.loadingThemes = false; 69 + PropostasPageController.prototype.loadProposals = function (cb) {
  70 + var vm = this;
  71 +
  72 + // load Proposals
  73 + vm.loadingProposals = true;
  74 + vm.DialogaService.getProposals({}, function(data){
  75 + vm.proposals = data.articles;
  76 + vm.filtredProposals = vm.proposals;
  77 + vm.loadingProposals = false;
68 vm.loading = false; 78 vm.loading = false;
  79 +
  80 + if(cb){
  81 + cb();
  82 + }
69 }, function (error) { 83 }, function (error) {
70 vm.error = error; 84 vm.error = error;
71 vm.$log.error(error); 85 vm.$log.error(error);
72 - vm.loadingThemes = false; 86 + vm.loadingProposals = false;
73 vm.loading = false; 87 vm.loading = false;
74 }); 88 });
75 }; 89 };
@@ -81,12 +95,22 @@ @@ -81,12 +95,22 @@
81 vm.selectedTheme = selectedCategory; 95 vm.selectedTheme = selectedCategory;
82 }); 96 });
83 97
84 - vm.$scope.$watch('pagePropostas.selectedTheme', function(newValue/*, oldValue*/) { 98 + vm.$scope.$watch('pagePropostas.selectedTheme', function(newValue, oldValue) {
85 vm.search.tema = newValue ? newValue.slug : null; 99 vm.search.tema = newValue ? newValue.slug : null;
86 vm.$location.search('tema', vm.search.tema); 100 vm.$location.search('tema', vm.search.tema);
87 vm.filtredProposals = vm.getFiltredProposals(); 101 vm.filtredProposals = vm.getFiltredProposals();
88 }); 102 });
89 103
  104 + vm.$scope.$on('change-selectedTopic', function (event, selectedTopic) {
  105 + vm.selectedProgram = selectedTopic;
  106 + });
  107 +
  108 + vm.$scope.$watch('pagePropostas.selectedProgram', function(newValue, oldValue) {
  109 + vm.search.programa = newValue ? newValue.slug : null;
  110 + vm.$location.search('programa', vm.search.programa);
  111 + vm.filtredProposals = vm.getFiltredProposals();
  112 + });
  113 +
90 vm.$scope.$watch('pagePropostas.query', function(newValue/*, oldValue*/) { 114 vm.$scope.$watch('pagePropostas.query', function(newValue/*, oldValue*/) {
91 vm.search.filtro = newValue ? newValue : null; 115 vm.search.filtro = newValue ? newValue : null;
92 vm.$location.search('filtro', vm.search.filtro); 116 vm.$location.search('filtro', vm.search.filtro);
@@ -94,34 +118,6 @@ @@ -94,34 +118,6 @@
94 }); 118 });
95 }; 119 };
96 120
97 - PropostasPageController.prototype.filter = function() {  
98 - var vm = this;  
99 -  
100 - if (vm.search && vm.search.tema) {  
101 - var slug = vm.search.tema;  
102 - vm.$log.debug('filter by theme', slug);  
103 -  
104 - vm.DialogaService.getThemeBySlug(slug, function(theme){  
105 - vm.selectedTheme = theme;  
106 - vm.$log.debug('getThemeBySlug.slug', slug);  
107 - vm.$log.debug('getThemeBySlug.selectedTheme', theme);  
108 - }, function(error){  
109 - vm.$log.error('Error when try to "getThemeBySlug"', error);  
110 - });  
111 - }  
112 - };  
113 -  
114 - PropostasPageController.prototype.showAllPrograms = function($event) {  
115 - var vm = this;  
116 - $event.stopPropagation();  
117 -  
118 - vm.resetFilterValues();  
119 -  
120 - vm._showAllFlag = true;  
121 -  
122 - vm.filtredPrograms = vm.getFiltredPrograms();  
123 - };  
124 -  
125 PropostasPageController.prototype.resetFilterValues = function() { 121 PropostasPageController.prototype.resetFilterValues = function() {
126 var vm = this; 122 var vm = this;
127 123
@@ -133,7 +129,7 @@ @@ -133,7 +129,7 @@
133 var vm = this; 129 var vm = this;
134 130
135 if(!vm.proposals){ 131 if(!vm.proposals){
136 - vm.$log.warn('No proposals loaded yet. Abort.'); 132 + vm.$log.info('No proposals loaded yet. Abort.');
137 return null; 133 return null;
138 } 134 }
139 135
@@ -141,11 +137,16 @@ @@ -141,11 +137,16 @@
141 var output = input; 137 var output = input;
142 var query = vm.query; 138 var query = vm.query;
143 var selectedTheme = vm.selectedTheme; 139 var selectedTheme = vm.selectedTheme;
  140 + var selectedProgram = vm.selectedProgram;
144 141
145 var filter = vm.$filter('filter'); 142 var filter = vm.$filter('filter');
146 143
147 if (selectedTheme) { 144 if (selectedTheme) {
148 - output = _filterByCategory(output, selectedTheme); 145 + output = vm._filterByCategory(output, selectedTheme);
  146 + }
  147 +
  148 + if (selectedProgram) {
  149 + output = vm._filterByProgram(output, selectedProgram);
149 } 150 }
150 151
151 if (query) { 152 if (query) {
@@ -159,7 +160,9 @@ @@ -159,7 +160,9 @@
159 return output; 160 return output;
160 }; 161 };
161 162
162 - function _filterByCategory (input, category) { 163 + PropostasPageController.prototype._filterByCategory = function (input, category) {
  164 + var vm = this;
  165 +
163 input = input || []; 166 input = input || [];
164 167
165 if (!category) { 168 if (!category) {
@@ -178,4 +181,25 @@ @@ -178,4 +181,25 @@
178 return out; 181 return out;
179 } 182 }
180 183
  184 + PropostasPageController.prototype._filterByProgram = function (input, program) {
  185 + var vm = this;
  186 +
  187 + input = input || [];
  188 +
  189 + if (!program) {
  190 + // no filter
  191 + return input;
  192 + }
  193 +
  194 + var out = [];
  195 + for (var i = 0; i < input.length; i++) {
  196 + var proposal = input[i];
  197 + if (proposal.parent.id === program.id) {
  198 + out.push(proposal);
  199 + }
  200 + }
  201 +
  202 + return out;
  203 + }
  204 +
181 })(); 205 })();
src/app/pages/propostas/propostas.scss
@@ -2,4 +2,8 @@ @@ -2,4 +2,8 @@
2 .proposal-box--middle { 2 .proposal-box--middle {
3 background-color: #fff; 3 background-color: #fff;
4 } 4 }
  5 +
  6 + .topics-select--wrapper {
  7 + margin: 20px 0;
  8 + }
5 } 9 }
src/app/pages/propostas/ranking.html
@@ -1,98 +0,0 @@ @@ -1,98 +0,0 @@
1 -<div class="container">  
2 - <div class="row">  
3 - <div class="col-sm-12">  
4 - <div ncy-breadcrumb></div>  
5 - </div>  
6 - </div>  
7 -</div>  
8 -  
9 -<div class="page--propostas">  
10 - <section class="section--info">  
11 - <div class="container">  
12 - <div class="row">  
13 - <div class="col-sm-12">  
14 - <h1>Ranking</h1>  
15 - </div>  
16 - </div>  
17 - </div>  
18 - </section>  
19 - <section class="section--articles section-gray section-space-up" ng-if="pagePropostas.proposals">  
20 - <div class="container">  
21 - <div id="lista-de-propostas" class="row">  
22 - <div class="col-sm-4 col-md-3">  
23 - <div class="row visible-xs">  
24 - <div class="col-xs-12">  
25 - <div class="input-group input-group-lg input-group-search">  
26 - <label for="articleQueryFilter" class="control-label sr-only">Buscar propostas:</label>  
27 - <input id="articleQueryFilter" type="search" class="form-control input-search" ng-model="pagePropostas.query" placeholder="Buscar propostas" aria-label="Buscar propostas" >  
28 - <span class="input-group-btn">  
29 - <button type="button" class="btn btn-default" ng-click="pagePropostas.search()">  
30 - <span class="icon-circle icon-small color-theme-common-bg">  
31 - <span class="glyphicon glyphicon-search"></span>  
32 - </span>  
33 - <span class="sr-only">Buscar</span>  
34 - </button>  
35 - </span>  
36 - </div>  
37 - <br/>  
38 - </div>  
39 - </div>  
40 - <div ng-if="pagePropostas.themes">  
41 - <category-list categories="pagePropostas.themes" selected-category="pagePropostas.selectedTheme"></category-list>  
42 - </div>  
43 - <div ng-if="!pagePropostas.themes && pagePropostas.loadingThemes">  
44 - <div class="alert alert-info" role="alert">  
45 - Carregando temas.  
46 - </div>  
47 - </div>  
48 - <div ng-if="!pagePropostas.themes && pagePropostas.themesError">  
49 - <div class="alert alert-danger" role="alert">  
50 - Não foi possível carregar a lista de temas neste momento.  
51 - </div>  
52 - </div>  
53 - </div>  
54 - <div class="col-sm-8 col-md-9">  
55 - <div class="row hidden-xs">  
56 - <div class="col-xs-12">  
57 - <div class="input-group input-group-lg input-group-search">  
58 - <label for="articleQueryFilter" class="control-label sr-only">Buscar propostas:</label>  
59 - <input id="articleQueryFilter" type="search" class="form-control input-search" ng-model="pagePropostas.query" placeholder="Buscar propostas" aria-label="Buscar propostas" >  
60 - <span class="input-group-btn">  
61 - <button type="button" class="btn btn-default" ng-click="pagePropostas.search()">  
62 - <span class="icon-circle icon-small color-theme-common-bg">  
63 - <span class="glyphicon glyphicon-search"></span>  
64 - </span>  
65 - <span class="sr-only">Buscar</span>  
66 - </button>  
67 - </span>  
68 - </div>  
69 - </div>  
70 - </div>  
71 - <div class="row">  
72 - <div class="col-sm-12">  
73 - <header class="header">  
74 - <h2>Total de Propostas: "<span>{{pagePropostas.filtredProposals.length}} propostas</span>"</h2>  
75 - </header>  
76 - </div>  
77 - </div>  
78 -  
79 - <div class="row">  
80 - <div class="col-sm-12" ng-if="pagePropostas.proposals">  
81 - <proposal-list proposals="pagePropostas.filtredProposals" per-page="10"></proposal-list>  
82 - </div>  
83 - <div ng-if="!pagePropostas.proposals && pagePropostas.loadingProposals">  
84 - <div class="alert alert-info" role="alert">  
85 - Carregando propostas.  
86 - </div>  
87 - </div>  
88 - <div ng-if="!pagePropostas.proposals && pagePropostas.proposalsError">  
89 - <div class="alert alert-danger" role="alert">  
90 - Não foi possível carregar a lista de propostas neste momento.  
91 - </div>  
92 - </div>  
93 - </div>  
94 - </div>  
95 - </div>  
96 - </div>  
97 - </section>  
98 -</div>  
src/app/pages/ranking/ranking.controller.js 0 → 100644
@@ -0,0 +1,239 @@ @@ -0,0 +1,239 @@
  1 +(function() {
  2 + 'use strict';
  3 +
  4 + angular
  5 + .module('dialoga')
  6 + .controller('RankingPageController', RankingPageController);
  7 +
  8 + /** @ngInject */
  9 + function RankingPageController(DialogaService, $scope, $location, $filter, $log) {
  10 + var vm = this;
  11 +
  12 + vm.DialogaService = DialogaService;
  13 + vm.$scope = $scope;
  14 + vm.$location = $location;
  15 + vm.$filter = $filter;
  16 + vm.$log = $log;
  17 +
  18 + vm.init();
  19 + vm.loadData();
  20 + // vm.attachListeners(); // attach listeners after load data (SYNC)
  21 +
  22 + $log.debug('RankingPageController');
  23 + }
  24 +
  25 + RankingPageController.prototype.init = function () {
  26 + var vm = this;
  27 +
  28 + vm.page = 1;
  29 + vm.per_page = 20;
  30 + vm.themes = null;
  31 + vm.selectedTheme = null;
  32 + vm.filtredPrograms = null;
  33 + vm.selectedProgram = null;
  34 + vm.proposals = null;
  35 + vm.filtredProposals = null;
  36 + vm.query = null;
  37 + vm.search = vm.$location.search();
  38 +
  39 + vm.loading = null;
  40 + vm.error = null;
  41 + };
  42 +
  43 + RankingPageController.prototype.loadData = function () {
  44 + var vm = this;
  45 +
  46 + vm.loading = true;
  47 +
  48 + // Behaviour:
  49 + // 1. Load themes
  50 + // 2. Select a Random Theme (T)
  51 + // 3. Load programs of T
  52 + // 4. Select a random program of T
  53 + // 5. Filter the list of proposals
  54 + // END.
  55 +
  56 + // 1. Load themes
  57 + vm.loadingThemes = true;
  58 + vm.DialogaService.getThemes(function(themes){
  59 + vm.themes = themes;
  60 + vm.loadingThemes = false;
  61 +
  62 + // 2. Select a Random Theme (T)
  63 + var selectedTheme = null;
  64 + if(vm.search.tema){
  65 +
  66 + // vanilla filter
  67 + var results = vm.themes.filter(function(t){
  68 + return t.slug === vm.search.tema;
  69 + });
  70 +
  71 + if(results && results.length > 0){
  72 + selectedTheme = results[0];
  73 + vm.selectedTheme = selectedTheme;
  74 + }
  75 + }
  76 +
  77 + if(!selectedTheme){
  78 + vm.selectedTheme = vm.themes[Math.floor(Math.random() * vm.themes.length)];
  79 + }
  80 +
  81 + // 3. Load programs of T
  82 + // (AND 4)
  83 + var themeId = vm.selectedTheme.id;
  84 + vm.loadPrograms(themeId, function(){
  85 + vm.loadProposals();
  86 + vm.loading = false;
  87 + });
  88 + }, function (error) {
  89 + vm.error = error;
  90 + vm.$log.error(error);
  91 + vm.loadingThemes = false;
  92 + vm.loading = false;
  93 + });
  94 + };
  95 +
  96 + RankingPageController.prototype.loadPrograms = function (themeId, cb) {
  97 + var vm = this;
  98 +
  99 + vm.DialogaService.getProgramsByThemeId(themeId, function (programs){
  100 +
  101 + vm.filtredPrograms = programs;
  102 +
  103 + // 4. Select a random program of T
  104 + var selectedProgram = null;
  105 + if(vm.search.programa){
  106 +
  107 + // vanilla filter
  108 + var results = vm.filtredPrograms.filter(function(p){
  109 + return p.slug === vm.search.programa;
  110 + });
  111 +
  112 + if(results && results.length > 0){
  113 + selectedProgram = results[0];
  114 + vm.selectedProgram = selectedProgram;
  115 + }
  116 + }
  117 +
  118 + if(!selectedProgram){
  119 + vm.selectedProgram = vm.filtredPrograms[Math.floor(Math.random() * vm.filtredPrograms.length)];
  120 + }
  121 +
  122 + if(cb){
  123 + cb();
  124 + }
  125 + }, function(error){
  126 + vm.$log.error(error);
  127 + if(cb){
  128 + cb();
  129 + }
  130 + });
  131 + };
  132 +
  133 + RankingPageController.prototype.loadProposals = function () {
  134 + var vm = this;
  135 +
  136 + // load Proposals
  137 + vm.loadingProposals = true;
  138 + vm.DialogaService.getProposals({
  139 + page: vm.page,
  140 + per_page: vm.per_page
  141 + }, function(data){
  142 + vm.proposals = data.articles;
  143 + vm.filtredProposals = vm.proposals;
  144 + vm.loadingProposals = false;
  145 +
  146 + vm.attachListeners();
  147 + }, function (error) {
  148 + vm.error = error;
  149 + vm.$log.error(error);
  150 + vm.loadingProposals = false;
  151 + });
  152 + };
  153 +
  154 + RankingPageController.prototype.attachListeners = function() {
  155 + var vm = this;
  156 +
  157 + vm.$scope.$on('change-selectedCategory', function (event, selectedCategory) {
  158 + vm.selectedTheme = selectedCategory;
  159 + });
  160 +
  161 + vm.$scope.$watch('pageRanking.selectedTheme', function(newValue/*, oldValue*/) {
  162 + vm.search.tema = newValue ? newValue.slug : null;
  163 + vm.$location.search('tema', vm.search.tema);
  164 +
  165 + if(vm.selectedTheme && vm.selectedTheme.id){
  166 + vm.loadPrograms(vm.selectedTheme.id, function(){
  167 + vm.filterProposals();
  168 + });
  169 + }
  170 + });
  171 +
  172 + vm.$scope.$on('change-selectedTopic', function (event, selectedTopic) {
  173 + vm.selectedProgram = selectedTopic;
  174 + });
  175 +
  176 + vm.$scope.$watch('pageRanking.selectedProgram', function(newValue/*, oldValue*/) {
  177 + vm.search.programa = newValue ? newValue.slug : null;
  178 + vm.$location.search('programa', vm.search.programa);
  179 + vm.filterProposals();
  180 + });
  181 +
  182 + vm.$scope.$watch('pageRanking.query', function(newValue/*, oldValue*/) {
  183 + vm.search.filtro = newValue ? newValue : null;
  184 + vm.$location.search('filtro', vm.search.filtro);
  185 + vm.filterProposals();
  186 + });
  187 + };
  188 +
  189 + RankingPageController.prototype.resetFilterValues = function() {
  190 + var vm = this;
  191 +
  192 + vm.query = null;
  193 + vm.selectedTheme = null;
  194 + };
  195 +
  196 + RankingPageController.prototype.changePage = function(pageIndex) {
  197 + var vm = this;
  198 +
  199 + vm.page = pageIndex;
  200 + vm.filterProposals(pageIndex);
  201 + };
  202 +
  203 + RankingPageController.prototype.filterProposals = function(_page, _per_page) {
  204 + var vm = this;
  205 +
  206 + if (vm.loadingProposals){
  207 + vm.$log.debug('Content is not loaded yet.');
  208 + return;
  209 + }
  210 +
  211 + var page = _page || vm.page;
  212 + var per_page = _per_page || vm.per_page;
  213 + var query = vm.query;
  214 + var selectedProgram = vm.selectedProgram;
  215 +
  216 + if (selectedProgram) {
  217 + var params = {
  218 + page: page,
  219 + per_page: per_page,
  220 + parent_id: selectedProgram.id
  221 + };
  222 +
  223 + if (query) {params.query = query; }
  224 +
  225 + vm.loadingProposals = true;
  226 + vm.DialogaService.searchProposals(params, function(data){
  227 + vm.total_proposals = parseInt(data._obj.headers('total'));
  228 + vm.filtredProposals = data.articles;
  229 + vm.loadingProposals = false;
  230 + }, function (error) {
  231 + vm.error = error;
  232 + vm.$log.error(error);
  233 + vm.loadingProposals = false;
  234 + });
  235 + } else {
  236 + vm.filtredProposals = [];
  237 + }
  238 + };
  239 +})();
src/app/pages/ranking/ranking.html 0 → 100644
@@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
  1 +<div class="container">
  2 + <div class="row">
  3 + <div class="col-sm-12">
  4 + <div ncy-breadcrumb></div>
  5 + </div>
  6 + </div>
  7 +</div>
  8 +
  9 +<div class="page--propostas">
  10 + <section class="section--info">
  11 + <div class="container">
  12 + <div class="row">
  13 + <div class="col-sm-12">
  14 + <h1>Ranking</h1>
  15 + </div>
  16 + </div>
  17 + </div>
  18 + </section>
  19 + <section class="section--articles section-gray section-space-up" ng-if="pageRanking.proposals">
  20 + <div class="container">
  21 + <div id="lista-de-propostas" class="row">
  22 + <div class="col-sm-4 col-md-3">
  23 + <div ng-if="pageRanking.themes">
  24 + <category-list categories="pageRanking.themes" selected-category="pageRanking.selectedTheme" disable-unselect="true"></category-list>
  25 + </div>
  26 + <div ng-if="pageRanking.filtredPrograms && pageRanking.selectedProgram" class="topics-select--wrapper">
  27 + <topics-select topics="pageRanking.filtredPrograms" selected-topic="pageRanking.selectedProgram"></topics-select>
  28 + </div>
  29 + <div ng-if="!pageRanking.themes && pageRanking.loadingThemes">
  30 + <div class="alert alert-info" role="alert">
  31 + Carregando temas.
  32 + </div>
  33 + </div>
  34 + <div ng-if="!pageRanking.themes && pageRanking.themesError">
  35 + <div class="alert alert-danger" role="alert">
  36 + Não foi possível carregar a lista de temas neste momento.
  37 + </div>
  38 + </div>
  39 + </div>
  40 + <div class="col-sm-8 col-md-9">
  41 + <div class="row">
  42 + <div class="col-sm-12">
  43 + <header class="header">
  44 + <h2 style="margin-top:0;">Total de Propostas: "<span>{{pageRanking.total_proposals}} propostas</span>"</h2>
  45 + </header>
  46 + </div>
  47 + </div>
  48 +
  49 + <div class="row">
  50 + <div class="col-sm-12" ng-if="pageRanking.filtredProposals && pageRanking.total_proposals">
  51 + <proposal-list proposals="pageRanking.filtredProposals" per-page="pageRanking.per_page" total="pageRanking.total_proposals"></proposal-list>
  52 + <app-paginator
  53 + page="pageRanking.page"
  54 + per-page="pageRanking.per_page"
  55 + total="pageRanking.total_proposals"
  56 + change-page="pageRanking.changePage(pageIndex)"
  57 + ></app-paginator>
  58 + </div>
  59 + <div class="col-sm-12" ng-if="pageRanking.loadingProposals">
  60 + <div class="alert alert-info" role="alert">
  61 + Carregando propostas.
  62 + </div>
  63 + </div>
  64 + <div class="col-sm-12" ng-if="pageRanking.proposalsError">
  65 + <div class="alert alert-danger" role="alert">
  66 + Não foi possível carregar a lista de propostas neste momento.
  67 + </div>
  68 + </div>
  69 + </div>
  70 + </div>
  71 + </div>
  72 + </div>
  73 + </section>
  74 +</div>
src/assets/images/icons/tema-agricultura-small.png 0 → 100644

1.48 KB

src/assets/images/icons/tema-cidades-small.png 0 → 100644

1.2 KB

src/assets/images/icons/tema-cultura-small.png 0 → 100644

1.14 KB

src/assets/images/icons/tema-cultura.png

1.86 KB | W: | H:

2.24 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-desenvolvimento-produtivo-small.png 0 → 100644

1.39 KB

src/assets/images/icons/tema-educacao-small.png 0 → 100644

1.3 KB

src/assets/images/icons/tema-educacao.png

3.2 KB | W: | H:

2.74 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-esporte-small.png 0 → 100644

1.21 KB

src/assets/images/icons/tema-gestao-publica-small.png 0 → 100644

1.16 KB

src/assets/images/icons/tema-igualdade-small.png 0 → 100644

1.32 KB

src/assets/images/icons/tema-infraestrutura-small.png 0 → 100644

1.53 KB

src/assets/images/icons/tema-meio-ambiente-small.png 0 → 100644

1.03 KB

src/assets/images/icons/tema-meio-ambiente.png

1.91 KB | W: | H:

1.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-reducao-da-pobreza-small.png 0 → 100644

1.33 KB

src/assets/images/icons/tema-reducao-da-pobreza.png

2.94 KB | W: | H:

2.55 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-saude-small.png 0 → 100644

1.05 KB

src/assets/images/icons/tema-saude.png

2.19 KB | W: | H:

2.07 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-seguranca-publica-small.png 0 → 100644

1.24 KB

src/assets/images/icons/tema-seguranca-publica.png

2.86 KB | W: | H:

2.47 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-trabalho-emprego-e-renda-small.png 0 → 100644

1.24 KB

src/index.html
@@ -38,9 +38,10 @@ @@ -38,9 +38,10 @@
38 <![endif]--> 38 <![endif]-->
39 39
40 <app-header></app-header> 40 <app-header></app-header>
41 - 41 +
42 <div id="content" ui-view="main"></div> 42 <div id="content" ui-view="main"></div>
43 - <div ui-view="footer"></div> 43 +
  44 + <app-footer></app-footer>
44 45
45 <div id="footer-brasil"></div> 46 <div id="footer-brasil"></div>
46 47