Commit ffd0b176dadfdc67e91e2a5004ee0c43948955ac

Authored by Leonardo Merlin
2 parents e25c6279 2203e2e6

Merge branch 'master' of https://gitlab.com/participa/proposal-app

1 source 'https://rubygems.org' 1 source 'https://rubygems.org'
2 -gem 'sass', '~> 3.4.9' 2 +gem 'sass', '3.4.13'
@@ -7,4 +7,4 @@ PLATFORMS @@ -7,4 +7,4 @@ PLATFORMS
7 ruby 7 ruby
8 8
9 DEPENDENCIES 9 DEPENDENCIES
10 - sass (~> 3.4.13) 10 + sass (= 3.4.13)
@@ -100,8 +100,8 @@ @@ -100,8 +100,8 @@
100 <header class="container"> 100 <header class="container">
101 <a id="display-contrast" href="#">Alto Contraste</a> 101 <a id="display-contrast" href="#">Alto Contraste</a>
102 <div class="participar"> 102 <div class="participar">
103 - <a href="#" class="button button-inline participe">Participe</a>  
104 - <a href="#" class="entrar">Entrar</a> 103 + <!--<a href="#" class="button button-inline participe">Participe</a>-->
  104 + <!--<a href="#" class="entrar">Entrar</a>-->
105 <a href="#" class="logout hide">Sair</a> 105 <a href="#" class="logout hide">Sair</a>
106 </div> 106 </div>
107 <h1> 107 <h1>
@@ -374,7 +374,7 @@ @@ -374,7 +374,7 @@
374 <table class="footable"> 374 <table class="footable">
375 <thead> 375 <thead>
376 <tr class="header"> 376 <tr class="header">
377 - <th class="position">Posição <a href="#" class="hidden-xs"><span class="fa fa-question"></span></a></th> 377 + <th class="position">Posição <a href="#/artigo/108047" class="hidden-xs"><span class="fa fa-question"></span></a></th>
378 <th class="abstract-text" data-toggle="true">Propostas</th> 378 <th class="abstract-text" data-toggle="true">Propostas</th>
379 <th class="views" data-hide="phone">Exibições</th> 379 <th class="views" data-hide="phone">Exibições</th>
380 <th class="votes-for" data-hide="phone"><span class="sr-only">A favor</span><span class="fa fa-check"></span></th> 380 <th class="votes-for" data-hide="phone"><span class="sr-only">A favor</span><span class="fa fa-check"></span></th>
@@ -183,6 +183,9 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -183,6 +183,9 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
183 } 183 }
184 }); 184 });
185 } 185 }
  186 + $resultsContainer.find('.abstract-text .truncated').click(function() {
  187 + $(this).toggleClass('truncated');
  188 + });
186 189
187 // scroll to the end 190 // scroll to the end
188 $('html, body').animate({ 191 $('html, body').animate({
@@ -199,6 +202,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -199,6 +202,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
199 var requireLoginContainer = loginButton.closest('.require-login-container'); 202 var requireLoginContainer = loginButton.closest('.require-login-container');
200 203
201 if(logged_in) { 204 if(logged_in) {
  205 + $('.logout').show();
202 if(token){ 206 if(token){
203 Main.private_token = token; 207 Main.private_token = token;
204 } 208 }
@@ -219,6 +223,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -219,6 +223,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
219 } else { 223 } else {
220 requireLoginContainer.find('.require-login').hide(); 224 requireLoginContainer.find('.require-login').hide();
221 requireLoginContainer.find('.login-container').show(); 225 requireLoginContainer.find('.login-container').show();
  226 + $('.logout').hide();
222 } 227 }
223 }, 228 },
224 guid: function() { 229 guid: function() {
@@ -279,6 +284,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -279,6 +284,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
279 $('#content').show(); 284 $('#content').show();
280 $('#article-container').hide(); 285 $('#article-container').hide();
281 $('nav').show(); 286 $('nav').show();
  287 + $('html, body').animate({ scrollTop: $('#proposal-group').offset().top }, 'fast');
282 }, 288 },
283 // fim Eduardo 289 // fim Eduardo
284 display_proposal: function(proposal_id){ 290 display_proposal: function(proposal_id){
@@ -481,6 +487,8 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -481,6 +487,8 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
481 }else{ 487 }else{
482 if(navOffset){ 488 if(navOffset){
483 scrollTop = navOffset.top; 489 scrollTop = navOffset.top;
  490 + } else {
  491 + scrollTop = $('#proposal-group').offset().top;
484 } 492 }
485 } 493 }
486 } 494 }
@@ -737,6 +745,8 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -737,6 +745,8 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
737 }); 745 });
738 }); 746 });
739 747
  748 +
  749 +
740 }) 750 })
741 .fail(function( jqxhr, textStatus, error ) { 751 .fail(function( jqxhr, textStatus, error ) {
742 var err = textStatus + ', ' + error; 752 var err = textStatus + ', ' + error;
@@ -757,6 +767,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -757,6 +767,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
757 $.getJSON(url).done(function( /*data*/ ) { 767 $.getJSON(url).done(function( /*data*/ ) {
758 logged_in = true; 768 logged_in = true;
759 Main.private_token = $.cookie('_dialoga_session'); 769 Main.private_token = $.cookie('_dialoga_session');
  770 + setTimeout(function(){ $('.logout').show(); }, 2000);
760 }); 771 });
761 } 772 }
762 773
@@ -866,7 +877,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -866,7 +877,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
866 e.preventDefault(); 877 e.preventDefault();
867 }); 878 });
868 879
869 - $(document).on('click', '.logout', function (){ 880 + $(document).on('click', '.logout', function (e){
870 var self = $(this); 881 var self = $(this);
871 $.removeCookie('*'); 882 $.removeCookie('*');
872 logged_in = false; 883 logged_in = false;
@@ -892,5 +903,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -892,5 +903,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
892 console.log('The browser not supports the hashchange event!'); 903 console.log('The browser not supports the hashchange event!');
893 } 904 }
894 905
  906 +
  907 +
895 return Main; 908 return Main;
896 }); 909 });
sass/style.sass
@@ -790,6 +790,7 @@ td @@ -790,6 +790,7 @@ td
790 text-align: center 790 text-align: center
791 .abstract-text 791 .abstract-text
792 width: 80% 792 width: 80%
  793 + cursor: pointer
793 p 794 p
794 margin: inherit 795 margin: inherit
795 .value 796 .value