Commit f9f2078d8c1b21931abd757cf901b2b5e38c9bb7
1 parent
3fd39fe820
Exists in
master
add popup for employer registration
Showing 2 changed files with 50 additions and 27 deletions Side-by-side Diff
resources/views/js/modals.blade.php
... | ... | @@ -85,6 +85,54 @@ |
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | + function successfulRegistrationWorker() { | |
89 | + $.fancybox.close(); | |
90 | + | |
91 | + $('#email_worker').val(''); | |
92 | + $('#password_worker').val(''); | |
93 | + $('#password_confirmation_worker').val(''); | |
94 | + $('#politik').prop('checked', false); | |
95 | + $('#telephone_worker').val(''); | |
96 | + $('#job_titles_worker').val('').trigger('change'); | |
97 | + $('#surname_worker').val(''); | |
98 | + $('#name_man_worker').val(''); | |
99 | + $('#surname2_worker').val(''); | |
100 | + $('#cpatchaTextBox1').val(''); | |
101 | + | |
102 | + $('#block-info').hide(); | |
103 | + $('#messages_error_reg').html(''); | |
104 | + | |
105 | + $.fancybox.open({ | |
106 | + src: '#successful-registration', | |
107 | + type: 'inline', | |
108 | + opts: {touch: false} | |
109 | + }); | |
110 | + } | |
111 | + | |
112 | + function successfulRegistrationEmployer() { | |
113 | + $.fancybox.close(); | |
114 | + | |
115 | + $('#email_employer').val(''); | |
116 | + $('#password_employer').val(''); | |
117 | + $('#password_confirmation_employer').val(''); | |
118 | + $('#politik').prop('checked', false); | |
119 | + $('#telephone_employer').val(''); | |
120 | + $('#surname_employer').val(''); | |
121 | + $('#name_man_employer').val(''); | |
122 | + $('#surname2_employer').val(''); | |
123 | + $('#company_employer').val(''); | |
124 | + $('#cpatchaTextBox1').val(''); | |
125 | + | |
126 | + $('#block-info').hide(); | |
127 | + $('#messages_error_reg').html(''); | |
128 | + | |
129 | + $.fancybox.open({ | |
130 | + src: '#successful-registration', | |
131 | + type: 'inline', | |
132 | + opts: {touch: false} | |
133 | + }); | |
134 | + } | |
135 | + | |
88 | 136 | $(document).on('click', '#button_send', function() { |
89 | 137 | var field_login = $('#email_input'); |
90 | 138 | var field_pwd = $('#password'); |
... | ... | @@ -165,9 +213,6 @@ |
165 | 213 | return false; |
166 | 214 | } |
167 | 215 | |
168 | - | |
169 | - console.log('login: '+login+' password: '+pwd); | |
170 | - | |
171 | 216 | $.ajax({ |
172 | 217 | type: "GET", |
173 | 218 | url: "{{ route('register_worker') }}", |
... | ... | @@ -178,27 +223,7 @@ |
178 | 223 | console.log('Вход в систему'); |
179 | 224 | let d = JSON.parse(data); |
180 | 225 | 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 | - }); | |
226 | + successfulRegistrationWorker() | |
202 | 227 | } |
203 | 228 | |
204 | 229 | if (typeof d['ERROR'] !== "undefined") { |
... | ... | @@ -284,8 +309,7 @@ |
284 | 309 | console.log('Вход в систему'); |
285 | 310 | let d = JSON.parse(data); |
286 | 311 | if(typeof d['REDIRECT'] !== "undefined") { |
287 | - console.log(d['REDIRECT']); | |
288 | - location.href = d['REDIRECT']; | |
312 | + successfulRegistrationEmployer() | |
289 | 313 | } |
290 | 314 | if (typeof d['ERROR'] !== "undefined") { |
291 | 315 | console.log(d['ERROR']); |
resources/views/modals/successful_registration.blade.php
... | ... | @@ -2,6 +2,5 @@ |
2 | 2 | <div class="modal__body"> |
3 | 3 | <div class="modal__title">Регистрация прошла успешно!</div> |
4 | 4 | <div class="modal__text">На вашу электронную почту отправлено письмо, пожалуйста подтвердите регистрацию перейдя по ссылке.</div> |
5 | - <a href="#" class="button button_light modal__button open-login-modal">Войти</a> | |
6 | 5 | </div> |
7 | 6 | </div> |