Commit 80c81783d55c4e5080a93a7a9ad559d228c1a8e2

Authored by Rafael Diego
2 parents 85310b3f f5c2810d

css do blockquote

Showing 49 changed files with 594 additions and 293 deletions   Show diff stats
.nvmrc 0 → 100644
... ... @@ -0,0 +1 @@
  1 +v0.12.7
... ...
gulp/images.js
... ... @@ -18,7 +18,8 @@ gulp.task('sprites', function () {
18 18 return sprity.src({
19 19 src: src,
20 20 style: 'sprite.css',
21   - cssPath: '../assets/images/icons/'
  21 + cssPath: '../assets/images/icons/',
  22 + cachebuster: true
22 23 })
23 24 .pipe(gulpif('*.png', gulp.dest(destImg), gulp.dest(destCss)));
24 25 });
... ...
script-staging.sh 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +#!/usr/bin/bash
  2 +
  3 +gulp clean && gulp build --staging
  4 +git add --all -f dist/
  5 +git commit -m "Update dist"
  6 +git push upstream staging && wget -qO- --no-check-certificate 'ci.serpro/view/Noosfero/job/DialogaApp-Deploy-Homologa%C3%A7%C3%A3o/build?token=DIALOGA_TOKEN' &> /dev/null
... ...
src/app/components/article-box/article-box.html
... ... @@ -7,7 +7,7 @@
7 7 <div class="article-box--title">
8 8 <h1>{{::vm.article.title}}</h1>
9 9 </div>
10   - <div class="article-box--abstract" ng-bind-html="vm.article.abstract"></div>
  10 + <div class="article-box--abstract" ng-bind-html="vm.article.summary"></div>
11 11 <div class="button--themed">
12 12 <button class="btn btn-block">
13 13 Participe
... ...
src/app/components/article-service/article.service.js
... ... @@ -146,6 +146,9 @@
146 146 var url = service.apiProposals + targetId + '/propose';
147 147  
148 148 var encodedParams = [];
  149 + encodedParams.push('article%5Babstract%5D=' + proposal);
  150 + encodedParams.push('article%5Btype%5D=ProposalsDiscussionPlugin%3A%3AProposal');
  151 + encodedParams.push('content_type=ProposalsDiscussionPlugin%3A%3AProposal');
149 152 encodedParams.push('private_token=' + $rootScope.currentUser.private_token);
150 153 encodedParams.push('fields=id');
151 154 encodedParams.push('article[name]=article_' + GUID.generate());
... ...
src/app/components/dialoga-service/dialoga.service.js
... ... @@ -25,6 +25,8 @@
25 25 extendedService.getQuestions = getQuestions;
26 26 extendedService.searchPrograms = searchPrograms;
27 27 extendedService.searchProposals = searchProposals;
  28 + extendedService.filterProposalsByCategorySlug = filterProposalsByCategorySlug;
  29 + extendedService.filterProposalsByProgramId = filterProposalsByProgramId;
28 30  
29 31 var CACHE = {};
30 32  
... ... @@ -230,6 +232,51 @@
230 232 ArticleService.searchProposals(params, cbSuccess, cbError);
231 233 }
232 234  
  235 + function filterProposalsByCategorySlug (input, categorySlug) {
  236 +
  237 + if(!angular.isArray(input)){
  238 + $log.error('Input is not a Array.');
  239 + return [];
  240 + }
  241 +
  242 + // Use native array filter
  243 + return input.filter(function(value/*, index, arr*/) {
  244 +
  245 + if (!value.parent) {
  246 + $log.warn('Proposal without a parent.');
  247 + return false;
  248 + }
  249 +
  250 + if (!value.parent.categories || value.parent.categories.length === 0) {
  251 + $log.warn('Proposal parent has no categories.');
  252 + return false;
  253 + }
  254 +
  255 + // match?!
  256 + return value.parent.categories[0].slug === categorySlug;
  257 + });
  258 + }
  259 +
  260 + function filterProposalsByProgramId (input, program_id) {
  261 +
  262 + if(!angular.isArray(input)){
  263 + $log.error('Input is not a Array.');
  264 + return [];
  265 + }
  266 +
  267 + // Use native array filter
  268 + return input.filter(function(value) {
  269 + if (!value.parent || !value.parent.id) {
  270 + $log.warn('Proposal has no parent.');
  271 +
  272 + return false;
  273 + }
  274 +
  275 + // match?!
  276 + return value.parent.id === program_id;
  277 + });
  278 + }
  279 +
233 280 function _pipeHandleYoutube (data) {
234 281 var abstract = data.article.abstract;
235 282  
... ... @@ -269,6 +316,31 @@
269 316 CACHE.programs = data.article.children;
270 317 CACHE.programs_count = data.article.children_count;
271 318 }
  319 +
  320 + _pipeHackPrograms(CACHE.programs);
  321 + }
  322 +
  323 + function _pipeHackPrograms (programs) {
  324 +
  325 + if(!angular.isArray(programs)){
  326 + return;
  327 + }
  328 +
  329 + var program = null;
  330 + var parts = null;
  331 + for (var i = programs.length - 1; i >= 0; i--) {
  332 + program = programs[i];
  333 +
  334 + if(!program.summary){
  335 + parts = program.abstract.split('<hr />');
  336 +
  337 + program.summary = $rootScope.stripHtml(parts[0]).trim();
  338 +
  339 + if(parts.length > 1){
  340 + program.summaryExtended = parts[1].trim();
  341 + }
  342 + }
  343 + }
272 344 }
273 345  
274 346 // Calculate color pallet
... ...
src/app/components/navbar/navbar.html
1 1 <div class="app-navbar">
2 2 <nav id="navigation" class="header-navbar navbar navbar-static-top" role="navigation">
3 3 <div class="navbar-header">
4   - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
5   - <span class="sr-only">Alternar menu de navegação</span>
6   - <span class="icon-bar" aria-hidden="true"></span>
7   - <span class="icon-bar" aria-hidden="true"></span>
8   - <span class="icon-bar" aria-hidden="true"></span>
9   - </button>
10   - <a class="navbar-brand" ui-sref="inicio">
11   - <img src="/assets/images/logo.png" alt="Dialoga Brasil | O país fica melhor quando você participa" />
12   - </a>
  4 + <div class="row">
  5 + <div class="row-height">
  6 + <div class="col-xs-10 col-xs-height col-middle">
  7 + <a class="navbar-brand" ui-sref="inicio">
  8 + <img src="/assets/images/logo.png" class="img-responsive" alt="Dialoga Brasil | O país fica melhor quando você participa" />
  9 + </a>
  10 + </div>
  11 + <div class="col-xs-2 col-xs-height col-middle">
  12 + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
  13 + <span class="sr-only">Alternar menu de navegação</span>
  14 + <span class="icon-bar" aria-hidden="true"></span>
  15 + <span class="icon-bar" aria-hidden="true"></span>
  16 + <span class="icon-bar" aria-hidden="true"></span>
  17 + </button>
  18 + </div>
  19 + </div>
  20 + </div>
