Commit edcfe946a89819ae5510435f32fbdc2e31a866c9

Authored by Fedor K
Exists in master

Merge branch 'task-132687' into 'master'

task-132687 minor changes

Showing 18 changed files Side-by-side Diff

app/Classes/Tools.php
... ... @@ -28,31 +28,42 @@ class Tools
28 28 public static function getWorkerProfilePercent(Worker $Worker): int
29 29 {
30 30 $persent = 0;
  31 + $workerFields = [
  32 + 'telephone',
  33 + 'email',
  34 + 'old_year',
  35 + 'salary_expectations',
  36 + 'experience',
  37 + 'english_level',
  38 + 'ready_boart_date',
  39 + 'boart_type_preference',
  40 + 'visa_available',
  41 + 'confirmation_work_for_vvp',
  42 + 'military_id_available',
  43 + 'city',
  44 + 'telephone2',
  45 + ];
31 46  
32   - if((!empty($Worker->users->surname)) &&
33   - (!empty($Worker->users->name_man)) &&
34   - (!empty($Worker->telephone)) &&
35   - (!empty($Worker->email))
36   - ) {
37   - $persent += 10;
  47 + $workerUserFields = [
  48 + 'surname',
  49 + 'name_man',
  50 + 'surname2',
  51 + ];
  52 +
  53 + foreach ($workerFields as $fieldName) {
  54 + if (!empty($Worker->$fieldName)) {
  55 + $persent += 2.8;
  56 + }
  57 + }
  58 +
  59 + foreach ($workerUserFields as $fieldName) {
  60 + if (!empty($Worker->user->$fieldName)) {
  61 + $persent += 2.8;
  62 + }
38 63 }
39 64  
40   - if (
41   - (!empty($Worker->users->surname2)) &&
42   - (!empty($Worker->old_year)) &&
43   - ($Worker->job_titles->count() > 0) &&
44   - (!empty($Worker->salary_expectations)) &&
45   - (!empty($Worker->experience)) &&
46   - (!empty($Worker->english_level)) &&
47   - (!empty($Worker->ready_boart_date)) &&
48   - (!empty($Worker->boart_type_preference)) &&
49   - (!empty($Worker->visa_available)) &&
50   - (!empty($Worker->confirmation_work_for_vvp)) &&
51   - (!empty($Worker->military_id_available)) &&
52   - (!empty($Worker->city)) &&
53   - (!empty($Worker->telephone2))
54   - ) {
55   - $persent += 40;
  65 + if ($Worker->job_titles->count() > 0) {
  66 + $persent += 2.8;
56 67 }
57 68  
58 69 if ($Worker->sertificate->count() > 0) {
app/Http/Controllers/Admin/UsersController.php
... ... @@ -101,8 +101,12 @@ class UsersController extends Controller
101 101 }
102 102  
103 103 public function edit_bd(User $user) {
104   - $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->
105   - orderByDesc('sort')->orderBy('name', 'asc')->get();
  104 + $list_job_titles = Job_title::query()
  105 + ->active()
  106 + ->where('is_bd', '=' , '2')
  107 + ->orderByDesc('sort')
  108 + ->orderBy('name', 'asc')
  109 + ->get();
106 110 return view('admin.users.edit', compact('user', 'list_job_titles'));
107 111 }
108 112  
app/Http/Controllers/EmployerController.php
... ... @@ -158,23 +158,28 @@ class EmployerController extends Controller
158 158  
159 159 // Форма добавления вакансий
160 160 public function cabinet_vacancie() {
161   - $id = Auth()->user()->id;
  161 + /** @var User_Model $user */
  162 + $user = Auth()->user();
162 163  
163   - if (Auth()->user()->is_public) {
  164 + if ($user->is_public) {
164 165 $categories = Category::query()->active()->get();
165   - $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
166   - where('is_remove', '=', '0')->
167   - where('is_bd', '=', '0')->
168   - get();
169   - $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
170   - WhereHas('users',
171   - function (Builder $query) use ($id) {
172   - $query->Where('id', $id);
173   - })->get();
  166 +
  167 + $jobs = Job_title::query()
  168 + ->orderByDesc('sort')
  169 + ->OrderBy('name')
  170 + ->where('is_remove', '=', '0')
  171 + ->where('is_bd', '=', '0')
  172 + ->get();
  173 +
  174 + $Employer = Employer::query()
  175 + ->with(['users', 'ads', 'flots'])
  176 + ->whereHas('users', fn (Builder $query) => $query->where('id', $user->id))
  177 + ->get();
  178 +
174 179 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
175   - } else {
176   - return redirect()->route('employer.cabinet_vacancie_danger');
177 180 }
  181 +
  182 + return redirect()->route('employer.cabinet_vacancie_danger');
178 183 }
179 184  
180 185 // Форма предупреждения об оплате
... ... @@ -187,18 +192,8 @@ class EmployerController extends Controller
187 192 $params_emp = $request->all();
188 193  
189 194 $params_job["job_title_id"] = $params_emp['job_title_id'];
190   - //$params_job["min_salary"] = $params_emp['min_salary'];
191   - //$params_job["max_salary"] = $params_emp['max_salary'];
192   - //$params_job["region"] = $params_emp['region'];
193   - //$params_job["power"] = $params_emp['power'];
194   - //$params_job["sytki"] = $params_emp['sytki'];
195   - //$params_job["start"] = $params_emp['start'];
196   - //$params_job["flot"] = $params_emp['flot'];
197   - //$params_job["description"] = $params_emp['description'];
198 195  
199 196 $ad_jobs = Ad_employer::create($params_emp);
200   - //$params_job['ad_employer_id'] = $ad_jobs->id;
201   - //Ad_jobs::create($params_job);
202 197 $ad_jobs->jobs()->sync($request->get('job_title_id'));
203 198  
204 199 return redirect()->route('employer.vacancy_list');
... ... @@ -208,7 +203,6 @@ class EmployerController extends Controller
208 203 public function vacancy_list(Request $request) {
209 204 $id = Auth()->user()->id;
210 205  
211   - //dd($request->all());
212 206 $Employer = Employer::query()->where('user_id', $id)->first();
213 207 $vacancy_list = Ad_employer::query()
214 208 ->with('jobs')
... ... @@ -226,9 +220,14 @@ class EmployerController extends Controller
226 220 if ($request->get('sort')) {
227 221 $sort = $request->get('sort');
228 222 switch ($sort) {
229   - case 'nopublic': $vacancy_list->where('active_is', '=', 0);break;
230   - case 'public':$vacancy_list->where('active_is', '=', 1);break;
231   - default: $vacancy_list = $vacancy_list->orderByDesc('id'); break;
  223 + case 'nopublic': $vacancy_list->orderByDesc('updated_at')
  224 + ->where('active_is', 0);
  225 + break;
  226 + case 'public': $vacancy_list->orderByDesc('updated_at')
  227 + ->where('active_is',1);
  228 + break;
  229 + default: $vacancy_list->orderByDesc('updated_at');
  230 + break;
232 231 }
233 232 } else {
234 233 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id');
... ... @@ -236,7 +235,6 @@ class EmployerController extends Controller
236 235  
237 236 $vacancy_list = $vacancy_list->paginate(10);
238 237  
239   - //ajax
240 238 if ($request->ajax()) {
241 239 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
242 240 } else {
... ... @@ -570,7 +568,7 @@ class EmployerController extends Controller
570 568 // Данные
571 569 $users = $users->Baseuser()->
572 570 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id'));
573   - $count_users = $users;
  571 + $count_users = $users->count();
574 572 $users = $users->paginate(10);
575 573  
576 574 $export_options = DbExportColumns::toArray();
... ... @@ -759,7 +757,7 @@ class EmployerController extends Controller
759 757 file_store_path: "worker/$id"
760 758 );
761 759  
762   - return redirect()->route('worker.dialog', ['chat' => $message->chat_id_to]);
  760 + return redirect()->route('employer.dialog', ['chat' => $message->chat_id_to]);
763 761 }
764 762  
765 763 // Восстановление пароля
app/Http/Controllers/MainController.php
... ... @@ -124,12 +124,12 @@ class MainController extends Controller
124 124 ->where('user_id', Auth::user()->id)
125 125 ->delete();
126 126  
127   - return "Вот и результат удаления!";
128   -
  127 + return response()->json(['deleted' => true, 'id' => $request->get('code_record')]);
129 128 } else {
130 129 $params = $request->all();
131 130 $params['user_id'] = Auth::user()->id;
132 131 Like_worker::create($params);
  132 + return response()->json(['deleted' => false, 'id' => $request->get('code_record')]);
133 133 }
134 134 }
135 135 }
resources/views/admin/users/form.blade.php
... ... @@ -104,12 +104,12 @@
104 104 <span class="text-gray-700 dark:text-gray-400">Комментарий</span>
105 105 <input name="comment" id="comment"
106 106 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
107   - placeholder="Комментарий" value="{{ old('comment') ?? $user->comment ?? '' }}"
  107 + placeholder="Комментарий" value="{{ old('comment') ?? $user->workers[0]->comment ?? '' }}"
108 108 />
109   - @error('telephone')
110   - <span class="text-xs text-red-600 dark:text-red-400">
111   - {{ $message }}
112   - </span>
  109 + @error('comment')
  110 + <span class="text-xs text-red-600 dark:text-red-400">
  111 + {{ $message }}
  112 + </span>
113 113 @enderror
114 114 </label><br>
115 115  
resources/views/admin/worker/index.blade.php
... ... @@ -82,6 +82,9 @@
82 82 </thead>
83 83 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
84 84 @foreach($users as $user)
  85 + @if (!isset($user->workers[0]))
  86 + @continue(1)
  87 + @endif
85 88 <tr class="text-gray-700 dark:text-gray-400">
86 89 <td class="px-4 py-3 text-xs">
87 90 {{$user->id}}
... ... @@ -136,22 +139,11 @@
136 139 </td>
137 140  
138 141 <td class="px-4 py-3 text-xs">
139   - @if (isset($user->workers[0]->persent_anketa))
140   - @if ($user->workers[0]->persent_anketa > 40)
141   - <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100">
142   - {{$user->workers[0]->persent_anketa}}%
143   - </span>
144   - @else
145   - <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600">
146   - {{ \App\Classes\Tools::getWorkerProfilePercent($user->workers[0]) }}%
147   - </span>
148   - @endif
149   - @else
150   - <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600">
151   - 0%
152   - </span>
153   - @endif
  142 + <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full @if(($persent = \App\Classes\Tools::getWorkerProfilePercent($user->workers[0])) > 50) dark:bg-green-700 dark:text-green-100 @else dark:text-white dark:bg-orange-600 @endif">
  143 + {{ $persent }}%
  144 + </span>
154 145 </td>
  146 +
155 147 <td class="px-4 py-3 text-xs">
156 148 @if (isset($user->jobtitles[0]->name))
157 149 {{ $user->jobtitles[0]->name }}
... ... @@ -163,18 +155,11 @@
163 155 {{ date('d.m.Y h:i:s', strtotime($user->created_at)) }}
164 156 </td>
165 157 <td class="px-4 py-3 text-xs">
166   - <!--if ($user->id > 1)-->
167   - @if (isset($user->workers[0]->id))
168   - <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a>
  158 + @if (isset($user->workers[0]->id))
  159 + <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a>
169 160  
170   - @endif
171   - <!--endif-->
172   - </td>
173   - <!--<td class="px-4 py-3 text-sm">
174   - @if ($user->id > 1)
175   - <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/>
176 161 @endif
177   - </td>-->
  162 + </td>
178 163 </tr>
179 164 @endforeach
180 165 </tbody>
resources/views/employers/add_vacancy.blade.php
1 1 @extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре'])
2 2  
3   -@section('scripts')
4   - <script>
5   - console.log('Приближаемся к системе, нас рой тут...');
6   - $(document).on('change', '#category_id', function() {
7   - var this_ = $(this);
8   - var val_ = this_.val();
9   - var ajax_ = $('#job_title_id');
10   -
11   - console.log('Создания списка людей, которые поднимутся на корабль...');
12   -
13   - $.ajax({
14   - type: "GET",
15   - url: "{{ route('employer.selected_people') }}",
16   - data: "id="+val_,
17   - success: function (data) {
18   - console.log('Ответка пришла');
19   - console.log('Список избранных людей создан');
20   - ajax_.html(data);
21   - },
22   - headers: {
23   - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
24   - },
25   - error: function (data) {
26   - console.log('Обрыв связи');
27   - console.log('Error: ' + data);
28   - }
29   - });
30   - });
31   - </script>
32   -@endsection
33 3 @section('content')
34 4 <section class="cabinet">
35 5 <div class="container">
... ... @@ -93,7 +63,7 @@
93 63 @endforeach
94 64 @endif
95 65 @endif
96   - <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option>
  66 + <option value="{{ $it->id }}" @if ($selected || $it->id == 160/* im so fucking sorry */) selected @endif>{{ $it->name }}</option>
97 67 @endforeach
98 68 @endif
99 69 </select>
... ... @@ -148,28 +118,6 @@
148 118 @enderror
149 119 </div>
150 120 </div>
151   - <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
152   - <label class="form-group__label">Категория (локация)</label>
153   - <div class="form-group__item">
154   - <div class="select">
155   - <select class="js-select2" name="category_id" id="category_id">
156   - <option selected> Выберите категорию из списка</option>
157   - _php $i = 1 _endphp
158   - _if ($categories->count())
159   - _foreach($categories as $j)
160   - <option value=" $j->id }}"> $j->name }}</option>
161   - _php $i++ _endphp
162   - _endforeach
163   - _endif
164   - </select>
165   - _error('category_id')
166   - <span class="text-xs text-red-600 dark:text-red-400">
167   - $message }}
168   - </span>
169   - _enderror
170   - </div>
171   - </div>
172   - </div>-->
173 121  
174 122 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
175 123 <label class="form-group__label">Описание вакансии</label>
resources/views/employers/ajax/list_vacancy.blade.php
... ... @@ -40,43 +40,43 @@
40 40 @endif
41 41 </td>
42 42 <td>
43   - <span class="table__controls">
44   - <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}">
45   - <svg>
46   - <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use>
47   - </svg>
48   - </a>
49   - <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item">
50   - <svg>
51   - <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
52   - </svg>
53   - </a>
54   - <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}">
55   - <svg>
56   - <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use>
57   - </svg>
58   - </a>
59   - @if ($it->active_is)
60   - <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item">
61   - <svg>
62   - <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
63   - </svg>
64   - </a>
65   - @else
66   - <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item">
67   - <svg>
68   - <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
69   - </svg>
70   - </a>
71   - @endif
72   -
73   - <!--<button type="button" class="table__controls-item">
74   - <svg>
75   - <use xlink:href=" asset('images/sprite.svg#tg') }}"></use>
76   - </svg>
77   - </button>
78   - -->
79   - </span>
  43 + <span class="table__controls">
  44 + <a class="table__controls-item up-it" title="Поднять вакансию" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}">
  45 + <svg>
  46 + <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use>
  47 + </svg>
  48 + </a>
  49 + <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" title="Редактировать вакансию" class="table__controls-item">
  50 + <svg>
  51 + <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
  52 + </svg>
  53 + </a>
  54 + <a class="table__controls-item" title="Удалить вакансию" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}">
  55 + <svg>
  56 + <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use>
  57 + </svg>
  58 + </a>
  59 + @if ($it->active_is)
  60 + <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" title="Скрыть вакансию" class="table__controls-item">
  61 + <svg>
  62 + <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
  63 + </svg>
  64 + </a>
  65 + @else
  66 + <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" title="Показать вакансию" class="table__controls-item">
  67 + <svg>
  68 + <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
  69 + </svg>
  70 + </a>
  71 + @endif
  72 + @if ($Employer->social_is == 1)
  73 + <a href="{{ route('employer.send-vacancy-to-social', ['social' => 'tg', 'vacancy' => $it->id]) }}" title="Отправить вакансию в телеграм" class="table__controls-item">
  74 + <svg>
  75 + <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
  76 + </svg>
  77 + </a>
  78 + @endif
  79 + </span>
