Commit 10b3e2efadcd6c0b06349250d39171f6636355e5

Authored by Victor Costa
1 parent 9d102ba2

Improve user activation message

Showing 2 changed files with 10 additions and 7 deletions   Show diff stats
index.html
... ... @@ -392,6 +392,7 @@
392 392 <div class="loading">Carregando...</div>
393 393 <form id="login-form" class="login" method="post">
394 394 <div class="message hide"></div>
  395 + <div class="message-success alert-success hide"></div>
395 396 <div class="row">
396 397 <div class="col-sm-4">
397 398 <a href="#" class="new-user button">Cadastre-se</a>
... ...
js/main.js
... ... @@ -1509,14 +1509,16 @@ define([&#39;jquery&#39;, &#39;handlebars&#39;, &#39;fastclick&#39;, &#39;proposal_app&#39;, &#39;handlebars_helpers
1509 1509 $signupForm.removeClass('hide');
1510 1510 var $sectionContent = $button.closest('.section-content');
1511 1511  
1512   - var message = 'Cadastro efetuado com sucesso';
1513   - if(!data.activated) {
1514   - message = 'Verifique seu email para confirmar o cadastro.';
1515   - }
1516   - if($sectionContent && $sectionContent.length > 0){
1517   - Main.displaySuccess($sectionContent, message, 1000, 'icon-user-created');
  1512 + if(data.activated) {
  1513 + if($sectionContent && $sectionContent.length > 0){
  1514 + Main.displaySuccess($sectionContent, 'Cadastro efetuado com sucesso', 1000, 'icon-user-created');
  1515 + }
  1516 + $(document).trigger('login:success', data);
  1517 + } else {
  1518 + var $message = $signupForm.siblings('#login-form').find('.message-success');
  1519 + $message.html('Cadastro efetuado com sucesso.<br/>Verifique seu email para confirmar o cadastro.');
  1520 + $message.show();
1518 1521 }
1519   - $(document).trigger('login:success', data);
1520 1522 })
1521 1523 .fail(function (data) {
1522 1524 var msg = '';
... ...