Commit cd59d5933aa3cb40d8c01507e9886a5dc81b3ae4

Authored by Hayk Nazaryan
Exists in master

Merge branch 'master' of http://gitlab.nologostudio.ru/alarionov/rekamore-su

Showing 10 changed files Side-by-side Diff

app/Http/Controllers/WorkerController.php
... ... @@ -799,7 +799,7 @@ class WorkerController extends Controller
799 799 $worker->updated_at = Carbon::now();
800 800 $worker->save();
801 801 // 0
802   - return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
  802 + return redirect()->route('worker.cabinet')->with('success', 'Резюме подняли');
803 803 }
804 804  
805 805 // Форма сертификате
... ... @@ -881,7 +881,7 @@ class WorkerController extends Controller
881 881 );
882 882 }
883 883  
884   - return redirect()->route('worker.additional_documents')->with('success', 'Успешно сохранено!');
  884 + return redirect()->route('worker.cabinet')->with('success', 'Успешно сохранено!');
885 885 }
886 886 public function subscribe() {
887 887  
public/css/general.css
... ... @@ -60,3 +60,7 @@
60 60 margin-top: 0;
61 61 margin-bottom: 15px;
62 62 }
  63 +
  64 +.sertificate-form-inputs {
  65 + align-items: normal!important;
  66 +}
resources/views/workers/cabinet.blade.php
1 1 @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре'])
2 2  
3 3 @section('scripts')
  4 +@include('modals.flash-message', [
  5 + 'title' => 'Успешно!',
  6 + 'message' => session('success')
  7 +])
