Commit 6bad752f0bc6ef5519e0376f43f6f0742d2a9571

Authored by Fedor
1 parent 7f9957575c
Exists in master

task-132687 minor changes

Showing 10 changed files with 137 additions and 40 deletions Side-by-side Diff

app/Classes/Tools.php
... ... @@ -27,28 +27,44 @@ class Tools
27 27  
28 28 public static function getWorkerProfilePercent(Worker $Worker): int
29 29 {
30   - $persent = 10;
  30 + $persent = 0;
31 31  
32   - if ((!empty($Worker->telephone)) &&
33   - (!empty($Worker->email)) && (!empty($Worker->experience)) &&
34   - (!empty($Worker->city)) && (!empty($Worker->old_year))) {
35   - $persent = $persent + 40;
  32 + if (
  33 + (!empty($Worker->users->surname)) &&
  34 + (!empty($Worker->users->name_man)) &&
  35 + (!empty($Worker->users->surname2)) &&
  36 + (!empty($Worker->old_year)) &&
  37 + ($Worker->job_titles->count() > 0) &&
  38 + (!empty($Worker->salary_expectations)) &&
  39 + (!empty($Worker->experience)) &&
  40 + (!empty($Worker->english_level)) &&
  41 + (!empty($Worker->ready_boart_date)) &&
  42 + (!empty($Worker->boart_type_preference)) &&
  43 + (!empty($Worker->visa_available)) &&
  44 + (!empty($Worker->confirmation_work_for_vvp)) &&
  45 + (!empty($Worker->military_id_available)) &&
  46 + (!empty($Worker->city)) &&
  47 + (!empty($Worker->telephone)) &&
  48 + (!empty($Worker->email)) &&
  49 + (!empty($Worker->telephone2))
  50 + ) {
  51 + $persent += 50;
36 52 }
37 53  
38 54 if ($Worker->sertificate->count() > 0) {
39   - $persent = $persent + 15;
  55 + $persent += 10;
40 56 }
41 57  
42 58 if ($Worker->infobloks->count() > 0) {
43   - $persent = $persent + 20;
  59 + $persent += 10;
44 60 }
45 61  
46   - if ($Worker->prev_company->count() > 0) {
47   - $persent = $persent + 10;
  62 + if ($Worker->place_worker->count() > 0) {
  63 + $persent += 25;
48 64 }
49 65  
50   - if (!empty($Worker->photo)) {
51   - $persent = $persent + 5;
  66 + if ($Worker->prev_company->count() > 0) {
  67 + $persent += 5;
52 68 }
53 69  
54 70 return $persent;
app/Components/Integrations/Telegram/VacancyChannel.php
... ... @@ -55,6 +55,7 @@ class VacancyChannel
55 55  
56 56 $text = str_ireplace('<p>', '', $vacancy->text);
57 57 $text = str_ireplace('</p>', '', $text);
  58 + $text = str_ireplace('<br>', '', $text);
58 59  
59 60 $this->botApi->sendMessage([
60 61 'chat_id' => $chatId,
app/Http/Controllers/EmployerController.php
... ... @@ -296,13 +296,11 @@ class EmployerController extends Controller
296 296  
297 297 // Обновление даты
298 298 public function vacancy_up(Ad_employer $ad_employer) {
299   - $up = date('m/d/Y h:i:s', time());;
300   - $vac_emp = Ad_employer::findOrFail($ad_employer->id);
301   - $vac_emp->updated_at = $up;
302   - $vac_emp->save();
  299 + $up = date('m/d/Y h:i:s', time());
  300 + $ad_employer->updated_at = $up;
  301 + $ad_employer->save();
303 302  
304   - return redirect()->back(); //route('employer.vacancy_list');
305   - // начало конца
  303 + return redirect()->back();
306 304 }
307 305  
308 306 //Видимость вакансии
... ... @@ -546,7 +544,7 @@ class EmployerController extends Controller
546 544  
547 545 $workerBuilder->whereHas('users', function (Builder $query) use ($search) {
548 546 $query->where('surname', 'LIKE', "%$search%")
549   - ->oWhere('name_man', 'LIKE', "%$search%")
  547 + ->orWhere('name_man', 'LIKE', "%$search%")
550 548 ->orWhere('surname2', 'LIKE', "%$search%");
551 549 });
552 550 }
resources/views/admin/users/form.blade.php
... ... @@ -14,7 +14,7 @@
14 14 @isset($list_job_titles)
15 15 @foreach($list_job_titles as $job_title)
16 16 <option value="{{ $job_title->id }}"
17   - @if ($user?->workers[0]?->positions_work && in_array($job_title->id , $user->workers[0]->positions_work))
  17 + @if (isset($user) && $user?->workers[0]?->positions_work && in_array($job_title->id , $user->workers[0]->positions_work))
18 18 selected
19 19 @endif
20 20 >
resources/views/employers/dialog.blade.php
... ... @@ -175,12 +175,20 @@
175 175 <img src="{{ asset('images/default_man.jpg') }}" alt="">
176 176 @endif
177 177 @endif
178   -
179 178 </div>
180 179 <div class="chatbox__item-body">
181 180 @if($it->text || $it->reply_message_id)
182 181 <div class="chatbox__item-text">
183   - {{ $it->text ?? '' }}
  182 + @if($it->ad_employer_id > 0)
  183 + <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br>
  184 + @if($it->text)
  185 + <b>Комментарий:</b> {{ $it->text }}
  186 + @endif
  187 + @else
  188 + @if($it->text)
  189 + {{ $it->text }}
  190 + @endif
  191 + @endif
184 192  
185 193 @if($it->reply_message_id)
186 194 <div class="reply-message">
... ... @@ -234,7 +242,17 @@
234 242 </div>
235 243 <div class="chatbox__item-body">
236 244 @if($it->text)
237   - <div class="chatbox__item-text">{{ $it->text }}</div>
  245 + <div class="chatbox__item-text">
  246 + @if($it->ad_employer_id > 0)
  247 + <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br>
  248 + @if($it->text)
  249 + <b>Комментарий:</b> {{ $it->text }}
  250 + @endif
  251 + @else
  252 + @if($it->text)
  253 + {{ $it->text }}
  254 + @endif
  255 + @endif</div>
238 256 @endif
239 257 @if ((isset($it->file)) && (!empty($it->file)))
240 258 <div class="chatbox__item-text chatbox__item-body-file-name-wrap">
resources/views/employers/favorite.blade.php
... ... @@ -44,8 +44,39 @@
44 44 }
45 45 });
46 46 });
  47 +
  48 + $(document).ready(function() {
  49 + $(document).on('click', '.js_box_favorit', function () {
  50 + var id_worker = $(this).attr('data-val');
  51 + var data = {code_record: id_worker};
  52 +
  53 + if ($(this).hasClass('active')){
  54 + data.delete = 1;
  55 + }
  56 +
  57 + $.ajax({
  58 + type: "GET",
  59 + url: "{{ route('like_resume') }}",
  60 + data: data,
  61 + headers: {
  62 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  63 + },
  64 + success: function (data) {
  65 + if ($(this).hasClass('active')){
  66 + $(this).removeClass('active');
  67 + } else{
  68 + $(this).addClass('active');
  69 + }
  70 + },
  71 + error: function (data) {
  72 + data = JSON.stringify(data);
  73 + console.log('Error: ' + data);
  74 + }
  75 + });
  76 + });
  77 + });
