Commit 5131abdbe5414ad8babbc24d867d63634fcb29a5
1 parent
9ce27f2123
Exists in
master
fixes
Showing 6 changed files with 40 additions and 21 deletions Side-by-side Diff
app/Http/Controllers/EmployerController.php
... | ... | @@ -52,6 +52,12 @@ class EmployerController extends Controller |
52 | 52 | select('ad_employers.*')-> |
53 | 53 | where('id', '=', $vacancy)->get(); |
54 | 54 | |
55 | + if ($Query[0]->active_is===0 || $Query[0]->is_remove!=0){ | |
56 | + | |
57 | + abort(404); | |
58 | + | |
59 | + } | |
60 | + | |
55 | 61 | if (isset(Auth()->user()->id)) |
56 | 62 | $uid = Auth()->user()->id; |
57 | 63 | else |
app/Http/Controllers/MainController.php
... | ... | @@ -205,6 +205,7 @@ class MainController extends Controller |
205 | 205 | ->with('cat') |
206 | 206 | ->with('employer') |
207 | 207 | ->where('is_remove', 0) |
208 | + ->where('active_is', 1) | |
208 | 209 | ->whereHas('jobs_code', function ($query) use ($job_search) { |
209 | 210 | if (!empty($job_search)) { |
210 | 211 | $query->where('job_title_id', $job_search); |
app/Http/Controllers/WorkerController.php
... | ... | @@ -81,10 +81,15 @@ class WorkerController extends Controller |
81 | 81 | // лист база резюме |
82 | 82 | public function bd_resume(Request $request) |
83 | 83 | { |
84 | - if (isset(Auth()->user()->id)) { | |
85 | - if ((Auth()->user()->is_worker) || (!Auth()->user()->is_lookin)) | |
86 | - return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); | |
84 | + | |
85 | + if (!Auth::check()) { | |
86 | + | |
87 | + return redirect()->route('page', ['pages' => "Usloviya-razmescheniya"])->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); | |
88 | + | |
87 | 89 | } |
90 | + if ((Auth::user()->is_worker) || (!Auth()->user()->is_lookin)) | |
91 | + return redirect()->route('page', ['pages' => "Usloviya-razmescheniya"])->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); | |
92 | + | |
88 | 93 | |
89 | 94 | $status_work = WorkerStatuses::getWorkerStatuses(); |
90 | 95 | |
... | ... | @@ -948,6 +953,7 @@ class WorkerController extends Controller |
948 | 953 | |
949 | 954 | // Редактирование документа |
950 | 955 | public function edit_document(place_works $doc, Worker $worker) { |
956 | + | |
951 | 957 | return view('workers.docs-edit', compact('doc', 'worker')); |
952 | 958 | } |
953 | 959 |
app/Models/User.php
... | ... | @@ -142,9 +142,12 @@ class User extends Authenticatable |
142 | 142 | return $query->where('is_remove', '=', '0'); |
143 | 143 | } |
144 | 144 | |
145 | - public function scopeWorker($query) { | |
145 | + public function scopeIsWorker($query) { | |
146 | 146 | return $query->where('is_worker', '=', '1'); |
147 | 147 | } |
148 | + public function scopeIsLookin($query) { | |
149 | + return $query->where('is_lookin', '=', '1'); | |
150 | + } | |
148 | 151 | |
149 | 152 | public function scopeBaseuser($query) { |
150 | 153 | return $query->where('is_bd', '=', '1'); |
public/css/style_may2024.css
... | ... | @@ -9360,9 +9360,10 @@ main + .news { |
9360 | 9360 | } |
9361 | 9361 | } |
9362 | 9362 | .cabinet__works-body { |
9363 | - opacity: 0; | |
9364 | - height: 0; | |
9365 | - overflow: hidden; | |
9363 | + opacity: 1; | |
9364 | + height: auto; | |
9365 | + overflow: visible; | |
9366 | + transition: opacity 0.3s, height 0.3s; | |
9366 | 9367 | } |
9367 | 9368 | .active + .cabinet__works-body { |
9368 | 9369 | -webkit-transition: 0.3s; |
resources/views/js/modals.blade.php
... | ... | @@ -123,6 +123,8 @@ |
123 | 123 | }); |
124 | 124 | |
125 | 125 | $(document).on('click', '#button_reg_worker', function() { |
126 | + $('#messages_error_reg').html(''); | |
127 | + | |
126 | 128 | var field_login = $('#email_worker'); |
127 | 129 | var field_pwd = $('#password_worker'); |
128 | 130 | var field_confirm_pwd = $('#password_confirmation_worker'); |
... | ... | @@ -156,15 +158,14 @@ |
156 | 158 | return false; |
157 | 159 | } |
158 | 160 | |
159 | - if (field_politik_worker.attr('checked')) { | |
160 | - console.log('politik=1'); | |
161 | - politik = 1; | |
162 | - } else { | |
163 | - politik = 0; | |
164 | - console.log('politik=0'); | |
165 | - | |
161 | + if (!document.getElementById('politik').checked) { | |
162 | + event.preventDefault(); | |
163 | + $('#block-info').css({'display': 'block'}); | |
164 | + $('#messages_error_reg').html('ERROR: Вы не согласились с политикой конфидициальности!'); | |
165 | + return false; | |
166 | 166 | } |
167 | 167 | |
168 | + | |
168 | 169 | console.log('login: '+login+' password: '+pwd); |
169 | 170 | |
170 | 171 | $.ajax({ |
... | ... | @@ -201,6 +202,9 @@ |
201 | 202 | }); |
202 | 203 | |
203 | 204 | $(document).on('click', '#button_reg_employer', function() { |
205 | + | |
206 | + $('#messages_error_reg').html(''); | |
207 | + | |
204 | 208 | var field_login = $('#email_employer'); |
205 | 209 | var field_pwd = $('#password_employer'); |
206 | 210 | var field_confirm_pwd = $('#password_confirmation_employer'); |
... | ... | @@ -233,13 +237,11 @@ |
233 | 237 | } |
234 | 238 | |
235 | 239 | console.log('login: '+login+' password: '+pwd); |
236 | - | |
237 | - if (field_politik_employer.attr('checked')) { | |
238 | - console.log('politik=1'); | |
239 | - politik = 1; | |
240 | - } else { | |
241 | - politik = 0; | |
242 | - console.log('politik=0'); | |
240 | + if (!document.getElementById('politik_employer').checked) { | |
241 | + event.preventDefault(); | |
242 | + $('#block-info').css({'display': 'block'}); | |
243 | + $('#messages_error_reg').html('ERROR: Вы не согласились с политикой конфидициальности!'); | |
244 | + return false; | |
243 | 245 | } |
244 | 246 | |
245 | 247 | $.ajax({ |