4 8 <script>
5 9 $(function() {
6 10 $('.cabinet__avatar-form [type="file"][name="photo"]').change(function (event) {
resources/views/workers/docs.blade.php
... ... @@ -62,16 +62,29 @@
62 62 <div class="cabinet__inputs-item form-group">
63 63 <label class="form-group__label">Начало контракта</label>
64 64 <div class="form-group__item">
65   - <input type="text" name="Begin_work" id="Begin_work" class="input" value="{{ old('begin_work') ?? $doc->begin_work ?? '' }}">
  65 + <input
  66 + type="text"
  67 + name="Begin_work"
  68 + id="Begin_work"
  69 + class="input"
  70 + placeholder="11.11.2011"
  71 + value="{{ old('begin_work') ?? $doc->begin_work ?? '' }}">
66 72 </div>
67 73 </div>
68 74  
69 75 <div class="cabinet__inputs-item form-group">
70 76 <label class="form-group__label">Окончание контракта</label>
71 77 <div class="form-group__item">
72   - <input type="text" name="End_work" id="End_work" class="input" value="{{ old('end_work') ?? $doc->end_work ?? '' }}">
  78 + <input
  79 + type="text"
  80 + name="End_work"
  81 + id="End_work"
  82 + class="input"
  83 + placeholder="11.11.2011"
  84 + value="{{ old('end_work') ?? $doc->end_work ?? '' }}">
73 85 </div>
74 86 </div>
  87 +
75 88 </div>
76 89  
77 90 <div class="flex">
... ... @@ -105,23 +118,30 @@
105 118 var wrap = this_btn.closest('.cabinet__inputs');
106 119 var data = {};
107 120 var form_is_not_filled = false;
  121 + var date_format_regex = /^\d{2}\.\d{2}\.\d{4}$/;
108 122  
109 123 wrap.find('.error-block').html('');
110 124 wrap.find('input').removeClass('border-red');
111 125  
112 126 wrap.find('input').each(function(){
113 127 var val = $(this).val().trim();
  128 + var name = $(this).attr('name');
114 129  
115 130 if ($(this).is('[required]') && !val){
116 131 $(this).addClass('border-red');
117 132 form_is_not_filled = true;
  133 + } else if ($(this).attr('name') === 'Begin_work' || $(this).attr('name') === 'End_work') {
  134 + if (!date_format_regex.test(val)) {
  135 + $(this).addClass('border-red');
  136 + $(this).after('<span class="error-block">Неверный формат даты (дд.мм.гггг).</span>');
  137 + form_is_not_filled = true;
  138 + }
118 139 }
119 140  
120   - var name = $(this).attr('name');
121 141 data[name] = val;
122 142 });
123 143  
124   - if (form_is_not_filled){
  144 + if (form_is_not_filled) {
125 145 spinStop(this_btn);
126 146 return;
127 147 }
resources/views/workers/favorite.blade.php
... ... @@ -124,7 +124,7 @@
124 124 </div>
125 125 <div class="main__employer-page-two-item-bottom">
126 126 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div>
127   - <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}?>">
  127 + <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
128 128 <svg>
129 129 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
130 130 </svg>
resources/views/workers/form_additional_documents.blade.php
1 1 @extends('workers.cabinet_layout', ['title' => 'Дополнительные документы - РекаМоре'])
2 2  
3 3 @section('cabinet_content')
4   -<form action="{{ route('worker.edit_diploms', ['worker' => $worker->id]) }}" class="cabinet__inputs" method="POST">
  4 + <form action="{{ route('worker.edit_diploms', ['worker' => $worker->id]) }}" class="cabinet__inputs" method="POST">
5 5 @csrf
6 6 @method('PUT')
7 7  
... ... @@ -38,7 +38,7 @@
38 38 <div class="cabinet__body-item cabinet__inputs-item-full-row">
39 39 <div class="cabinet__buttons_flex">
40 40 <button type="submit" class="button mr-10">Сохранить</button>
41   - <a href="{{ route('worker.cabinet') }}" class="button button_light active">Назад</a>
  41 + <a href="{{ route('worker.cabinet') }}" class="button button_light active">Вернуться к моей анкете</a>
42 42 </div>
43 43 </div>
44 44 </div>
resources/views/workers/form_basic_information.blade.php
... ... @@ -114,27 +114,27 @@
114 114 <div class="cabinet__inputs-item form-group">
115 115 <label class="form-group__label">Наличие визы:</label>
116 116 <div class="form-group__item">
117   - <input type="text" name="visa_available" id="visa_available" value="{{ $worker->visa_available }}" class="input" placeholder="Да">
  117 + <input type="text" name="visa_available" id="visa_available" value="{{ $worker->visa_available }}" class="input" placeholder="В наличии / Отсутствует">
118 118 </div>
119 119 </div>
120 120  
121 121 <div class="cabinet__inputs-item form-group">
122 122 <label class="form-group__label">Наличие танкерных документов:</label>
123 123 <div class="form-group__item">
124   - <input type="text" name="tanker_documents_available" id="tanker_documents_available" value="{{ $worker->tanker_documents_available }}" class="input" placeholder="Нет">
  124 + <input type="text" name="tanker_documents_available" id="tanker_documents_available" value="{{ $worker->tanker_documents_available }}" class="input" placeholder="В наличии / Отсутствует">
125 125 </div>
126 126 </div>
127 127 <div class="cabinet__inputs-item form-group">
128 128 <label class="form-group__label">Наличие подтверждения для работы на ВВП:</label>
129 129 <div class="form-group__item">
130   - <input type="text" name="confirmation_work_for_vvp" id="confirmation_work_for_vvp" value="{{ $worker->confirmation_work_for_vvp }}" class="input" placeholder="Нет">
  130 + <input type="text" name="confirmation_work_for_vvp" id="confirmation_work_for_vvp" value="{{ $worker->confirmation_work_for_vvp }}" class="input" placeholder="В наличии / Отсутствует">
131 131 </div>
132 132 </div>
133 133  
134 134 <div class="cabinet__inputs-item form-group">
135 135 <label class="form-group__label">Наличие военного билета / приписного свидетельства:</label>
136 136 <div class="form-group__item">
137   - <input type="text" name="military_id_available" id="military_id_available" value="{{ $worker->military_id_available }}" class="input" placeholder="Нет">
  137 + <input type="text" name="military_id_available" id="military_id_available" value="{{ $worker->military_id_available }}" class="input" placeholder="НВ наличии / Отсутствуетет">
138 138 </div>
139 139 </div>
140 140 <div class="cabinet__inputs-item form-group">
... ... @@ -160,14 +160,17 @@
160 160 <div class="cabinet__inputs-item form-group">
161 161 <label class="form-group__label">Контакты родственников:</label>
162 162 <div class="form-group__item">
163   - <input type="text" name="telephone2" id="telephon2" value="{{ old('telephone2') ?? $worker->telephone2 ?? '' }}" class="input">
  163 + <input type="text" name="telephone2" id="telephon2" value="{{ old('telephone2') ?? $worker->telephone2 ?? '' }}" class="input" placeholder="+7 (___) ___-__-__ - мама">
164 164 </div>
165 165 </div>
166 166 <div class="cabinet__inputs-item form-group"></div>
167 167  
168 168 <div class="cabinet__body-item cabinet__inputs-item-full-row">
169 169 <h4 class="cabinet__h4">О себе</h4>
170   - <textarea class="textarea" name="text" id="text" placeholder="Не указано">{{ $worker->text }}</textarea>
  170 + <textarea class="textarea" name="text" id="text"
  171 + placeholder="Укажите информацию, которая поможет работодателю или укажите недостающую информацию, которую не смогли указать при заполнении анкеты.">
  172 + {{ $worker->text }}
  173 + </textarea>
171 174 </div>
172 175  
173 176 <div class="cabinet__body-item cabinet__inputs-item-full-row">
resources/views/workers/menu.blade.php
... ... @@ -26,7 +26,7 @@
26 26 </i>
27 27 <span>Сообщения</span>
28 28 </a>
29   - <a href="{{ route('worker.autolift') }}" class="cabinet__menu-item @if ($item==7) active @endif">
  29 + <a href="{{ route('worker.autolift') }}" class="cabinet__menu-item @if ($item==15) active @endif">
30 30 <i>
31 31 <svg>
32 32 <use xlink:href="{{ asset('images/sprite.svg#refresh') }}"></use>
... ... @@ -34,7 +34,7 @@
34 34 </i>
35 35 <span>Автоподнятие резюме</span>
36 36 </a>
37   - <a href="{{ route('worker.autoresponder') }}" class="cabinet__menu-item @if ($item==6) active @endif">
  37 + <a href="{{ route('worker.autoresponder') }}" class="cabinet__menu-item @if ($item==16) active @endif">
38 38 <i>
39 39 <svg>
40 40 <use xlink:href="{{ asset('images/sprite.svg#answering') }}"></use>
... ... @@ -84,7 +84,9 @@
84 84 <script>
85 85 $(function(){
86 86 var active_menu = $('.cabinet__menu-item.active');
  87 + console.log(active_menu.length);
87 88 if (active_menu.length === 1){
  89 +
88 90 $('.cabinet__menu-toper-text').html(active_menu.html());
89 91 }
90 92 });
resources/views/workers/sertificate_add.blade.php
... ... @@ -9,7 +9,7 @@
9 9 <div class="error-block"></div>
10 10  
11 11 <div class="cabinet__body-item width100">
12   - <div class="cabinet__inputs">
  12 + <div class="cabinet__inputs sertificate-form-inputs">
13 13 <div class="cabinet__inputs-item form-group">
14 14 <label class="form-group__label">Название сертификата:</label>
15 15 <div class="form-group__item">
... ... @@ -25,7 +25,14 @@
25 25 @error('end_begin')
26 26 <div class="error red">{{ $message }}</div>
27 27 @enderror
28   - <input type="text" name="end_begin" id="end_begin" class="input" value="{{ old('end_begin') ?? '' }}" required>
  28 + <input
  29 + type="text"
  30 + name="end_begin"
  31 + id="end_begin"
  32 + class="input"
  33 + placeholder="11.11.2011"
  34 + value="{{ old('end_begin') ?? '' }}"
  35 + required>
29 36 </div>
30 37 </div>
31 38 </div>
... ... @@ -59,9 +66,10 @@
59 66 var this_btn = $(this);
60 67 spinStart(this_btn);
61 68 var wrap = this_btn.closest('.cabinet__inputs');
62   - var name = wrap.find('[name="name"]').val();
63   - var end_date = wrap.find('[name="end_begin"]').val();
  69 + var name = wrap.find('[name="name"]').val().trim();
  70 + var end_date = wrap.find('[name="end_begin"]').val().trim();
64 71 var worker_id = wrap.find('[name="worker_id"]').val();
  72 + var date_format_regex = /^\d{2}\.\d{2}\.\d{4}$/; // Format: DD.MM.YYYY
65 73  
66 74 wrap.find('.error-block').html('');
67 75 wrap.find('input').removeClass('border-red');
... ... @@ -73,6 +81,12 @@
73 81 }
74 82 if (!end_date) {
75 83 wrap.find('[name="end_begin"]').addClass('border-red');
  84 + wrap.find('[name="end_begin"]').after('<span class="error-block">Поле "Дата окончания" обязательно для заполнения.</span>');
  85 + spinStop(this_btn);
  86 + return;
  87 + } else if (!date_format_regex.test(end_date)) {
  88 + wrap.find('[name="end_begin"]').addClass('border-red');
  89 + wrap.find('[name="end_begin"]').after('<span class="error-block">Неверный формат даты (дд.мм.гггг).</span>');
76 90 spinStop(this_btn);
77 91 return;
78 92 }
resources/views/workers/sertificate_edit.blade.php
... ... @@ -7,14 +7,14 @@
7 7 <input type="hidden" name="worker_id" id="worker_id" class="input" value="{{ $worker->id }}">
8 8  
9 9 <div class="cabinet__body-item width100">
10   - <div class="cabinet__inputs">
  10 + <div class="cabinet__inputs sertificate-form-inputs">
11 11 <div class="cabinet__inputs-item form-group">
12 12 <label class="form-group__label">Название сертификата:</label>
13 13 <div class="form-group__item">
14 14 @error('name')
15 15 <div class="error red">{{ $message }}</div>
16 16 @enderror
17   - <input type="text" name="name" id="name" class="input" value="{{ old('name') ?? $doc->name }}" required>
  17 + <input type="text" name="name" id="name" class="input" value="{{ old('name') ?? $doc->name }}">
18 18 </div>
19 19 </div>
20 20 <div class="cabinet__inputs-item form-group">
... ... @@ -23,7 +23,13 @@
23 23 @error('end_begin')
24 24 <div class="error red">{{ $message }}</div>
25 25 @enderror
26   - <input type="text" name="end_begin" id="end_begin" class="input" value="{{ old('end_begin') ?? date('d.m.Y', strtotime($doc->end_begin)) }}" required>
  26 + <input
  27 + type="text"
  28 + name="end_begin"
  29 + id="end_begin"
  30 + class="input"
  31 + placeholder="11.11.2011"
  32 + value="{{ old('end_begin') ?? date('d.m.Y', strtotime($doc->end_begin)) }}">
27 33 </div>
28 34 </div>
29 35 </div>
... ... @@ -35,3 +41,40 @@
35 41 </div>
36 42 </form>
37 43 @endsection
  44 +
  45 +@section('scripts')
  46 +
  47 + <script>
  48 + $('#submit_form').on('submit', function (event) {
  49 + event.preventDefault();
  50 + var form = $(this);
  51 + var isValid = true;
  52 +
  53 + form.find('.error-block').remove();
  54 + form.find('input').removeClass('border-red');
  55 +
  56 + var name = form.find('[name="name"]').val().trim();
  57 + if (!name) {
  58 + form.find('[name="name"]').addClass('border-red');
  59 + isValid = false;
  60 + }
  61 +
  62 + var endDate = form.find('[name="end_begin"]').val().trim();
  63 + var dateFormatRegex = /^\d{2}\.\d{2}\.\d{4}$/;
  64 + if (!endDate) {
  65 + form.find('[name="end_begin"]').addClass('border-red');
  66 + form.find('[name="end_begin"]').after('<span class="error-block">Поле "Действия сертификата до" обязательно для заполнения.</span>');
  67 + isValid = false;
  68 + } else if (!dateFormatRegex.test(endDate)) {
  69 + form.find('[name="end_begin"]').addClass('border-red');
  70 + form.find('[name="end_begin"]').after('<span class="error-block">Неверный формат даты (дд.мм.гггг).</span>');
  71 + isValid = false;
  72 + }
  73 +
  74 + if (isValid) {
  75 + form.off('submit').submit();
  76 + }
  77 + });
  78 +
  79 + </script>
  80 +@endsection