47 78 </script>
48   - @include('js.favorite-worker')
  79 +
49 80 @endsection
50 81  
51 82 @section('content')
... ... @@ -102,7 +133,10 @@
102 133 </div>
103 134  
104 135 <div class="cvs__item-buttons">
105   - <button type="button" id="elem_{{ $it->id }}" data-val="{{ $it->id }}" class="like cvs__item-like js_box_favorit js-toggle {{ \App\Classes\LikesClass::get_status_worker($it) }}">
  136 + <button type="button"
  137 + id="elem_{{ $it->id }}"
  138 + data-val="{{ $it->id }}"
  139 + class="like cvs__item-like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($it) }}">
106 140 <svg class="mr-10">
107 141 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
108 142 </svg>
resources/views/modals/vacancy/add_comment.blade.php
... ... @@ -16,29 +16,38 @@
16 16 <label for="comment_text">Не заполнено поле</label>
17 17 </div>
18 18 <div class="modal__form-item">
19   - {{--<a id="send_resume" class="button">Отправить</a>--}}
20 19 <button type="button"
21 20 data-fancybox
22   - id="send_resume"
23 21 data-src="#response_sent"
24   - class="button main__employer-page-two-item-button">Отправить</button>
  22 + class="button main__employer-page-two-item-button send_resume">Отправить</button>
  23 + <button type="button"
  24 + data-fancybox
  25 + data-src="#response_sent_no_comment"
  26 + class="button main__employer-page-two-item-button send_resume">Пропустить</button>
25 27 </div>
26 28 </form>
27 29 </div>
28 30 </div>
29 31  
30 32 <script>
31   - $(document).on('click', '#send_resume', function(){
  33 + $(document).on('click', '.send_resume', function(){
  34 + var data = {
  35 + user_from: $('#response_user_id').val(),
  36 + user_to: $('#response_to_user_id').val(),
  37 + vacancy: $('#response_vacancy').val(),
  38 + _token: '{{csrf_token()}}'
  39 + }
  40 +
  41 + var comment = $('.comment_form textarea').serializeArray()[0].value;
  42 +
  43 + if (comment !== '') {
  44 + data.comment = comment;
  45 + }
  46 +
32 47 $.ajax({
33 48 url: '{{ route('worker.new_message') }}',
34 49 type: 'POST',
35   - data: {
36   - user_from: $('#response_user_id').val(),
37   - user_to: $('#response_to_user_id').val(),
38   - vacancy: $('#response_vacancy').val(),
39   - comment: $('.comment_form textarea').serializeArray()[0].value,
40   - _token: '{{csrf_token()}}'
41   - },
  50 + data: data,
42 51 success: function (data) {
43 52 //
44 53 }
resources/views/modals/vacancy/ask_for_resume_comment.blade.php
... ... @@ -20,7 +20,7 @@
20 20 <button type="button"
21 21 data-fancybox
22 22 id="send_resume_no_comment"
23   - data-src="#response_sent"
  23 + data-src="#response_sent_no_comment"
24 24 class="button main__employer-page-two-item-button">Нет</button>
25 25 </div>
26 26 </div>
resources/views/modals/vacancy/send_response_no_comment.blade.php
... ... @@ -0,0 +1,22 @@
  1 +<div id="response_sent_no_comment" class="modal modal_bg">
  2 + <div class="modal__body">
  3 + <div class="modal__text">Ваше резюме отправлено работодателю.</div>
  4 + <div class="modal__text">Спасибо, что пользуетесь нашим сервисом.</div>
  5 + <div class="modal__text">Удачи Вам в поисках работы.</div>
  6 + <div class="modal__text"></div>
  7 + <div class="modal__text"></div>
  8 + <button type="button"
  9 + id="close-button"
  10 + class="button"
  11 + >
  12 + Вернуться
  13 + </button>
  14 + </div>
  15 +</div>
  16 +<script>
  17 + $('#close-button').click(function(){
  18 + $.fancybox.close();
  19 + $.fancybox.close();
  20 + $.fancybox.close();
  21 + });
  22 +</script>
resources/views/vacance-item.blade.php
... ... @@ -69,19 +69,19 @@
69 69 <div class="main__employer-page-item">
70 70 <b>Сайт</b>
71 71 <span>
72   - <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a>
  72 + {{ $Query[0]->employer->site }}
73 73 </span>
74 74 </div>
75 75 <div class="main__employer-page-item">
76 76 <b>Почта</b>
77 77 <span>
78   - <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a>
  78 + {{ $Query[0]->employer->email }}
79 79 </span>
80 80 </div>
81 81 <div class="main__employer-page-item">
82 82 <b>Телефон</b>
83 83 <span>
84   - <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a>
  84 + {{ $Query[0]->employer->telephone }}
85 85 </span>
86 86 </div>
87 87 </div>
... ... @@ -97,7 +97,6 @@
97 97 @endif
98 98 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2>
99 99 <h3 class="main__employer-page-title_">Описание вакансии</h3>
100   -
101 100 </div>
102 101  
103 102 @foreach ($Query as $Q)