Commit da015b9fb0ca12a2c5bc914d156bf71ec6640992
Exists in
master
and in
5 other branches
Merge branch 'master' of gitlab.com:participa/proposal-app
Showing
1 changed file
with
7 additions
and
3 deletions
Show diff stats
js/main.js
... | ... | @@ -110,7 +110,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
110 | 110 | |
111 | 111 | if(ProposalApp.hasProposalbeenVoted(article.id)){ |
112 | 112 | console.log("Proposta " + article.id + " já havia sido votada"); |
113 | - Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Voto realizado com sucesso', 800); | |
113 | + Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Seu voto já foi computado nesta proposta', 800); | |
114 | 114 | contextMain.loadRandomProposal(topic_id); |
115 | 115 | e.preventDefault(); |
116 | 116 | return; |
... | ... | @@ -123,8 +123,12 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
123 | 123 | value: $(this).data('vote-value'), |
124 | 124 | private_token: Main.private_token |
125 | 125 | } |
126 | - }).done(function( /*data*/ ) { | |
127 | - Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Voto realizado com sucesso', 800); | |
126 | + }).done(function(data) { | |
127 | + if(data.vote) { | |
128 | + Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Voto realizado com sucesso', 800); | |
129 | + } else { | |
130 | + Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Seu voto já foi computado nesta proposta', 800); | |
131 | + } | |
128 | 132 | ProposalApp.addVotedProposal(article.id); |
129 | 133 | contextMain.loadRandomProposal(topic_id); |
130 | 134 | }); | ... | ... |