Commit 15f704551e57f2b64fb9f790acbef6fd75f5cfa1
1 parent
288dd2a041
Exists in
master
employer personal cabinet new fixes
Showing 5 changed files with 33 additions and 17 deletions Side-by-side Diff
app/Http/Controllers/EmployerController.php
... | ... | @@ -390,14 +390,9 @@ class EmployerController extends Controller |
390 | 390 | $chat_id = $request->get('id'); |
391 | 391 | $is_fixed = $request->get('is_fixed'); |
392 | 392 | |
393 | - $new_state = Chat::pin_chat($chat_id, $is_fixed); | |
394 | - | |
395 | - if ($new_state !== null) { | |
396 | - $message = $new_state ? 'Сообщение закреплено' : 'Сообщение откреплено'; | |
397 | - return redirect()->back()->with('success', $message); | |
398 | - } | |
399 | - | |
400 | - return redirect()->back()->withErrors(['message' => 'Ошибка: сообщение не удалось обновить.']); | |
393 | + $chat = Chat::pin_chat($chat_id, $is_fixed); | |
394 | + $message = $chat->is_fixed ? 'Сообщение закреплено' : 'Сообщение откреплено'; | |
395 | + return redirect()->back()->with('success', $message); | |
401 | 396 | } |
402 | 397 | |
403 | 398 | public function remove_chat(Request $request){ |
app/Models/Chat.php
... | ... | @@ -49,12 +49,12 @@ class Chat extends Model |
49 | 49 | |
50 | 50 | public static function pin_chat(int $chat_id, $fixed) |
51 | 51 | { |
52 | - | |
53 | - return self::where('id', '=', $chat_id) | |
54 | - ->update([ | |
52 | + $chat = self::query()->find($chat_id); | |
53 | + $chat->update([ | |
55 | 54 | 'is_fixed' => !empty($fixed) ? 1 : 0, |
56 | 55 | 'fixation_date' => !empty($fixed) ? Carbon::now() : null |
57 | 56 | ]); |
57 | + return $chat; | |
58 | 58 | } |
59 | 59 | |
60 | 60 | public static function remove_chat(int $chat_id) |
resources/views/employers/bd.blade.php
... | ... | @@ -148,6 +148,7 @@ |
148 | 148 | <table> |
149 | 149 | <thead> |
150 | 150 | <tr> |
151 | + <th></th> | |
151 | 152 | <th>ФИО соискателя</th> |
152 | 153 | <th>Должность</th> |
153 | 154 | <th>Наличие<br>анкеты</th> |
... | ... | @@ -163,6 +164,10 @@ |
163 | 164 | @foreach ($users as $key => $it) |
164 | 165 | @php $worker = !empty($it->workers[0]) ? $it->workers[0] : ''; @endphp |
165 | 166 | <tr> |
167 | + <td style="max-width: 40px; min-width: 30px; font-size: 1.5rem"> | |
168 | + {{ $it->workers[0]->comment }} | |
169 | + </td> | |
170 | + | |
166 | 171 | <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td> |
167 | 172 | |
168 | 173 | <td> |
resources/views/employers/edit_vacancy.blade.php
... | ... | @@ -154,9 +154,9 @@ |
154 | 154 | <div class="form-group__item"> |
155 | 155 | <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea> |
156 | 156 | @error('text') |
157 | - <span class="text-xs text-red-600"> | |
158 | - {{ $message }} | |
159 | - </span> | |
157 | + <span class="text-xs text-red-600"> | |
158 | + {{ $message }} | |
159 | + </span> | |
160 | 160 | @enderror |
161 | 161 | </div> |
162 | 162 | </div> |
... | ... | @@ -172,7 +172,23 @@ |
172 | 172 | </div> |
173 | 173 | <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> |
174 | 174 | <script> |
175 | - CKEDITOR.replace('text'); | |
175 | + CKEDITOR.replace('text', { | |
176 | + allowedContent: true, | |
177 | + extraAllowedContent: 'p br strong em u ul ol li span;*{*}', | |
178 | + | |
179 | + on: { | |
180 | + paste: function (event) { | |
181 | + let data = event.data.dataValue; | |
182 | + data = data.replace(/<br\s*\/?>\s*<br\s*\/?>/g, '<br>'); | |
183 | + event.data.dataValue = data.trim(); | |
184 | + } | |
185 | + }, | |
186 | + | |
187 | + contentsCss: [ | |
188 | + CKEDITOR.basePath + 'contents.css', | |
189 | + '/css/custom-ckeditor.css' | |
190 | + ] | |
191 | + }); | |
176 | 192 | //CKEDITOR.replace( 'text', { |
177 | 193 | // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", |
178 | 194 | // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", |
resources/views/employers/list_vacancy.blade.php
... | ... | @@ -158,13 +158,13 @@ |
158 | 158 | @if ($it->active_is) |
159 | 159 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" title="Скрыть вакансию" class="table__controls-item"> |
160 | 160 | <svg preserveAspectRatio="xMidYMid meet"> |
161 | - <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> | |
161 | + <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> | |
162 | 162 | </svg> |
163 | 163 | </a> |
164 | 164 | @else |
165 | 165 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" title="Показать вакансию" class="table__controls-item"> |
166 | 166 | <svg preserveAspectRatio="xMidYMid meet"> |
167 | - <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> | |
167 | + <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> | |
168 | 168 | </svg> |
169 | 169 | </a> |
170 | 170 | @endif |