Commit 366359fcf916cf157733f3a82b94e9d40dde1770
Exists in
master
and in
5 other branches
Merge branch 'master' of gitlab.com:participa/proposal-app
Showing
2 changed files
with
8 additions
and
8 deletions
Show diff stats
index.html
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 | <a id="display-contrast" href="#">Alto Contraste</a> |
102 | 102 | <div class="participar"> |
103 | 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 | 105 | <a href="#" class="logout hide">Sair</a> |
106 | 106 | </div> |
107 | 107 | <h1> | ... | ... |
js/main.js
... | ... | @@ -102,16 +102,16 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
102 | 102 | //Helps to prevent more than one vote per proposal |
103 | 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 | 107 | e.preventDefault(); |
110 | 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 | 115 | e.preventDefault(); |
116 | 116 | return; |
117 | 117 | } |
... | ... | @@ -210,6 +210,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
210 | 210 | if(token){ |
211 | 211 | Main.private_token = token; |
212 | 212 | } |
213 | + requireLoginContainer = $('.require-login-container'); | |
213 | 214 | requireLoginContainer.find('.require-login').show(); |
214 | 215 | requireLoginContainer.find('.require-login .message').show(); |
215 | 216 | requireLoginContainer.find('.login-container').hide(); |
... | ... | @@ -345,7 +346,6 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
345 | 346 | $('#content').hide(); |
346 | 347 | $('#article-container').hide(); |
347 | 348 | $proposal = $('#proposal-item-' + proposal_id); |
348 | - $proposal.find('.make-proposal-form').hide(); | |
349 | 349 | $proposal.find('.proposal-header').hide(); |
350 | 350 | $proposal.find('.make-proposal-container').hide(); |
351 | 351 | $proposal.find('.support-proposal-container').hide(); | ... | ... |