13 21 </div>
14 22  
15 23 <div id="navbar-collapse" class="collapse navbar-collapse">
... ... @@ -28,7 +36,7 @@
28 36 </div>
29 37 </nav>
30 38  
31   - <div id="dialoga-nas-redes">
  39 + <div id="dialoga-nas-redes" class="hidden-xs">
32 40 <div class="text text-right">
33 41 <p>DIALOGA<br><b>NAS REDES</b></p>
34 42 </div>
... ...
src/app/components/navbar/navbar.scss
... ... @@ -19,8 +19,6 @@
19 19 }
20 20  
21 21 .navbar-toggle {
22   - padding: 12px 10px;
23   - margin-top: 20px;
24 22 border-radius: 100%;
25 23 background-color: #5e749d;
26 24  
... ... @@ -30,13 +28,12 @@
30 28 }
31 29  
32 30 @media screen and (max-width: $screen-md) {
33   - margin-top: 45px;
  31 + padding: 12px 10px;
  32 + margin: 0;
34 33 }
35 34 }
36 35  
37 36 .navbar-nav .divider span {
38   - padding: 0 0 10px 0;
39   - margin: 53px 10px 0 10px;
40 37 display: block;
41 38  
42 39 @media screen and (max-width: $screen-md) {
... ... @@ -48,11 +45,9 @@
48 45 padding: 0;
49 46 }
50 47  
51   - .navbar-nav > li {
  48 + .navbar-nav {
52 49  
53   - & > a {
54   - padding: 0 0 10px 0;
55   - margin: 55px 10px 0 10px;
  50 + li > a {
56 51 text-transform: uppercase;
57 52 color: #616161;
58 53 font-weight: bold;
... ... @@ -65,41 +60,149 @@
65 60 .contraste & {
66 61 color: #fff;
67 62 }
  63 + }
  64 +
  65 + li.active > a {
  66 + border-bottom: 2px solid #77BB34;
  67 + }
  68 + }
68 69  
69   - @media screen and (max-width: $screen-md) {
70   - margin-top: 5px;
  70 + .contraste & {
  71 + .nav > li > a:hover,
  72 + .nav > li > a:focus {
  73 + color: #fff;
  74 + }
  75 +
  76 + .active a {
  77 + border-bottom-color: #fff;
  78 + }
  79 + }
  80 +
  81 + // <= Mobile
  82 + @media screen and (max-width: ($screen-sm - 1)) {
  83 + .navbar-collapse {
  84 + margin: 0 -15px;
  85 + }
  86 +
  87 + .navbar-nav {
  88 + background-color: #eee;
  89 +
  90 + & > li {
  91 + // border-top: 1px solid #ccc;
  92 + -moz-border-image: -moz-linear-gradient(left, #eee 0%, #ccc 100%);
  93 + -webkit-border-image: -webkit-linear-gradient(left, #eee 0%, #ccc 100%);
  94 + border-image: linear-gradient(to right, #eee 0%, #ccc 100%);
  95 + border-image-slice: 1;
  96 +
  97 + border-top: 1px solid #ccc;
  98 + border-bottom: 0px solid #ccc;
  99 + border-left: 0px solid #ccc;
  100 + border-right: 0px solid #ccc;
  101 + &:last-child {
  102 + border-bottom: 1px solid #ccc;
  103 + }
  104 + }
  105 +
  106 + & > li > a {
  107 + padding: 12px 20px;
  108 + margin: 0;
71 109 text-align: right;
72 110 }
  111 +
  112 + & > li.active > a {
  113 + border-bottom: none;
  114 + border-right: 4px solid #77BB34;
  115 + }
  116 +
  117 + .dropdown-toggle {
  118 + margin-top: 0px;
  119 +
  120 + }
  121 + .dropdown-menu {
  122 + position: relative;
  123 + margin-right: 10px;
  124 + }
  125 +
  126 + .social-share {
  127 + float: right;
  128 + }
  129 + }
  130 +
  131 + }
  132 +
  133 + // >= Table, < Destop
  134 + @media screen and (min-width: $screen-sm) and (max-width: ($screen-md - 1)) {
  135 + .navbar-brand {
  136 + padding-top: 0;
  137 + margin-top: 0;
  138 + margin-bottom: 60px;
73 139 }
74 140  
75   - &.active > a {
76   - border-bottom: 3px solid #77BB34;
  141 + .navbar-collapse {
  142 + position: absolute;
  143 + left: 0;
  144 + bottom: 0;
  145 + width: 100%;
77 146  
78   - @media screen and (max-width: $screen-md) {
79   - border: none;
80   - background-color: #eee;
81   - padding: 10px 30px 10px 0px;
82   - border-right: 3px solid #77BB34;
  147 + ul.navbar-nav {
  148 + width: 100%;
  149 + float: none;
  150 + }
  151 +
  152 + li > a {
  153 + margin: 0 10px;
  154 + padding: 0 0 10px 0;
  155 + }
  156 +
  157 + li.dropdown {
  158 + position: absolute;
  159 + right: 0;
  160 + bottom: 0;
  161 +
  162 + .dropdown-toggle {
  163 + position: relative;
  164 + width: 160px;
  165 + margin: 0 5px 5px 0;
  166 + padding: 0;
  167 + }
83 168 }
84 169 }
  170 + }
  171 + // >= Desktop
  172 + @media screen and (min-width: $screen-md) {
85 173  
86   - .dropdown-toggle {
87   - margin-top: 50px;
  174 + li > a {
  175 + padding: 15px 0;
  176 + margin: 0 9px;
  177 + }
88 178  
89   - @media screen and (max-width: $screen-md) {
90   - margin-top: 0px;
  179 + li.divider span{
  180 + padding: 12px 0;
  181 + line-height: 20px;
  182 + }
  183 +
  184 + li.dropdown {
  185 + .dropdown-toggle {
  186 + padding: 6px 10px;
  187 + margin: 0;
91 188 }
92 189 }
93 190 }
94 191  
95   - .contraste & {
96   - .nav > li > a:hover,
97   - .nav > li > a:focus {
98   - color: #fff;
  192 + // > Desktop Large
  193 + @media screen and (min-width: $screen-lg) {
  194 + .navbar-brand {
  195 + margin-bottom: 30px;
99 196 }
100 197  
101   - .active a {
102   - border-bottom-color: #fff;
  198 + ul.navbar-nav {
  199 + position: absolute;
  200 + right: 0;
  201 + bottom: 0;
  202 + }
  203 +
  204 + li.divider span{
  205 + padding: 12px 6px;
103 206 }
104 207 }
105 208 }
... ... @@ -116,4 +219,4 @@
116 219 right: 210px;
117 220 width: 100px;
118 221 }
119   -}
120 222 \ No newline at end of file
  223 +}
... ...
src/app/components/proposal-box/proposal-box.html
... ... @@ -148,7 +148,7 @@
148 148 </div>
149 149 <div class="proposal-box--bottom text-center">
150 150 <div class="proposal-box--share">
151   - <span>COMPARTILHE ESSA <b>PROPOSTA</b></span>
  151 + <span>COMPARTILHE ESTA <b>PROPOSTA</b></span>
152 152 <div class="dropdown">
153 153 <button id="dropdown-share-btn" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Mostrar ou esconder a lista redes sociais para compartilhamento"><span class="icon icon-social-share-small" aria-hidden="true"></span></button>
154 154 <social-share class="dropdown-menu dropdown-menu-right"></social-share>
... ...
src/app/components/proposal-carousel/proposal-carousel.scss
... ... @@ -16,6 +16,14 @@
16 16 right: 15px;
17 17 top: 8px;
18 18  
  19 + li {
  20 + padding-left: 15px;
  21 +
  22 + &:first-child {
  23 + padding-left: 0;
  24 + }
  25 + }
  26 +
19 27 button {
20 28 border: 1px solid #fff;
21 29 border-radius: 100%;
... ...
src/app/components/proposal-stats/proposal-stats.scss
... ... @@ -7,6 +7,11 @@
7 7  
8 8 li {
9 9 margin: 0 5px;
  10 + padding-left: 15px;
  11 +
  12 + &:first-child {
  13 + padding-left: 0px;
  14 + }
10 15 }
11 16  
12 17 &-views {}
... ...
src/app/components/show-message/show-message.directive.js
... ... @@ -19,8 +19,8 @@
19 19 templateUrl: 'app/components/show-message/show-message.html',
20 20 scope: {
21 21 type: '=',
22   - title: '=',
23   - message: '='
  22 + message: '=',
  23 + description: '='
24 24 },
25 25 controller: ShowMessageController,
26 26 controllerAs: 'vm',
... ...
src/app/components/show-message/show-message.html
... ... @@ -8,8 +8,8 @@
8 8 </div>
9 9 </div>
10 10 <div class="col-sm-8 message-content text-center-sm">
11   - <h3>{{ ::vm.title }}</h3>
12   - <p>{{ ::vm.message }}</p>
  11 + <h3>{{ ::vm.message }}</h3>
  12 + <div ng-bind-html="vm.description"></div>
13 13 </div>
14 14 </div>
15 15 </div>
... ...
src/app/components/social-share/social-share.html
... ... @@ -3,12 +3,13 @@
3 3 </div>
4 4 <ul class="social-share list-inline">
5 5 <li>
6   - <!-- socialshare-via="687948707977695" -->
  6 + <!-- socialshare-via="687948707977695" dialoga -->
  7 + <!-- socialshare-via="476168325877872" MyApp / Test -->
7 8 <a href="#" role="button"
8 9 socialshare
9 10 socialshare-provider="facebook"
10 11 socialshare-type="feed"
11   - socialshare-via="476168325877872"
  12 + socialshare-via="687948707977695"
12 13 socialshare-url="http://dialoga.gov.br"
13 14 socialshare-redirect-uri="https://dialoga.gov.br/"
14 15 socialshare-media="http://dialoga.gov.br/images/logo.png"
... ...
src/app/components/social-share/social-share.scss
... ... @@ -10,6 +10,7 @@
10 10 &.list-inline {
11 11 margin: 0;
12 12 }
  13 +
13 14 li {
14 15 float: left;
15 16 padding: 0;
... ... @@ -33,7 +34,7 @@
33 34 background-color: #E0E0E0;
34 35 border-radius: 5px;
35 36  
36   - @media screen and (max-width: $screen-xs) {
  37 + @media screen and (max-width: $screen-sm) {
37 38 background-color: #fff;
38 39 }
39 40  
... ... @@ -58,6 +59,11 @@
58 59 right: 20px;
59 60 border-width: 0 10px 10px;
60 61 border-bottom-color: #E0E0E0;
  62 +
  63 +
  64 + @media screen and (max-width: $screen-sm) {
  65 + border-bottom-color: #fff;
  66 + }
61 67 }
62 68  
63 69 @media screen and (max-width: $screen-xs) {
... ...
src/app/components/util-service/utils.service.js
... ... @@ -68,7 +68,7 @@
68 68 // nomralized format. However, if the request was not handled by the
69 69 // server (or what not handles properly - ex. server error), then we
70 70 // may have to normalize it on our end, as best we can.
71   - if (!angular.isObject(error.data) || !error.data.message) {
  71 + if (!angular.isObject(error.data)) {
72 72 return $q.reject('An unknown error occurred.');
73 73 }
74 74  
... ...
src/app/layout.scss
... ... @@ -24,28 +24,28 @@
24 24 vertical-align: bottom;
25 25 }
26 26  
27   -@media (min-width: 480px) {
28   - .row-xs-height {
  27 +// @media (min-width: 480px) {
  28 +.row-xs-height {
29 29 display: table;
30 30 table-layout: fixed;
31 31 height: 100%;
32 32 width: 100%;
33   - }
34   - .col-xs-height {
  33 +}
  34 +.col-xs-height {
35 35 display: table-cell;
36 36 float: none;
37 37 height: 100%;
38   - }
39   - .col-xs-top {
  38 +}
  39 +.col-xs-top {
40 40 vertical-align: top;
41   - }
42   - .col-xs-middle {
  41 +}
  42 +.col-xs-middle {
43 43 vertical-align: middle;
44   - }
45   - .col-xs-bottom {
  44 +}
  45 +.col-xs-bottom {
46 46 vertical-align: bottom;
47   - }
48 47 }
  48 +// }
49 49  
50 50 @media (min-width: 768px) {
51 51 .row-sm-height {
... ... @@ -228,10 +228,24 @@ ul.list-color li:before {
228 228 color: #2a9677;
229 229 }
230 230  
231   -ul li {
232   - padding-left: 2em;
233   - padding-bottom: 15px;
234   - text-indent: -0.7em;
  231 +.page--program {
  232 + .program-content {
  233 + ul li {
  234 + padding-left: 2em;
  235 + padding-bottom: 15px;
  236 + text-indent: -0.7em;
  237 + }
  238 +
  239 + .col-middle {
  240 + vertical-align: top;
  241 + }
  242 +
  243 + @media screen and (min-width: $screen-lg) {
  244 + img {
  245 + width: 100%;
  246 + }
  247 + }
  248 + }
235 249 }
236 250  
237 251 .destaque-bg-cinza {
... ... @@ -293,40 +307,44 @@ a.link-black {
293 307 color: black;
294 308 }
295 309  
296   -article.program-content {
297   - margin-top: 40px;
298   -}
299   -
300   -article.program-content div.ng-binding div.container div.row {
301   - margin-bottom: 40px;
302   -}
303   -
304   -article.program-content h3 {
305   - margin-bottom: 15px;
306   -}
307   -
308 310 .inline-block {
309 311 display: inline-block;
310 312 }
311 313  
  314 +// Sobreescreve a classe do bootstrap
  315 +.close {
  316 + color: white;
  317 + opacity: 1;
  318 + font-weight: normal;
  319 +}
  320 +
312 321 blockquote {
313 322 border-left: medium none;
314 323 font-size: 140%;
315 324 padding: 45px 0 0 45px;
316 325 position: relative;
317 326 margin: 0px;
  327 + border-left: none;
  328 + font-size: 24px;
  329 + line-height: 28px;
  330 + padding: 50px 0 0 50px;
  331 + position: relative;
  332 +
  333 + @each $category, $color in $categories {
  334 + .#{$category} & {
  335 + color: $color;
  336 + }
  337 + }
318 338  
319 339 &:before {
320 340 content: "⌜";
321 341 font-size: 200px;
322   - left: -2px;
  342 + line-height: 200px;
323 343 position: absolute;
324   - top: -50px;
  344 + top: -10px;
  345 + left: -10px;
325 346 font-weight: bolder;
326   - left: -17px;
327   - top: -68px;
328   - @each $category,
329   - $color in $categories {
  347 + @each $category, $color in $categories {
330 348 .#{$category} & {
331 349 color: $color;
332 350 }
... ... @@ -349,16 +367,6 @@ blockquote p {
349 367 font-weight: normal;
350 368 }
351 369  
352   -// .img-responsive {
353   -// width: 100%;
354   -// }
355   -//strong {
356   -// @each $category, $color in $categories {
357   -// .#{$category} & {
358   -// color: $color;
359   -// }
360   -// }
361   -//}
362 370 .top-border-theme {
363 371 @each $category,
364 372 $color in $categories {
... ...
src/app/pages/auth/recover.html
... ... @@ -17,8 +17,8 @@
17 17 <div class="feedback-message">
18 18 <show-message
19 19 type="'success'"
20   - title="pageSignin.successRecoverMessageTitle || 'Pronto!'"
21   - message="pageSignin.successRecoverMessage"
  20 + message="pageSignin.successRecoverMessageTitle || 'Pronto!'"
  21 + description="pageSignin.successRecoverMessage"
22 22 ></show-message>
23 23 <div class="row">
24 24 <div class="col-sm-8 col-sm-offset-4">
... ...
src/app/pages/auth/signin.html
... ... @@ -14,21 +14,21 @@
14 14 <div class="feedback-message">
15 15 <show-message
16 16 type="'success'"
17   - title="pageSignin.messageTitle || 'Você está logado!'"
18   - message="pageSignin.successMessage"
  17 + message="pageSignin.messageTitle || 'Você está logado!'"
  18 + description="pageSignin.successMessage"
19 19 ></show-message>
20 20  
21 21 <div class="row">
22 22 <div class="col-sm-4"></div>
23 23 <div class="col-sm-8 text-center-sm">
24   - <!-- <div ng-if="pageSignin.redirect > 0">
25   - </div> -->
26 24 <div ng-if="pageSignin.countdown > 0">
27 25 <p>
28 26 Você será redirecionado em menos de <b>{{pageSignin.countdown}} segundos</b>...
29 27 </p>
30 28 </div>
31   - <button type="button" ng-click="pageSignin.onClickLogout()" class="btn btn-primary">Sair</button>
  29 + <div ng-if="!pageSignin.hasRedirect">
  30 + <a ui-sref="inicio" class="btn btn-primary">Ir para a Página Inicial</a>
  31 + </div>
32 32 </div>
33 33 </div>
34 34 </div>
... ...
src/app/pages/inicio/inicio.controller.js
... ... @@ -160,6 +160,21 @@
160 160 vm.article.videoIsLoaded = true;
161 161 };
162 162  
  163 + InicioPageController.prototype.submitSearch = function() {
  164 + var vm = this;
  165 +
  166 + vm.loadingFilter = true;
  167 +
  168 + // scroll to result grid
  169 + var $searchResult = angular.element('#search-result');
  170 + if($searchResult && $searchResult.length > 0){
  171 + angular.element('body').animate({scrollTop: $searchResult.offset().top}, 'fast');
  172 + vm.filtredPrograms = vm.getFiltredPrograms();
  173 + }else{
  174 + vm.$log.warn('#search-result element not found.');
  175 + }
  176 + };
  177 +
163 178 InicioPageController.prototype.filter = function() {
164 179 var vm = this;
165 180  
... ... @@ -218,6 +233,7 @@
218 233 var selectedTheme = vm.selectedTheme;
219 234  
220 235 var filter = vm.$filter('filter');
  236 + vm.loadingFilter = true;
221 237  
222 238 if (selectedTheme) {
223 239 output = vm._filterByCategory(output, selectedTheme);
... ... @@ -231,6 +247,7 @@
231 247 output = _balanceByCategory(output);
232 248 }
233 249  
  250 + vm.loadingFilter = false;
234 251 return output;
235 252 };
236 253  
... ... @@ -259,7 +276,7 @@
259 276 }
260 277  
261 278 return out;
262   - }
  279 + };
263 280  
264 281 function _balanceByCategory (input) {
265 282 var result = [];
... ...
src/app/pages/inicio/inicio.html
... ... @@ -88,7 +88,7 @@
88 88 <label for="articleQueryFilter1" class="control-label sr-only">Buscar programas:</label>
89 89 <input id="articleQueryFilter1" type="search" class="form-control input-search" ng-model="pageInicio.query" placeholder="Buscar programas" aria-label="Buscar programas" >
90 90 <span class="input-group-btn">
91   - <button type="button" class="btn btn-default" ng-click="pageInicio.search()">
  91 + <button type="button" class="btn btn-default" ng-click="pageInicio.submitSearch()">
92 92 <span class="icon-circle icon-small color-theme-common-bg">
93 93 <span class="glyphicon glyphicon-search"></span>
94 94 </span>
... ... @@ -120,7 +120,7 @@
120 120 <label for="articleQueryFilter2" class="control-label sr-only">Buscar programas:</label>
121 121 <input id="articleQueryFilter2" type="search" class="form-control input-search" ng-model="pageInicio.query" placeholder="Buscar programas" aria-label="Buscar programas" >
122 122 <span class="input-group-btn">
123   - <button type="button" class="btn btn-default" ng-click="pageInicio.search()">
  123 + <button type="button" class="btn btn-default" ng-click="pageInicio.submitSearch()">
124 124 <span class="icon-circle icon-small color-theme-common-bg">
125 125 <span class="glyphicon glyphicon-search"></span>
126 126 </span>
... ... @@ -130,12 +130,12 @@
130 130 </div>
131 131 </div>
132 132 </div>
133   - <div class="row">
  133 + <div id="search-result" class="row">
134 134 <div class="col-sm-12">
135 135 <header class="header">
136 136 <h2>Programas</h2>
137 137 <button type="button" class="btn btn-link" ng-click="pageInicio.showAllPrograms($event)">
138   - <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> Ver todos os programas
  138 + <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> Ver todos os {{::pageInicio.programs.length}} programas
139 139 </button>
140 140 </header>
141 141 </div>
... ...
src/app/pages/programas/programa.controller.js
... ... @@ -122,10 +122,22 @@
122 122  
123 123 vm.DialogaService.createProposal(proposal, vm.article.id, function(response) {
124 124 vm.$log.debug('response', response);
  125 + // vm.message =
125 126 // vm.proposalStatus = vm.PROPOSAL_STATUS.SENT | vm.PROPOSAL_STATUS.SUCCESS;
126 127 vm.proposalStatus = vm.PROPOSAL_STATUS.SUCCESS;
127 128 }, function(error) {
128 129 vm.$log.error(error);
  130 +
  131 + vm.error = error;
  132 +
  133 + if (vm.error.code === 400){
  134 + // Bad Request
  135 + vm.error.message = '';
  136 + vm.error.message += 'Não foi possível enviar a proposta.<br>';
  137 + vm.error.message += 'Este problema já foi registrado em nossos servidores.<br>';
  138 + vm.error.message += 'Por favor, tente novamente mais tarde.';
  139 + }
  140 +
129 141 // vm.proposalStatus = vm.PROPOSAL_STATUS.SENT | vm.PROPOSAL_STATUS.ERROR;
130 142 vm.proposalStatus = vm.PROPOSAL_STATUS.ERROR;
131 143 });
... ...
src/app/pages/programas/programa.html
... ... @@ -18,94 +18,103 @@
18 18 </div>
19 19 </section>
20 20  
21   - <div role="main">
22   - <section ng-if="pagePrograma.article.body" ng-class="pagePrograma.category.slug">
  21 + <div role="main" ng-class="pagePrograma.category.slug">
  22 + <section ng-if="pagePrograma.article.body">
23 23 <div class="container">
24 24 <div class="row">
25 25 <article class="program-preview">
26   - <!-- Preview > Titulo -->
27   - <div class="col-md-12">
28   - <h1 class="program-preview--title color-theme-fg">{{::pagePrograma.article.title}}</h1>
29   - </div>
30   - <!-- Preview > coluna da esquerda -->
31   - <div class="col-md-8">
32   - <div class="program-preview--box contraste-box">
33   - <div class="program-preview--banner" ng-style="{'background-image':'url( {{::pagePrograma.banner.src}} )'}"></div>
34   - <div class="program-preview--box--content-wrapper">
35   - <div class="program-preview--icon icon-wrapper-rounded color-theme-bg" ng-class="pagePrograma.category.slug">
36   - <span class="icon" ng-class="'icon-tema-' + pagePrograma.category.slug"></span>
37   - </div>
38   - <div class="program-preview--abstract color-theme-fg">
39   - <h2>{{::stripHtml(pagePrograma.article.abstract)}}</h2>
40   - </div>
41   - <div class="program-preview--abstract-details">
42   - <p>Lorem ipsum dolor sit amet, ea veniam mucius ocurreret vix, ius ex nisl vidisse partiendo. Blandit nominavi cum ei, paulo quaestio his ei, eum minim salutandi in. Civibus albucius in quo, et eam posse facilisis. Debet suavitate sea ut, his ei feugiat fastidii eleifend. Quo ex quando maiestatis voluptatum, mel te perpetua maiestatis, sit ceteros legendos deserunt ea. Enim dolores moderatius eu pro, ad quo ignota aliquid meliore.</p>
43   - </div>
44   - <div class="program-preview--share">
45   - <div class="program-preview--share-label">Compartilhe este programa:</div>
46   - <social-share class="program-preview--share-directive"></social-share>
  26 + <!-- Preview > Titulo -->
  27 + <div class="col-md-12">
  28 + <h1 class="program-preview--title color-theme-fg">{{::pagePrograma.article.title}}</h1>
  29 + </div>
  30 + <!-- Preview > coluna da esquerda -->
  31 + <div class="col-md-8">
  32 + <div class="program-preview--box contraste-box">
  33 + <div class="program-preview--banner" ng-style="{'background-image':'url( {{::pagePrograma.banner.src}} )'}"></div>
  34 + <div class="program-preview--box--content-wrapper">
  35 + <div class="program-preview--icon icon-wrapper-rounded color-theme-bg" ng-class="pagePrograma.category.slug">
  36 + <span class="icon" ng-class="'icon-tema-' + pagePrograma.category.slug"></span>
  37 + </div>
  38 + <div class="program-preview--abstract color-theme-fg">
  39 + <h2>{{::stripHtml(pagePrograma.article.summary)}}</h2>
  40 + </div>
  41 + <div class="program-preview--abstract-details">
  42 + <div ng-bind-html="pagePrograma.article.summaryExtended"></div>
  43 + </div>
  44 + <div class="program-preview--share">
  45 + <div class="program-preview--share-label">COMPARTILHE ESTE <b>PROGRAMA</b></div>
  46 + <div class="dropdown">
  47 + <button id="dropdown-share-btn" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Mostrar ou esconder a lista redes sociais para compartilhamento"><span class="icon icon-social-share-small" aria-hidden="true"></span></button>
  48 + <social-share
  49 + url=""
  50 + text=""
  51 + image=""
  52 + arrow-class="social-share--arrow"
  53 + class="dropdown-menu dropdown-menu-right"
  54 + ></social-share>
47 55 </div>
48   - <div class="program-preview--make-proposal">
49   - <div class="row">
50   - <div class="col-sm-6">
51   - <div class="button--themed">
52   - <button type="button" class="btn btn-block" ng-click="pagePrograma.showProposalForm()">Faça uma proposta</button>
53   - </div>
  56 + </div>
  57 + <div class="program-preview--make-proposal">
  58 + <div class="row">
  59 + <div class="col-sm-6">
  60 + <div class="button--themed">
  61 + <button type="button" class="btn btn-block" ng-click="pagePrograma.showProposalForm()">Faça uma proposta</button>
54 62 </div>
55 63 </div>
56 64 </div>
57 65 </div>
58 66 </div>
59 67 </div>
60   - <!-- Preview > coluna da direita -->
61   - <div class="col-md-4">
62   - <div class="row">
  68 + </div>
  69 + <!-- Preview > coluna da direita -->
  70 + <div class="col-md-4">
  71 + <div class="row">
63 72  
64   - <!-- Top Proposals -->
65   - <div>
66   - <!-- Loading Top Proposals -->
67   - <div ng-if="pagePrograma.loadingTopProposals">
68   - <div class="alert alert-info" role="alert">
69   - Carregando propostas mais votadas...
70   - </div>
  73 + <!-- Top Proposals -->
  74 + <div>
  75 + <!-- Loading Top Proposals -->
  76 + <div ng-if="pagePrograma.loadingTopProposals">
  77 + <div class="alert alert-info" role="alert">
  78 + Carregando propostas mais votadas...
71 79 </div>
  80 + </div>
72 81  
73   - <!-- Top Proposals > Carousel -->
74   - <div class="col-xs-12" ng-if="!pagePrograma.loadingTopProposals && pagePrograma.proposalsTopRated && pagePrograma.proposalsTopRated.length > 0">
75   - <h3 class="color-theme-fg">Propostas mais votadas</h3>
76   - <proposal-carousel proposals="pagePrograma.proposalsTopRated"></proposal-carousel>
77   - </div>
  82 + <!-- Top Proposals > Carousel -->
  83 + <div class="col-xs-12" ng-if="!pagePrograma.loadingTopProposals && pagePrograma.proposalsTopRated && pagePrograma.proposalsTopRated.length > 0">
  84 + <h3 class="color-theme-fg">Propostas mais votadas</h3>
  85 + <proposal-carousel proposals="pagePrograma.proposalsTopRated"></proposal-carousel>
78 86 </div>
  87 + </div>
79 88  
80   - <!-- Proposal Box -->
81   - <div>
82   - <div class="col-xs-12" ng-if="!pagePrograma.loadingProposalBox && pagePrograma.randomProposal" ng-class="{'focused-proposal': !!pagePrograma.search.proposal_id}">
83   - <h3 class="color-theme-fg">Apoie outras propostas</h3>
84   - <proposal-box proposal="pagePrograma.randomProposal" topic="pagePrograma.article" category="pagePrograma.category" can-vote="true" focus="{{pagePrograma.search.proposal_id}}" ></proposal-box>
85   - </div>
  89 + <!-- Proposal Box -->
  90 + <div>
  91 + <div class="col-xs-12" ng-if="!pagePrograma.loadingProposalBox && pagePrograma.randomProposal" ng-class="{'focused-proposal': !!pagePrograma.search.proposal_id}">
  92 + <h3 class="color-theme-fg">Apoie outras propostas</h3>
  93 + <proposal-box proposal="pagePrograma.randomProposal" topic="pagePrograma.article" category="pagePrograma.category" can-vote="true" focus="{{pagePrograma.search.proposal_id}}" ></proposal-box>
  94 + </div>
86 95  
87   - <!-- Loading Proposal Box -->
88   - <div ng-if="pagePrograma.loadingProposalBox">
89   - <div class="alert alert-info" role="alert">
90   - Carregando propostas nesse programa...
91   - </div>
  96 + <!-- Loading Proposal Box -->
  97 + <div ng-if="pagePrograma.loadingProposalBox">
  98 + <div class="alert alert-info" role="alert">
  99 + Carregando propostas nesse programa...
92 100 </div>
93 101 </div>
  102 + </div>
94 103  
95   - <!-- No Proposals? okay! -->
96   - <div ng-if="!pagePrograma.loadingTopProposals && !pagePrograma.loadingProposalBox">
97   - <div class="col-xs-12" ng-if="!pagePrograma.randomProposal && !(pagePrograma.proposalsTopRated && pagePrograma.proposalsTopRated.length > 0)">
98   - <h3>Programas sem propostas</h3>
99   - <p>
100   - Este programa ainda não possui nenhuma proposta.
101   - <div class="button--themed">
102   - <button type="button" class="btn btn-block" ng-click="pagePrograma.showProposalForm()">Faça uma proposta</button>
103   - </div>
104   - </p>
105   - </div>
  104 + <!-- No Proposals? okay! -->
  105 + <div ng-if="!pagePrograma.loadingTopProposals && !pagePrograma.loadingProposalBox">
  106 + <div class="col-xs-12" ng-if="!pagePrograma.randomProposal && !(pagePrograma.proposalsTopRated && pagePrograma.proposalsTopRated.length > 0)">
  107 + <h3>Programas sem propostas</h3>
  108 + <p>
  109 + Este programa ainda não possui nenhuma proposta.
  110 + <div class="button--themed">
  111 + <button type="button" class="btn btn-block" ng-click="pagePrograma.showProposalForm()">Faça uma proposta</button>
  112 + </div>
  113 + </p>
106 114 </div>
107 115 </div>
108 116 </div>
  117 + </div>
109 118 </article>
110 119 </div>
111 120 </div>
... ... @@ -143,8 +152,8 @@
143 152 <div ng-if="!pagePrograma.$rootScope.currentUser">
144 153 <show-message
145 154 type="'alert'"
146   - title="'Você não está logado!'"
147   - message="'Você precisa estar logado para enviar uma proposta.'"
  155 + message="'Você não está logado!'"
  156 + description="'Você precisa estar logado para enviar uma proposta.'"
148 157 ></show-message>
149 158 <div class="row">
150 159 <div class="col-sm-4"></div>
... ... @@ -158,8 +167,26 @@
158 167 <div ng-if="pagePrograma.proposalStatus === pagePrograma.PROPOSAL_STATUS.SUCCESS">
159 168 <show-message
160 169 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.'"
  170 + message="'Proposta enviada com sucesso!'"
  171 + description="'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.'"
  172 + ></show-message>
  173 + <div class="row">
  174 + <div class="col-sm-4"></div>
  175 + <div class="col-sm-8 text-center-sm">
  176 + <button type="button" class="btn btn-link" ng-click="pagePrograma.sendAnotherProposal()">
  177 + Clique aqui para enviar outra proposta
  178 + </button>
  179 + </div>
  180 + </div>
  181 + </div>
  182 + <div ng-if="pagePrograma.proposalStatus === pagePrograma.PROPOSAL_STATUS.SENDING">
  183 + Enviando...
  184 + </div>
  185 + <div ng-if="pagePrograma.proposalStatus === pagePrograma.PROPOSAL_STATUS.ERROR">
  186 + <show-message
  187 + type="'error'"
  188 + message="'Erro ' + pagePrograma.error.code + '!'"
  189 + description="pagePrograma.error.message"
163 190 ></show-message>
164 191 <div class="row">
165 192 <div class="col-sm-4"></div>
... ... @@ -170,7 +197,6 @@
170 197 </div>
171 198 </div>
172 199 </div>
173   - <div ng-if="pagePrograma.proposalStatus === pagePrograma.PROPOSAL_STATUS.ERROR"></div>
174 200 <div ng-if="!pagePrograma.proposalStatus">
175 201 <cadastro-proposta program="pagePrograma.article" status="pagePrograma.proposalStatus"></cadastro-proposta>
176 202 </div>
... ...
src/app/pages/programas/programas.controller.js
... ... @@ -212,7 +212,7 @@
212 212 }
213 213  
214 214 return out;
215   - }
  215 + };
216 216  
217 217 ProgramasPageController.prototype._balanceByCategory = function (input) {
218 218 var vm = this;
... ... @@ -276,5 +276,5 @@
276 276 }
277 277  
278 278 return result;
279   - }
  279 + };
280 280 })();
... ...
src/app/pages/programas/programas.scss
... ... @@ -7,81 +7,151 @@
7 7 }
8 8 }
9 9  
10   -.program-preview {
  10 +.page--program {
11 11  
12   - .program-preview--box {
13   - position: relative;
14   - background-color: #f1f1f1;
15   - }
  12 + .program-preview {
16 13  
17   - .program-preview--banner {
18   - width: 100%;
19   - height: 400px;
  14 + .program-preview--box {
  15 + position: relative;
  16 + background-color: #f1f1f1;
  17 + }
  18 +
  19 + .program-preview--banner {
  20 + width: 100%;
  21 + height: 400px;
20 22  
21   - background-position: center;
22   - background-size: cover;
23   - background-repeat: no-repeat;
  23 + background-position: center;
  24 + background-size: cover;
  25 + background-repeat: no-repeat;
24 26  
25 27  
26 28  
27   - @media screen and (max-width: $screen-xs) {
28   - // height: 15px;
  29 + @media screen and (max-width: $screen-xs) {
  30 + // height: 15px;
29 31  
30   - // .video {
31   - // height: 290px;
32   - // }
  32 + // .video {
  33 + // height: 290px;
  34 + // }
  35 + }
33 36 }
34   - }
35 37  
36   - .program-preview--icon {
37   - $icon-size: 98px;
38   - $icon-scale: 0.7;
39   - position: absolute;
40   - top: (-1) * ($icon-size / 2);
41   - left: 40px;
  38 + .program-preview--icon {
  39 + $icon-size: 80px;
  40 + $icon-scale: 0.7;
  41 + position: absolute;
  42 + top: (-1) * ($icon-size / 2);
  43 + left: 40px;
  44 +
  45 + width: $icon-size * $icon-scale + 25px;
  46 + height: $icon-size * $icon-scale + 25px;
  47 +
  48 + .icon {
  49 + display: block;
  50 + position: relative;
  51 + top: -2px;
  52 + left: -2px;
  53 + }
  54 +
  55 + .contraste & {
  56 + border: 1px solid #fff;
  57 + }
  58 + }
42 59  
43   - width: $icon-size * $icon-scale + 20px;
44   - height: $icon-size * $icon-scale + 20px;
  60 + .program-preview--box--content-wrapper {
  61 + padding: 48px;
  62 + position: relative;
  63 + }
  64 +
  65 + .program-preview--abstract {
  66 + h2 {
  67 + margin-top: 22px; // parent.margin + this.margin = 48 + 22 = 72px;
  68 + margin-bottom: 32px;
  69 + }
  70 + }
45 71  
46   - .icon {
47   - display: block;
  72 + .program-preview--abstract-details {
  73 + p {
  74 + color: #484848;
  75 + font-size: 14px;
  76 + line-height: 18px;
  77 + margin-bottom: 25px;
  78 + }
  79 + }
  80 +
  81 + .program-preview--share {
  82 + margin-bottom: 20px;
48 83 position: relative;
49   - top: -8px;
50   - left: -8px;
51   - // transform: scale($icon-scale);
  84 + .dropdown {
  85 + display: inline-block;
  86 + position: relative;
  87 + }
  88 +
  89 + .dropdown-menu {
  90 + padding: 0;
  91 + margin: 0;
  92 + }
  93 +
  94 + .social-share {
  95 + background-color: #fff;
  96 + }
  97 +
  98 + .social-share--arrow {
  99 + border-bottom-color: #fff;
  100 + }
52 101 }
53 102  
54   - .contraste & {
55   - border: 1px solid #fff;
  103 + .program-preview--share-label,
  104 + .program-preview--share-directive {
  105 + display: inline-block;
  106 + vertical-align: middle;
56 107 }
57   - }
58 108  
59   - .program-preview--box--content-wrapper {
60   - padding: 40px;
61   - position: relative;
62   - }
  109 + h1 {
  110 + font-size: 38px;
  111 + line-height: 40px;
  112 + font-weight: 900;
  113 + }
63 114  
64   - .program-preview--share-label,
65   - .program-preview--share-directive {
66   - display: inline-block;
67   - vertical-align: middle;
  115 + h2 {
  116 + font-size: 32px;
  117 + line-height: 36px;
  118 + font-weight: bold;
  119 + }
68 120 }
69 121  
70   - .program-preview--abstract h2 {
71   - font-size: 40px;
72   - }
  122 + .program-content {
73 123  
74   - h2,
75   - h3{
76   - font-weight: bold;
77   - }
  124 + margin-top: 40px;
78 125  
79   - h3 {
80   - margin-top: 0;
81   - }
82   -}
  126 + h3 {
  127 + font-size: 22px;
  128 + line-height: 26px;
  129 + font-weight: bold;
83 130  
84   -.page--program {
  131 + margin-top: 0;
  132 + margin-bottom: 15px;
  133 + }
  134 +
  135 + h4 {
  136 + font-size: 18px;
  137 + line-height: 24px;
  138 + font-weight: bold;
  139 + }
  140 +
  141 + h5 {
  142 + font-size: 16px;
  143 + line-height: 22px;
  144 + }
  145 +
  146 + p {
  147 + font-size: 14px;
  148 + line-height: 18px;
  149 + }
  150 +
  151 + .container > .row {
  152 + margin-bottom: 40px;
  153 + }
  154 + }
85 155  
86 156 .btn-close {
87 157 position: absolute;
... ...
src/app/pages/propostas/propostas.controller.js
... ... @@ -22,7 +22,7 @@
22 22 $log.debug('PropostasPageController');
23 23 }
24 24  
25   - PropostasPageController.prototype.init = function () {
  25 + PropostasPageController.prototype.init = function() {
26 26 var vm = this;
27 27  
28 28 vm.themes = null;
... ... @@ -38,7 +38,7 @@
38 38 vm.error = null;
39 39 };
40 40  
41   - PropostasPageController.prototype.loadData = function () {
  41 + PropostasPageController.prototype.loadData = function() {
42 42 var vm = this;
43 43  
44 44 vm.loading = true;
... ... @@ -50,15 +50,15 @@
50 50  
51 51 // 1. Load themes
52 52 vm.loadingThemes = true;
53   - vm.DialogaService.getThemes(function(themes){
  53 + vm.DialogaService.getThemes(function(themes) {
54 54 vm.themes = themes;
55 55 vm.loadingThemes = false;
56 56 vm.loading = false;
57 57  
58   - vm.loadProposals(function (){
  58 + vm.loadProposals(function() {
59 59 vm.attachListeners();
60 60 });
61   - }, function (error) {
  61 + }, function(error) {
62 62 vm.error = error;
63 63 vm.$log.error(error);
64 64 vm.loadingThemes = false;
... ... @@ -66,21 +66,21 @@
66 66 });
67 67 };
68 68  
69   - PropostasPageController.prototype.loadProposals = function (cb) {
  69 + PropostasPageController.prototype.loadProposals = function(cb) {
70 70 var vm = this;
71 71  
72 72 // load Proposals
73 73 vm.loadingProposals = true;
74   - vm.DialogaService.getProposals({}, function(data){
  74 + vm.DialogaService.getProposals({}, function(data) {
75 75 vm.proposals = data.articles;
76 76 vm.filtredProposals = vm.proposals;
77 77 vm.loadingProposals = false;
78 78 vm.loading = false;
79 79  
80   - if(cb){
  80 + if (cb) {
81 81 cb();
82 82 }
83   - }, function (error) {
  83 + }, function(error) {
84 84 vm.error = error;
85 85 vm.$log.error(error);
86 86 vm.loadingProposals = false;
... ... @@ -91,21 +91,21 @@
91 91 PropostasPageController.prototype.attachListeners = function() {
92 92 var vm = this;
93 93  
94   - vm.$scope.$on('change-selectedCategory', function (event, selectedCategory) {
  94 + vm.$scope.$on('change-selectedCategory', function(event, selectedCategory) {
95 95 vm.selectedTheme = selectedCategory;
96 96 });
97 97  
98   - vm.$scope.$watch('pagePropostas.selectedTheme', function(newValue, oldValue) {
  98 + vm.$scope.$watch('pagePropostas.selectedTheme', function(newValue/*, oldValue*/) {
99 99 vm.search.tema = newValue ? newValue.slug : null;
100 100 vm.$location.search('tema', vm.search.tema);
101 101 vm.filtredProposals = vm.getFiltredProposals();
102 102 });
103 103  
104   - vm.$scope.$on('change-selectedTopic', function (event, selectedTopic) {
  104 + vm.$scope.$on('change-selectedTopic', function(event, selectedTopic) {
105 105 vm.selectedProgram = selectedTopic;
106 106 });
107 107  
108   - vm.$scope.$watch('pagePropostas.selectedProgram', function(newValue, oldValue) {
  108 + vm.$scope.$watch('pagePropostas.selectedProgram', function(newValue/*, oldValue*/) {
109 109 vm.search.programa = newValue ? newValue.slug : null;
110 110 vm.$location.search('programa', vm.search.programa);
111 111 vm.filtredProposals = vm.getFiltredProposals();
... ... @@ -128,7 +128,7 @@
128 128 PropostasPageController.prototype.getFiltredProposals = function() {
129 129 var vm = this;
130 130  
131   - if(!vm.proposals){
  131 + if (!vm.proposals) {
132 132 vm.$log.info('No proposals loaded yet. Abort.');
133 133 return null;
134 134 }
... ... @@ -142,64 +142,18 @@
142 142 var filter = vm.$filter('filter');
143 143  
144 144 if (selectedTheme) {
145   - output = vm._filterByCategory(output, selectedTheme);
  145 + output = vm.DialogaService.filterProposalsByCategorySlug(output, selectedTheme.slug);
146 146 }
147 147  
148 148 if (selectedProgram) {
149   - output = vm._filterByProgram(output, selectedProgram);
  149 + output = vm.DialogaService.filterProposalsByProgramId(output, selectedProgram.id);
150 150 }
151 151  
152 152 if (query) {
153 153 output = filter(output, query, false);
154 154 }
155 155  
156   - // if(!query && !selectedTheme && vm._showAllFlag){
157   - // output = _balanceByCategory(output);
158   - // }
159   -
160 156 return output;
161 157 };
162 158  
163   - PropostasPageController.prototype._filterByCategory = function (input, category) {
164   - var vm = this;
165   -
166   - input = input || [];
167   -
168   - if (!category) {
169   - // no filter
170   - return input;
171   - }
172   -
173   - var out = [];
174   - for (var i = 0; i < input.length; i++) {
175   - var proposal = input[i];
176   - if (proposal.parent.categories[0].slug === category.slug) {
177   - out.push(proposal);
178   - }
179   - }
180   -
181   - return out;
182   - }
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   -
205 159 })();
... ...
src/assets/images/icons/feedback-login-success-blue.png

4.29 KB

src/assets/images/icons/feedback-login-success-green.png

4.4 KB

src/assets/images/icons/feedback-login-success-red.png

4.33 KB

src/assets/images/icons/feedback-login-success-yellow.png

3.86 KB

src/assets/images/icons/feedback-proposal-sent-blue.png

3.53 KB

src/assets/images/icons/feedback-proposal-sent-green.png

3.63 KB

src/assets/images/icons/feedback-proposal-sent-red.png

3.53 KB

src/assets/images/icons/feedback-proposal-sent-yellow.png

3.15 KB

src/assets/images/icons/feedback-user-created.png

3.2 KB

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

3.1 KB | W: | H:

2.83 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-cidades.png

2.45 KB | W: | H:

2.16 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-cultura.png

2.24 KB | W: | H:

2.26 KB | W: | H:

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

2.88 KB | W: | H:

2.57 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-educacao.png

2.74 KB | W: | H:

2.48 KB | W: | H:

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

2.21 KB | W: | H:

2.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-gestao-publica.png

2.1 KB | W: | H:

2.04 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-igualdade.png

2.73 KB | W: | H:

2.37 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-infraestrutura.png

2.99 KB | W: | H:

2.75 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
src/assets/images/icons/tema-meio-ambiente.png

1.9 KB | W: | H:

1.88 KB | W: | H:

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

2.55 KB | W: | H:

2.36 KB | W: | H:

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

2.07 KB | W: | H:

1.95 KB | W: | H:

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

2.47 KB | W: | H:

2.29 KB | W: | H:

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

2.38 KB | W: | H:

2.15 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin