Commit 6408200e4795f9dcc11661bf181f4df808ff0d41

Authored by Hayk Nazaryan
1 parent d2fa9ea9e0
Exists in master

register form popups

Showing 4 changed files with 44 additions and 4 deletions Side-by-side Diff

resources/views/js/modals.blade.php
... ... @@ -177,10 +177,30 @@
177 177 success: function (data) {
178 178 console.log('Вход в систему');
179 179 let d = JSON.parse(data);
180   - if(typeof d['REDIRECT'] !== "undefined") {
181   - console.log(d['REDIRECT']);
182   - location.href = d['REDIRECT'];
  180 + if (typeof d['REDIRECT'] !== "undefined") {
  181 + $.fancybox.close();
  182 +
  183 + $('#email_worker').val('');
  184 + $('#password_worker').val('');
  185 + $('#password_confirmation_worker').val('');
  186 + $('#politik').prop('checked', false);
  187 + $('#telephone_worker').val('');
  188 + $('#job_titles_worker').val('').trigger('change');
  189 + $('#surname_worker').val('');
  190 + $('#name_man_worker').val('');
  191 + $('#surname2_worker').val('');
  192 + $('#cpatchaTextBox1').val('');
  193 +
  194 + $('#block-info').hide();
  195 + $('#messages_error_reg').html('');
  196 +
  197 + $.fancybox.open({
  198 + src: '#successful-registration',
  199 + type: 'inline',
  200 + opts: {touch: false}
  201 + });
183 202 }
  203 +
184 204 if (typeof d['ERROR'] !== "undefined") {
185 205 console.log(d['ERROR']);
186 206 $('#block-info').css({'display': 'block'});
... ... @@ -201,6 +221,16 @@
201 221 return false;
202 222 });
203 223  
  224 + $(document).on('click', '.open-login-modal', function(e) {
  225 + e.preventDefault();
  226 + $.fancybox.close();
  227 + $.fancybox.open({
  228 + src: '#sign',
  229 + type: 'inline',
  230 + opts: {touch: false}
  231 + });
  232 + });
  233 +
204 234 $(document).on('click', '#button_reg_employer', function() {
205 235  
206 236 $('#messages_error_reg').html('');
resources/views/modals/register.blade.php
... ... @@ -7,6 +7,9 @@
7 7 background-color: #d0d0d0;
8 8 }
9 9 </style>
  10 +
  11 +@include('modals.successful_registration')
  12 +
10 13 <div id="reg" class="modal">
11 14 <div class="modal__body">
12 15 <div class="modal__title left">Регистрация</div>
resources/views/modals/send_login.blade.php
... ... @@ -47,7 +47,7 @@
47 47 <div class="modal__text">
48 48 <span>У Вас ещё нет аккаунта?</span>
49 49 &nbsp;
50   - <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Создать аккаунт</a>
  50 + <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}' onclick="$.fancybox.close();">Создать аккаунт</a>
51 51 </div>
52 52 </div>
53 53 </div>
resources/views/modals/successful_registration.blade.php
... ... @@ -0,0 +1,7 @@
  1 +<div id="successful-registration" class="modal modal_bg" style="display: none;">
  2 + <div class="modal__body">
  3 + <div class="modal__title">Регистрация прошла успешно!</div>
  4 + <div class="modal__text">На вашу электронную почту отправлено письмо, пожалуйста подтвердите регистрацию перейдя по ссылке.</div>
  5 + <a href="#" class="button button_light modal__button open-login-modal">Войти</a>
  6 + </div>
  7 +</div>