80 80 </td>
81 81 </tr>
82 82 @endforeach
resources/views/employers/bd.blade.php
... ... @@ -136,7 +136,7 @@
136 136 </div>
137 137 <span>
138 138 Пользователей найдено:
139   - <b>{{ $count_users->count() }}</b>
  139 + <b>{{ $users->count() }}</b>
140 140 </span>
141 141 </div>
142 142 <div class="table table_spoiler">
resources/views/employers/favorite.blade.php
... ... @@ -62,10 +62,10 @@
62 62 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
63 63 },
64 64 success: function (data) {
65   - if ($(this).hasClass('active')){
66   - $(this).removeClass('active');
67   - } else{
68   - $(this).addClass('active');
  65 + if (data.deleted){
  66 + $('#elem_'+data.id).removeClass('active');
  67 + } else {
  68 + $('#elem_'+data.id).addClass('active');
69 69 }
70 70 },
71 71 error: function (data) {
... ... @@ -75,6 +75,13 @@
75 75 });
76 76 });
77 77 });
  78 + $(document).on('click', '.chat', function() {
  79 + var this_ = $(this);
  80 +
  81 + $('#_user_id').val(this_.attr('data-uid'));
  82 + $('#_to_user_id').val(this_.attr('data-tuid'));
  83 + $('#_vacancy').val(this_.attr('data-vacancy'));
  84 + });
78 85 </script>
79 86  
80 87 @endsection
... ... @@ -144,40 +151,23 @@
144 151 <span class="in-favorites">Убрать из избранного</span>
145 152 </button>
146 153  
147   - @guest
148   - <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
149   - class="chat">
150   - <svg class="mr-10">
151   - <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
152   - </svg>
153   - <span>Написать</span>
154   - </button>
155   - @else
156   - @if (App\Classes\StatusUser::Status()==0)
157   - @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message))
158   - <button type="button" class="chat" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ Auth()->user()->id }}" data-tuid="{{ $it->users->id }}" data-options='{"touch":false,"autoFocus":false}'>
159   - <svg class="mr-10">
160   - <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
161   - </svg>
162   - <span>Написать</span>
163   - </button>
164   - @endif
165   - @else
166   - <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}'
167   - class="chat">
168   - <svg class="mr-10">
169   - <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
170   - </svg>
171   - <span>Написать</span>
172   - </button>
173   - @endif
174   - @endif
  154 + <button type="button"
  155 + class="chat"
  156 + data-fancybox
  157 + data-src="#send2"
  158 + data-vacancy="0"
  159 + data-uid="{{ Auth()->user()->id }}"
  160 + data-tuid="{{ $it->users->id }}"
  161 + data-options='{"touch":false,"autoFocus":false}'>
  162 + <svg class="mr-10">
  163 + <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
  164 + </svg>
  165 + <span>Написать</span>
  166 + </button>
175 167  
176 168 <a href="{{ route('resume_profile', ['worker' => $it->id]) }}" class="button">Подробнее</a>
177 169 </div>
178 170 </div>
179   -
180   -
181 171 <div class="cvs__item-text">
182 172 <div class="cvs__item-text-row">
183 173 <div class="flex" style="align-items: start;">
resources/views/index.blade.php
... ... @@ -5,7 +5,6 @@
5 5 @endsection
6 6  
7 7 @section('content')
8   - @include('messages_error')
9 8 <section class="work">
10 9 <div class="container">
11 10 <img src="{{ asset('images/1.png') }}" alt="" class="work__pic">
resources/views/js/vacancy-response.blade.php
... ... @@ -0,0 +1,15 @@
  1 +<script>
  2 + $(document).on('click', '.ask_comment', function() {
  3 + var this_ = $(this);
  4 +
  5 + $('#modal_user_id').val(this_.attr('data-uid'));
  6 + $('#modal_to_user_id').val(this_.attr('data-tuid'));
  7 + $('#modal_vacancy').val(this_.attr('data-vacancy'));
  8 + });
  9 +
  10 + $(document).on('click', '.ask_percent', function() {
  11 + $('#modal_vacancy')
  12 + .val($(this).attr('data-vacancy'))
  13 + .trigger('change');
  14 + });
  15 +</script>
resources/views/list_vacancies.blade.php
... ... @@ -52,20 +52,6 @@
52 52 }
53 53 });
54 54  
55   - $(document).on('click', '.ask_comment', function() {
56   - var this_ = $(this);
57   -
58   - $('#modal_user_id').val(this_.attr('data-uid'));
59   - $('#modal_to_user_id').val(this_.attr('data-tuid'));
60   - $('#modal_vacancy').val(this_.attr('data-vacancy'));
61   - });
62   -
63   - $(document).on('click', '.ask_percent', function() {
64   - $('#modal_vacancy')
65   - .val($(this).attr('data-vacancy'))
66   - .trigger('change');
67   - });
68   -
69 55 $(document).on('change', '#sort_ajax', function() {
70 56 var this_ = $(this);
71 57 var val_ = this_.val();
... ... @@ -105,6 +91,7 @@
105 91 });
106 92 </script>
107 93 @include('js.favorite-vacancy-45')
  94 + @include('js.vacancy-response')
108 95 @endsection
109 96 @section('content')
110 97 <section class="thing">
resources/views/modals/send_employer.blade.php
... ... @@ -22,7 +22,7 @@
22 22 <label for="i1">Не заполнено поле</label>
23 23 </div>
24 24 <div class="modal__form-item">
25   - <textarea id="i2" class="textarea" name="text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea>
  25 + <textarea id="i2" class="textarea" name="text" placeholder="Напишите текст с предложением о работе" required></textarea>
26 26 <label for="i2">Не заполнено поле</label>
27 27 </div>
28 28 <div class="modal__form-item">
resources/views/modals/send_worker.blade.php
... ... @@ -46,7 +46,7 @@
46 46 <label for="title">Не заполнено поле</label>
47 47 </div>
48 48 <div class="modal__form-item send_text_div">
49   - <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Напишите текст с предложением о работе" required></textarea>
  49 + <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea>
50 50 <label for="i2">Не заполнено поле</label>
51 51 </div>
52 52 <div class="modal__form-item">
resources/views/modals/vacancy/add_comment.blade.php
... ... @@ -12,7 +12,14 @@
12 12 <input type="hidden" id="response_vacancy" name="_vacancy" class="input" placeholder="vacancy" value="">
13 13 </div>
14 14 <div class="modal__form-item">
15   - <textarea id="comment_text" class="textarea" name="text" placeholder="Комментарий" required value=""></textarea>
  15 + <textarea
  16 + id="comment_text"
  17 + class="textarea"
  18 + name="text"
  19 + placeholder="Пожалуйста напишите в комментарии вашу должность, номер телефона и дату готовности к посадке."
  20 + required
  21 + value="">
  22 + </textarea>
16 23 <label for="comment_text">Не заполнено поле</label>
17 24 </div>
18 25 <div class="modal__form-item">
resources/views/modals/vacancy/send_response_to_employer.blade.php
... ... @@ -14,7 +14,7 @@
14 14 </div>
15 15 </div>
16 16 <script>
17   - $('#close-button').click(function(){
  17 + $('#close-button').click(function() {
18 18 $.fancybox.close();
19 19 $.fancybox.close();
20 20 $.fancybox.close();
resources/views/vacance-item.blade.php
... ... @@ -5,37 +5,8 @@
5 5 @extends('layout.frontend', ['title' => $title])
6 6  
7 7 @section('scripts')
8   - <script>
9   - $(document).on('click', '.js_send_it_button', function() {
10   - var this_ = $(this);
11   - var code_user_id = this_.attr('data-uid');
12   - var code_to_user_id = this_.attr('data-tuid');
13   - var code_vacancy = this_.attr('data-vacancy');
14   - var user_id = $('#_user_id');
15   - var to_user_id = $('#_to_user_id');
16   - var vacancy = $('#_vacancy');
17   -
18   - user_id.val(code_user_id);
19   - to_user_id.val(code_to_user_id);
20   - vacancy.val(code_vacancy);
21   - });
22   - </script>
23   - <script>
24   - $(document).on('click', '.js_send_for_emp', function() {
25   - var this_ = $(this);
26   - var code_user_id = this_.attr('data-uid');
27   - var code_to_user_id = this_.attr('data-tuid');
28   - var code_vacancy = this_.attr('data-vacancy');
29   - var user_id = $('#send_user_id');
30   - var to_user_id = $('#send_to_user_id');
31   - var vacancy = $('#send_vacancy');
32   -
33   - user_id.val(code_user_id);
34   - to_user_id.val(code_to_user_id);
35   - vacancy.val(code_vacancy);
36   - });
37   - </script>
38 8 @include('js.favorite-vacancy-45')
  9 + @include('js.vacancy-response')
39 10 @endsection
40 11  
41 12 @section('content')
... ... @@ -121,26 +92,44 @@
121 92 <br>
122 93 <div class="main__employer-page-two-item-buttons">
123 94 @guest
124   - <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
125   - class="button main__employer-page-two-item-button">Откликнуться</button>
  95 + <button type="button"
  96 + data-fancybox
  97 + data-src="#question"
  98 + data-options='{"touch":false,"autoFocus":false}'
  99 + class="button main__employer-page-two-item-button">
  100 + Откликнуться
  101 + </button>
126 102 @else
127   - @if (App\Classes\StatusUser::Status()==1)
128   - <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
129   - class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
130   - @else
131   - <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
132   - class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
  103 + @if (App\Classes\StatusUser::Status() == 1)
  104 + <?php
  105 + if (\App\Classes\Tools::getWorkerProfilePercent(Auth()->user()->workers[0]) >= 50) {
  106 + $buttonId = 'ask_comment';
  107 + } else {
  108 + $buttonId = 'ask_percent';
  109 + }
  110 + ?>
  111 + <button type="button"
  112 + data-fancybox
  113 + data-src="#{{$buttonId}}"
  114 + data-vacancy="{{ $Q->id }}"
  115 + data-uid="{{ $uid }}"
  116 + data-tuid="{{ $Q->employer->user_id }}"
  117 + data-options='{"touch":false,"autoFocus":false}'
  118 + class="button main__employer-page-two-item-button {{ $buttonId }}">
  119 + Откликнуться
  120 + </button>
  121 + <div class="main__employer-page-two-item-bottom">
  122 + <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div>
  123 + <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
  124 + <svg>
  125 + <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
  126 + </svg>
  127 + </button>
  128 + </div>
133 129 @endif
134 130 @endguest
135 131 </div>
136   - <div class="main__employer-page-two-item-bottom">
137   - <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div>
138   - <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
139   - <svg>
140   - <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
141   - </svg>
142   - </button>
143   - </div>
  132 +
144 133 </div>
145 134 @endforeach
146 135