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 | 109 | </div> |
| 110 | 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 | 117 | <div id="content" class="container"> |
| 115 | 118 | <div class="embed-responsive embed-responsive-16by9"> |
| ... | ... | @@ -479,7 +482,7 @@ |
| 479 | 482 | </div> |
| 480 | 483 | </script> |
| 481 | 484 | |
| 482 | - <div class="terms-of-use"> | |
| 485 | + <div class="terms-of-use text-center"> | |
| 483 | 486 | <a href="#/artigo/107880">Termos de uso</a> |
| 484 | 487 | </div> |
| 485 | 488 | ... | ... |
js/main.js
| ... | ... | @@ -18,13 +18,15 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 18 | 18 | |
| 19 | 19 | var loginButton; |
| 20 | 20 | |
| 21 | + var lastHash; | |
| 22 | + | |
| 21 | 23 | var participa = true; |
| 22 | 24 | |
| 23 | 25 | //Detects for localhost settings |
| 24 | 26 | var patt = new RegExp(":3000/"); |
| 25 | 27 | if(patt.test(window.location.href)) |
| 26 | 28 | participa = false; |
| 27 | - | |
| 29 | + | |
| 28 | 30 | if(participa){ |
| 29 | 31 | var host = 'http://www.participa.br'; |
| 30 | 32 | var proposal_discussion = '103358'; //participa |
| ... | ... | @@ -226,15 +228,16 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 226 | 228 | } |
| 227 | 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 | 232 | var url = host + '/api/v1/articles/' + article_id + '?private_token=' + Main.private_token; |
| 231 | 233 | $.getJSON(url).done(function( data ) { |
| 232 | - $('#article-container').html(articleTemplate(data.article)); | |
| 234 | + $('#article-container .article-content').html(articleTemplate(data.article)); | |
| 233 | 235 | $('#article-container').show(); |
| 234 | 236 | $('#proposal-categories').hide(); |
| 235 | 237 | $('#proposal-group').hide(); |
| 236 | 238 | $('nav').hide(); |
| 237 | 239 | $('#content').hide(); |
| 240 | + $('#article-container .go-back').attr('href', backTo); | |
| 238 | 241 | }); |
| 239 | 242 | }, |
| 240 | 243 | // inicio Eduardo |
| ... | ... | @@ -267,6 +270,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 267 | 270 | // this.randomProposalByTheme(['category-saude', 'category-seguranca-publica', 'category-educacao', 'category-reducao-da-pobreza']); |
| 268 | 271 | $('.proposal-item').show(); /* Show all programs */ |
| 269 | 272 | $('#proposal-group').show(); |
| 273 | + $('.proposal-category-items').hide(); | |
| 270 | 274 | $('#nav-proposal-group a').addClass('active'); |
| 271 | 275 | $('#nav-proposal-categories a').removeClass('active'); |
| 272 | 276 | $('#content').show(); |
| ... | ... | @@ -429,9 +433,10 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 429 | 433 | }, |
| 430 | 434 | locationHashChanged: function(){ |
| 431 | 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 | 440 | var scrollTop = 0; |
| 436 | 441 | var $nav = $('nav[role="tabpanel"]'); |
| 437 | 442 | var navOffset = $nav.offset(); |
| ... | ... | @@ -457,7 +462,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 457 | 462 | var isArticle = regexArticle.exec(hash) !== null; |
| 458 | 463 | |
| 459 | 464 | if(isArticle) { |
| 460 | - this.display_article(hash.split('/')[2]); | |
| 465 | + this.display_article(hash.split('/')[2], lastHash); | |
| 461 | 466 | } |
| 462 | 467 | |
| 463 | 468 | if( isProposal ){ | ... | ... |
sass/style.sass
| ... | ... | @@ -771,6 +771,18 @@ h1 |
| 771 | 771 | padding-right: 0 |
| 772 | 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 | 788 | // 7 - Modificadores |
| ... | ... | @@ -957,4 +969,4 @@ h3.titulo-destaque |
| 957 | 969 | .date,.time |
| 958 | 970 | color: #fff |
| 959 | 971 | .bloco-destaque |
| 960 | - background: darken(#fff, 85%) | |
| 961 | 972 | \ No newline at end of file |
| 973 | + background: darken(#fff, 85%) | ... | ... |