Commit 26bc4a8334be6986fda01476e0cae9bbe563c124
Exists in
master
and in
5 other branches
Merge branch 'master' of https://gitlab.com/participa/proposal-app
Showing
3 changed files
with
29 additions
and
9 deletions
Show diff stats
index.html
@@ -109,7 +109,10 @@ | @@ -109,7 +109,10 @@ | ||
109 | </div> | 109 | </div> |
110 | </header> | 110 | </header> |
111 | 111 | ||
112 | - <div id="article-container" class="hide"></div> | 112 | + <div id="article-container" class="article-container hide"> |
113 | + <a href="#" class="go-back">Voltar</a> | ||
114 | + <div class="article-content"></div> | ||
115 | + </div> | ||
113 | 116 | ||
114 | <div id="content" class="container"> | 117 | <div id="content" class="container"> |
115 | <div class="embed-responsive embed-responsive-16by9"> | 118 | <div class="embed-responsive embed-responsive-16by9"> |
@@ -479,7 +482,7 @@ | @@ -479,7 +482,7 @@ | ||
479 | </div> | 482 | </div> |
480 | </script> | 483 | </script> |
481 | 484 | ||
482 | - <div class="terms-of-use"> | 485 | + <div class="terms-of-use text-center"> |
483 | <a href="#/artigo/107880">Termos de uso</a> | 486 | <a href="#/artigo/107880">Termos de uso</a> |
484 | </div> | 487 | </div> |
485 | 488 |
js/main.js
@@ -18,13 +18,15 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -18,13 +18,15 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
18 | 18 | ||
19 | var loginButton; | 19 | var loginButton; |
20 | 20 | ||
21 | + var lastHash; | ||
22 | + | ||
21 | var participa = true; | 23 | var participa = true; |
22 | 24 | ||
23 | //Detects for localhost settings | 25 | //Detects for localhost settings |
24 | var patt = new RegExp(":3000/"); | 26 | var patt = new RegExp(":3000/"); |
25 | if(patt.test(window.location.href)) | 27 | if(patt.test(window.location.href)) |
26 | participa = false; | 28 | participa = false; |
27 | - | 29 | + |
28 | if(participa){ | 30 | if(participa){ |
29 | var host = 'http://www.participa.br'; | 31 | var host = 'http://www.participa.br'; |
30 | var proposal_discussion = '103358'; //participa | 32 | var proposal_discussion = '103358'; //participa |
@@ -226,15 +228,16 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -226,15 +228,16 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
226 | } | 228 | } |
227 | return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); | 229 | return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); |
228 | }, | 230 | }, |
229 | - display_article: function(article_id) { | 231 | + display_article: function(article_id, backTo) { |
230 | var url = host + '/api/v1/articles/' + article_id + '?private_token=' + Main.private_token; | 232 | var url = host + '/api/v1/articles/' + article_id + '?private_token=' + Main.private_token; |
231 | $.getJSON(url).done(function( data ) { | 233 | $.getJSON(url).done(function( data ) { |
232 | - $('#article-container').html(articleTemplate(data.article)); | 234 | + $('#article-container .article-content').html(articleTemplate(data.article)); |
233 | $('#article-container').show(); | 235 | $('#article-container').show(); |
234 | $('#proposal-categories').hide(); | 236 | $('#proposal-categories').hide(); |
235 | $('#proposal-group').hide(); | 237 | $('#proposal-group').hide(); |
236 | $('nav').hide(); | 238 | $('nav').hide(); |
237 | $('#content').hide(); | 239 | $('#content').hide(); |
240 | + $('#article-container .go-back').attr('href', backTo); | ||
238 | }); | 241 | }); |
239 | }, | 242 | }, |
240 | // inicio Eduardo | 243 | // inicio Eduardo |
@@ -267,6 +270,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -267,6 +270,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
267 | // this.randomProposalByTheme(['category-saude', 'category-seguranca-publica', 'category-educacao', 'category-reducao-da-pobreza']); | 270 | // this.randomProposalByTheme(['category-saude', 'category-seguranca-publica', 'category-educacao', 'category-reducao-da-pobreza']); |
268 | $('.proposal-item').show(); /* Show all programs */ | 271 | $('.proposal-item').show(); /* Show all programs */ |
269 | $('#proposal-group').show(); | 272 | $('#proposal-group').show(); |
273 | + $('.proposal-category-items').hide(); | ||
270 | $('#nav-proposal-group a').addClass('active'); | 274 | $('#nav-proposal-group a').addClass('active'); |
271 | $('#nav-proposal-categories a').removeClass('active'); | 275 | $('#nav-proposal-categories a').removeClass('active'); |
272 | $('#content').show(); | 276 | $('#content').show(); |
@@ -429,9 +433,10 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -429,9 +433,10 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
429 | }, | 433 | }, |
430 | locationHashChanged: function(){ | 434 | locationHashChanged: function(){ |
431 | var hash = window.location.hash; | 435 | var hash = window.location.hash; |
432 | - this.navigateTo(hash); | 436 | + this.navigateTo(hash, lastHash); |
437 | + lastHash = hash; | ||
433 | }, | 438 | }, |
434 | - navigateTo: function(hash){ | 439 | + navigateTo: function(hash, lastHash) { |
435 | var scrollTop = 0; | 440 | var scrollTop = 0; |
436 | var $nav = $('nav[role="tabpanel"]'); | 441 | var $nav = $('nav[role="tabpanel"]'); |
437 | var navOffset = $nav.offset(); | 442 | var navOffset = $nav.offset(); |
@@ -457,7 +462,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -457,7 +462,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
457 | var isArticle = regexArticle.exec(hash) !== null; | 462 | var isArticle = regexArticle.exec(hash) !== null; |
458 | 463 | ||
459 | if(isArticle) { | 464 | if(isArticle) { |
460 | - this.display_article(hash.split('/')[2]); | 465 | + this.display_article(hash.split('/')[2], lastHash); |
461 | } | 466 | } |
462 | 467 | ||
463 | if( isProposal ){ | 468 | if( isProposal ){ |
sass/style.sass
@@ -771,6 +771,18 @@ h1 | @@ -771,6 +771,18 @@ h1 | ||
771 | padding-right: 0 | 771 | padding-right: 0 |
772 | padding-top: $gutter * 0.25 | 772 | padding-top: $gutter * 0.25 |
773 | 773 | ||
774 | +// 6.17 - artigo | ||
775 | +.article-container | ||
776 | + max-width: 1170px | ||
777 | + margin-left: auto | ||
778 | + margin-right: auto | ||
779 | + .abstract | ||
780 | + font-style: italic | ||
781 | + color: rgb(114, 114, 114) | ||
782 | + margin-bottom: 30px | ||
783 | + margin-top: 10px | ||
784 | + .title | ||
785 | + font-size: 22px | ||
774 | 786 | ||
775 | // ------------------------------------ | 787 | // ------------------------------------ |
776 | // 7 - Modificadores | 788 | // 7 - Modificadores |
@@ -957,4 +969,4 @@ h3.titulo-destaque | @@ -957,4 +969,4 @@ h3.titulo-destaque | ||
957 | .date,.time | 969 | .date,.time |
958 | color: #fff | 970 | color: #fff |
959 | .bloco-destaque | 971 | .bloco-destaque |
960 | - background: darken(#fff, 85%) | ||
961 | \ No newline at end of file | 972 | \ No newline at end of file |
973 | + background: darken(#fff, 85%) |