Commit 50aa60b60198862c3ce6c7c326505854a695f38c
1 parent
7c268179ef
Exists in
master
and in
1 other branch
Работодатели лого, комментарий
Showing 5 changed files with 48 additions and 4 deletions Side-by-side Diff
app/Http/Controllers/Admin/EmployersController.php
... | ... | @@ -60,6 +60,10 @@ class EmployersController extends Controller |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | + public function comment_read(Employer $employer) { | |
64 | + return view('admin.employer.comment', compact('employer')); | |
65 | + } | |
66 | + | |
63 | 67 | public function form_update_employer(Employer $employer) { |
64 | 68 | $select_category = CategoryEmp::query()->active()->get(); |
65 | 69 | return view('admin.employer.edit', compact('employer', 'select_category')); |
resources/views/admin/employer/comment.blade.php
... | ... | @@ -0,0 +1,29 @@ |
1 | +@extends('layout.admin', ['title' => 'Админка - Редактирование работодателя']) | |
2 | + | |
3 | +@section('content') | |
4 | + <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> | |
5 | + Работодатель-пользователь: "{{$employer->users->name_man}} ({{$employer->user_id}})" | |
6 | + </h4> | |
7 | + <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | |
8 | + <label class="block mt-4 text-sm"> | |
9 | + <span class="text-gray-700 dark:text-gray-400">Комментарий админа</span> | |
10 | + <textarea name="comment_admin" id="comment_admin" | |
11 | + class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | |
12 | + rows="3" | |
13 | + placeholder="Комментарий админа" | |
14 | + >{{ $employer->comment_admin }}</textarea> | |
15 | + </label> | |
16 | + | |
17 | + <br> | |
18 | + <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | |
19 | + <div> | |
20 | + | |
21 | + <a href="{{ route('admin.employers') }}" | |
22 | + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
23 | + style="display: -webkit-inline-box; height: 30px!important;" | |
24 | + >Назад</a> | |
25 | + | |
26 | + </div> | |
27 | + </div> | |
28 | + </div> | |
29 | +@endsection |
resources/views/admin/employer/edit.blade.php
... | ... | @@ -31,15 +31,15 @@ |
31 | 31 | |
32 | 32 | <label class="block text-sm"> |
33 | 33 | <span class="text-gray-700 dark:text-gray-400">Email</span> |
34 | - <input name="email" id="email" disabled | |
34 | + <input name="email" id="email" | |
35 | 35 | 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" |
36 | 36 | placeholder="Почта" value="{{ old('email') ?? $employer->email ?? '' }}" |
37 | 37 | /> |
38 | 38 | @error('email') |
39 | 39 | <span class="text-xs text-red-600 dark:text-red-400"> |
40 | 40 | {{ $message }} |
41 | - </span> | |
42 | - @enderror | |
41 | + </span> | |
42 | + @enderror | |
43 | 43 | </label><br> |
44 | 44 | |
45 | 45 | <label class="block text-sm"> |
resources/views/admin/employer/index.blade.php
... | ... | @@ -94,6 +94,7 @@ |
94 | 94 | > |
95 | 95 | <th class="px-4 py-3">№</th> |
96 | 96 | <th class="px-4 py-3">Название компании</th> |
97 | + <th class="px-4 py-3">Лого</th> | |
97 | 98 | <th class="px-4 py-3">Email/Телефон</th> |
98 | 99 | <th class="px-4 py-3">Категория</th> |
99 | 100 | <th class="px-4 py-3">Комментарий</th> |
... | ... | @@ -111,6 +112,13 @@ |
111 | 112 | {{$user->name}} |
112 | 113 | </td> |
113 | 114 | <td class="px-4 py-3"> |
115 | + @if (isset($user->employers[0]->logo) && ($user->employers[0]->logo)) | |
116 | + <img src="{{ asset(Storage::url($user->employers[0]->logo)) }}" style="width:50px"/> | |
117 | + @else | |
118 | + - | |
119 | + @endif | |
120 | + </td> | |
121 | + <td class="px-4 py-3"> | |
114 | 122 | <div class="flex items-center text-sm"> |
115 | 123 | <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> |
116 | 124 | <div |
... | ... | @@ -132,7 +140,8 @@ |
132 | 140 | </td> |
133 | 141 | <td class="px-4 py-3 text-sm"> |
134 | 142 | @if (!empty($user->comment_admin)) |
135 | - Есть | |
143 | + | |
144 | + <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->id]) }}">Есть</a> | |
136 | 145 | @else |
137 | 146 | Нет |
138 | 147 | @endif |
routes/web.php
... | ... | @@ -185,6 +185,8 @@ Route::group([ |
185 | 185 | // кабинет - работодатели |
186 | 186 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
187 | 187 | |
188 | + Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); | |
189 | + | |
188 | 190 | // кабинет - соискатели |
189 | 191 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
190 | 192 |