Commit ee9e5f528826e7facb8c7795b8c8c3a8e3774ab6
Exists in
master
and in
6 other branches
Merge branch 'master' of https://gitlab.com/participa/proposal-app
Showing
3 changed files
with
17 additions
and
12 deletions
Show diff stats
index.html
| ... | ... | @@ -381,11 +381,11 @@ |
| 381 | 381 | <p class="box-subtitle">Cadastre-se</p> |
| 382 | 382 | <div class="email"> |
| 383 | 383 | <label for="user_email" class="label">E-mail:</label> |
| 384 | - <input id="user_email" name="email" type="text" placeholder="E-mail"> | |
| 384 | + <input id="user_email" name="email" type="email" required placeholder="E-mail"> | |
| 385 | 385 | </div> |
| 386 | 386 | <div class="username"> |
| 387 | 387 | <label for="user_name" class="label">Nome de Usuário</label> |
| 388 | - <input id="user_name" name="login" type="text" placeholder="Nome do usuário"> | |
| 388 | + <input id="user_name" name="login" type="text" required placeholder="Nome do usuário"> | |
| 389 | 389 | </div> |
| 390 | 390 | <div class="row"> |
| 391 | 391 | <div class="password col-sm-6"> |
| ... | ... | @@ -396,6 +396,8 @@ |
| 396 | 396 | <label for="user_password_confirmation" class="label">Confirme a senha:</label> |
| 397 | 397 | <input id="user_password_confirmation" name="password_confirmation" type="password" placeholder="Confirme a senha"> |
| 398 | 398 | </div> |
| 399 | + <div class="captcha"> | |
| 400 | + <div id="g-recaptcha"></div> | |
| 399 | 401 | </div> |
| 400 | 402 | <div class="actions"> |
| 401 | 403 | <div class="row"> |
| ... | ... | @@ -407,10 +409,6 @@ |
| 407 | 409 | </div> |
| 408 | 410 | </div> |
| 409 | 411 | </div> |
| 410 | - <div class="captcha"> | |
| 411 | - <div class="g-recaptcha" data-sitekey="6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i"></div> | |
| 412 | - <script src='https://www.google.com/recaptcha/api.js?hl=pt-BR' async defer></script> | |
| 413 | - </div> | |
| 414 | 412 | </form> |
| 415 | 413 | </script> |
| 416 | 414 | |
| ... | ... | @@ -427,6 +425,7 @@ |
| 427 | 425 | loadRequireJS(); |
| 428 | 426 | </script> |
| 429 | 427 | |
| 428 | + <script src='https://www.google.com/recaptcha/api.js?hl=pt-BR' async defer></script> | |
| 430 | 429 | |
| 431 | 430 | </body> |
| 432 | 431 | ... | ... |
js/main.js
| ... | ... | @@ -17,13 +17,15 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 17 | 17 | |
| 18 | 18 | var loginButton; |
| 19 | 19 | |
| 20 | - var participa = true; | |
| 20 | + var participa = false; | |
| 21 | 21 | if(participa){ |
| 22 | 22 | var host = 'http://www.participa.br'; |
| 23 | 23 | var proposal_discussion = '103358'; //participa |
| 24 | + window.recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i' | |
| 24 | 25 | }else{ |
| 25 | 26 | var host = 'http://noosfero.com:3000'; |
| 26 | - var proposal_discussion = '632'; //local serpro | |
| 27 | + var proposal_discussion = '372'; //local serpro | |
| 28 | + window.recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-' //http://noosfero.com/ | |
| 27 | 29 | } |
| 28 | 30 | |
| 29 | 31 | var BARRA_ADDED = false; |
| ... | ... | @@ -32,7 +34,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 32 | 34 | Main = (function(){ |
| 33 | 35 | |
| 34 | 36 | return { |
| 35 | - private_token: '375bee7e17d0021af7160ce664874618', | |
| 37 | + private_token: 'db34efd2c7df703b61226c88b7b477c8', | |
| 36 | 38 | getProposalId: function() { |
| 37 | 39 | var regexProposals = /\d.*\/propostas\/*.*/; |
| 38 | 40 | var proposalId = 0; |
| ... | ... | @@ -705,9 +707,13 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 705 | 707 | |
| 706 | 708 | $(document).on('click', '.new-user', function(e) { |
| 707 | 709 | var loginForm = $(this).parents('#login-form'); |
| 710 | + var signupForm = loginForm.siblings('#signup-form'); | |
| 711 | + | |
| 708 | 712 | loginForm.hide(); |
| 709 | - loginForm.siblings('#signup-form').show(); | |
| 713 | + signupForm.show(); | |
| 710 | 714 | loginForm.find('.message').hide(); |
| 715 | + console.log(signupForm.find('#g-recaptcha')[0]); | |
| 716 | + grecaptcha.render(signupForm.find('#g-recaptcha')[0], {'sitekey' : window.recaptchaSiteKey }); | |
| 711 | 717 | e.preventDefault(); |
| 712 | 718 | }) |
| 713 | 719 | |
| ... | ... | @@ -715,6 +721,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 715 | 721 | var signupForm = $(this).parents('#signup-form'); |
| 716 | 722 | signupForm.hide(); |
| 717 | 723 | signupForm.siblings('#login-form').show(); |
| 724 | + grecaptcha.reset(); | |
| 718 | 725 | e.preventDefault(); |
| 719 | 726 | }); |
| 720 | 727 | |
| ... | ... | @@ -741,6 +748,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 741 | 748 | loading.hide(); |
| 742 | 749 | signup.show(); |
| 743 | 750 | }); |
| 751 | + grecaptcha.reset(); | |
| 744 | 752 | e.preventDefault(); |
| 745 | 753 | }); |
| 746 | 754 | ... | ... |