Commit 366359fcf916cf157733f3a82b94e9d40dde1770

Authored by Evandro Jr
2 parents 66273155 930c1156

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

Showing 2 changed files with 8 additions and 8 deletions   Show diff stats
@@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@
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>--> 103 <!--<a href="#" class="button button-inline participe">Participe</a>-->
104 - <!--<a href="#" class="entrar">Entrar</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>
@@ -102,16 +102,16 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -102,16 +102,16 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
102 //Helps to prevent more than one vote per proposal 102 //Helps to prevent more than one vote per proposal
103 var button = $(this); 103 var button = $(this);
104 104
105 - if(ProposalApp.hasProposalbeenVoted(article.id)){  
106 - console.log("Proposta " + article.id + " já havia sido votada");  
107 - Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Voto realizado com sucesso', 800);  
108 - contextMain.loadRandomProposal(topic_id); 105 + if(!logged_in) {
  106 + $(this).closest('.require-login-container').find('.button-send a').click();
109 e.preventDefault(); 107 e.preventDefault();
110 return; 108 return;
111 } 109 }
112 110
113 - if(!logged_in) {  
114 - $(this).closest('.require-login-container').find('.button-send a').click(); 111 + if(ProposalApp.hasProposalbeenVoted(article.id)){
  112 + console.log("Proposta " + article.id + " já havia sido votada");
  113 + Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Voto realizado com sucesso', 800);
  114 + contextMain.loadRandomProposal(topic_id);
115 e.preventDefault(); 115 e.preventDefault();
116 return; 116 return;
117 } 117 }
@@ -210,6 +210,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -210,6 +210,7 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
210 if(token){ 210 if(token){
211 Main.private_token = token; 211 Main.private_token = token;
212 } 212 }
  213 + requireLoginContainer = $('.require-login-container');
213 requireLoginContainer.find('.require-login').show(); 214 requireLoginContainer.find('.require-login').show();
214 requireLoginContainer.find('.require-login .message').show(); 215 requireLoginContainer.find('.require-login .message').show();
215 requireLoginContainer.find('.login-container').hide(); 216 requireLoginContainer.find('.login-container').hide();
@@ -345,7 +346,6 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F @@ -345,7 +346,6 @@ define([&#39;handlebars&#39;, &#39;fastclick&#39;, &#39;handlebars_helpers&#39;], function(Handlebars, F
345 $('#content').hide(); 346 $('#content').hide();
346 $('#article-container').hide(); 347 $('#article-container').hide();
347 $proposal = $('#proposal-item-' + proposal_id); 348 $proposal = $('#proposal-item-' + proposal_id);
348 - $proposal.find('.make-proposal-form').hide();  
349 $proposal.find('.proposal-header').hide(); 349 $proposal.find('.proposal-header').hide();
350 $proposal.find('.make-proposal-container').hide(); 350 $proposal.find('.make-proposal-container').hide();
351 $proposal.find('.support-proposal-container').hide(); 351 $proposal.find('.support-proposal-container').hide();