Commit b504585f88d550163814844547192e5dac4d7b80

Authored by Андрей Ларионов
1 parent 46bf23a74a

Коммит - баг с удаленными пользователями

Showing 2 changed files with 43 additions and 29 deletions Inline Diff

resources/views/employers/messages.blade.php
1 @extends('layout.frontend', ['title' => 'Сообщения от пользователей - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Сообщения от пользователей - РекаМоре'])
2 @section('scripts') 2 @section('scripts')
3 <script> 3 <script>
4 console.log('Test system'); 4 console.log('Test system');
5 $(document).on('change', '#sort_ajax', function() { 5 $(document).on('change', '#sort_ajax', function() {
6 var this_ = $(this); 6 var this_ = $(this);
7 var val_ = this_.val(); 7 var val_ = this_.val();
8 console.log('sort items '+val_); 8 console.log('sort items '+val_);
9 9
10 $.ajax({ 10 $.ajax({
11 type: "GET", 11 type: "GET",
12 url: "{{ route('shipping_companies') }}", 12 url: "{{ route('shipping_companies') }}",
13 data: "sort="+val_+"&block=1", 13 data: "sort="+val_+"&block=1",
14 success: function (data) { 14 success: function (data) {
15 console.log('Выбор сортировки'); 15 console.log('Выбор сортировки');
16 console.log(data); 16 console.log(data);
17 $('#block_1').html(data); 17 $('#block_1').html(data);
18 }, 18 },
19 headers: { 19 headers: {
20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
21 }, 21 },
22 error: function (data) { 22 error: function (data) {
23 data = JSON.stringify(data); 23 data = JSON.stringify(data);
24 console.log('Error: ' + data); 24 console.log('Error: ' + data);
25 } 25 }
26 }); 26 });
27 27
28 $.ajax({ 28 $.ajax({
29 type: "GET", 29 type: "GET",
30 url: "{{ route('shipping_companies') }}", 30 url: "{{ route('shipping_companies') }}",
31 data: "sort="+val_+"&block=2", 31 data: "sort="+val_+"&block=2",
32 success: function (data) { 32 success: function (data) {
33 console.log('Выбор сортировки2'); 33 console.log('Выбор сортировки2');
34 console.log(data); 34 console.log(data);
35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
36 $('#block_2').html(data); 36 $('#block_2').html(data);
37 }, 37 },
38 headers: { 38 headers: {
39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
40 }, 40 },
41 error: function (data) { 41 error: function (data) {
42 data = JSON.stringify(data); 42 data = JSON.stringify(data);
43 console.log('Error: ' + data); 43 console.log('Error: ' + data);
44 } 44 }
45 }); 45 });
46 }); 46 });
47 </script> 47 </script>
48 @endsection 48 @endsection
49 49
50 @section('content') 50 @section('content')
51 <section class="cabinet"> 51 <section class="cabinet">
52 <div class="container"> 52 <div class="container">
53 <ul class="breadcrumbs cabinet__breadcrumbs"> 53 <ul class="breadcrumbs cabinet__breadcrumbs">
54 <li><a href="{{ route('index') }}">Главная</a></li> 54 <li><a href="{{ route('index') }}">Главная</a></li>
55 <li><b>Личный кабинет</b></li> 55 <li><b>Личный кабинет</b></li>
56 </ul> 56 </ul>
57 <div class="cabinet__wrapper"> 57 <div class="cabinet__wrapper">
58 <div class="cabinet__side"> 58 <div class="cabinet__side">
59 <div class="cabinet__side-toper"> 59 <div class="cabinet__side-toper">
60 @include('employers.emblema') 60 @include('employers.emblema')
61 </div> 61 </div>
62 62
63 63
64 @include('employers.menu', ['item' => 5]) 64 @include('employers.menu', ['item' => 5])
65 </div> 65 </div>
66 66
67 <div class="cabinet__body"> 67 <div class="cabinet__body">
68 <div class="cabinet__body-item"> 68 <div class="cabinet__body-item">
69 <h2 class="title cabinet__title">Сообщения</h2> 69 <h2 class="title cabinet__title">Сообщения</h2>
70 </div> 70 </div>
71 <div class="cabinet__body-item"> 71 <div class="cabinet__body-item">
72 <div class="cabinet__filters"> 72 <div class="cabinet__filters">
73 <div class="cabinet__filters-item"> 73 <div class="cabinet__filters-item">
74 <div class="cabinet__filters-buttons"> 74 <div class="cabinet__filters-buttons">
75 <a href="{{ route('employer.messages', ['type_message' => 'input']) }}" class="button button_light @if ($type_message == 'input') active @endif">Входящие ({{ $count_input }})</a> 75 <a href="{{ route('employer.messages', ['type_message' => 'input']) }}" class="button button_light @if ($type_message == 'input') active @endif">Входящие ({{ $count_input }})</a>
76 <a href="{{ route('employer.messages', ['type_message' => 'output']) }}" class="button button_light @if ($type_message == 'output') active @endif">Исходящие ({{ $count_output }})</a> 76 <a href="{{ route('employer.messages', ['type_message' => 'output']) }}" class="button button_light @if ($type_message == 'output') active @endif">Исходящие ({{ $count_output }})</a>
77 </div> 77 </div>
78 </div> 78 </div>
79 <!--<div class="cabinet__filters-item"> 79 <!--<div class="cabinet__filters-item">
80 <div class="select"> 80 <div class="select">
81 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 81 <select class="js-select2" id="sort_ajax" name="sort_ajax">
82 <option value="default">Сортировка (по умолчанию)</option> 82 <option value="default">Сортировка (по умолчанию)</option>
83 <option value="name (asc)">По имени (возрастание)</option> 83 <option value="name (asc)">По имени (возрастание)</option>
84 <option value="name (desc)">По имени (убывание)</option> 84 <option value="name (desc)">По имени (убывание)</option>
85 <option value="created_at (asc)">По дате (возрастание)</option> 85 <option value="created_at (asc)">По дате (возрастание)</option>
86 <option value="created_at (desc)">По дате (убывание)</option> 86 <option value="created_at (desc)">По дате (убывание)</option>
87 </select> 87 </select>
88 </div> 88 </div>
89 </div>--> 89 </div>-->
90 </div> 90 </div>
91 <div class="messages"> 91 <div class="messages">
92 <!--<button type="button" class="messages__button js-toggle js-parent-toggle button button_light button_more"> 92 <!--<button type="button" class="messages__button js-toggle js-parent-toggle button button_light button_more">
93 <span>Показать ещё</span> 93 <span>Показать ещё</span>
94 <span>Скрыть</span> 94 <span>Скрыть</span>
95 </button>--> 95 </button>-->
96 <div class="messages__body"> 96 <div class="messages__body">
97 @if ($messages->count()) 97 @if ($messages->count())
98 @foreach($messages as $it) 98 @foreach($messages as $it)
99 <div class="messages__item"> 99 <div class="messages__item">
100 <div class="messages__item-info"> 100 <div class="messages__item-info">
101 <div class="messages__item-photo"> 101 <div class="messages__item-photo">
102 <svg> 102 <svg>
103 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 103 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
104 </svg> 104 </svg>
105
106
107 @if ($type_message == 'input') 105 @if ($type_message == 'input')
106 @if (isset($it->user_from->is_worker))
108 @if ($it->user_from->is_worker) 107 @if ($it->user_from->is_worker)
109 @if (isset($it->user_from->workers[0]->photo)) 108 @if (isset($it->user_from->workers[0]->photo))
110 <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> 109 <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt="">
111 @else 110 @else
112 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 111 <img src="{{ asset('images/default_man.jpg') }}" alt="">
113 @endif 112 @endif
114 @else 113 @else
115 @if (isset($it->user_from->employers[0]->logo)) 114 @if (isset($it->user_from->employers[0]->logo))
116 <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt=""> 115 <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt="">
117 @else 116 @else
118 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 117 <img src="{{ asset('images/default_man.jpg') }}" alt="">
119 @endif 118 @endif
120 @endif 119 @endif
120 @else
121 <img src="{{ asset('images/default_man.jpg') }}" alt="">
122 @endif
121 @endif 123 @endif
122 124
123 @if ($type_message == 'output') 125 @if ($type_message == 'output')
124 @if ($it->user_from->is_worker) 126 @if (isset($it->user_from->is_worker))
125 @if (isset($it->user_from->workers[0]->photo)) 127 @if ($it->user_from->is_worker)
126 <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> 128 @if (isset($it->user_from->workers[0]->photo))
129 <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt="">
130 @else
131 <img src="{{ asset('images/default_man.jpg') }}" alt="">
132 @endif
127 @else 133 @else
128 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 134 @if (isset($it->user_from->employers[0]->logo))
135 <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt="">
136 @else
137 <img src="{{ asset('images/default_man.jpg') }}" alt="">
138 @endif
129 @endif 139 @endif
130 @else 140 @else
131 @if (isset($it->user_from->employers[0]->logo)) 141 <img src="{{ asset('images/default_man.jpg') }}" alt="">
132 <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt="">
133 @else
134 <img src="{{ asset('images/default_man.jpg') }}" alt="">
135 @endif
136 @endif 142 @endif
137 @endif 143 @endif
138 </div> 144 </div>
139 <div class="messages__item-text"> 145 <div class="messages__item-text">
140 <div> 146 <div>
141 От: @if (isset($it->user_from)) 147 От: @if (isset($it->user_from))
142 @if ($it->user_from->id !== $user_id) 148 @if ($it->user_from->id !== $user_id)
143 <!--<a href=" route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline">--> 149 <!--<a href=" route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline">-->
144 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} 150 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }}
145 <!--</a>--> 151 <!--</a>-->
146 @else 152 @else
147 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} 153 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }}
148 @endif 154 @endif
149 @else 155 @else
150 Удаленный пользователь 156 Удаленный пользователь
151 @endif 157 @endif
152 <br> 158 <br>
153 К: @if (isset($it->user_to)) 159 К: @if (isset($it->user_to))
154 @if ($it->user_to->id !== $user_id) 160 @if ($it->user_to->id !== $user_id)
155 <!--<a href=" route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline">--> 161 <!--<a href=" route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline">-->
156 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} 162 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }}
157 <!--</a>--> 163 <!--</a>-->
158 @else 164 @else
159 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} 165 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }}
160 @endif 166 @endif
161 @else 167 @else
162 Удаленный пользователь 168 Удаленный пользователь
163 @endif 169 @endif
164 </div> 170 </div>
165 <div> 171 <div>
166 <span>Вакансия: </span> 172 <span>Вакансия: </span>
167 @if (isset($it->user_from)) 173 @if (isset($it->user_from))
168 @if ($it->user_from->id !== $user_id) 174 @if ($it->user_from->id !== $user_id)
169 @if (isset($it->vacancies)) 175 @if (isset($it->vacancies))
170 <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id, 'ad_employer' => $it->vacancies->id, 'ad_name' => $it->vacancies->name ]) }}" style="text-decoration: underline"> 176 <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id, 'ad_employer' => $it->vacancies->id, 'ad_name' => $it->vacancies->name ]) }}" style="text-decoration: underline">
171 {{ $it->vacancies->name." (".($it->vacancies->id).")" }} 177 {{ $it->vacancies->name." (".($it->vacancies->id).")" }}
172 </a> 178 </a>
173 @else 179 @else
174 <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id, 'ad_employer' => 0, 'ad_name' => 'Не указана вакансия' ]) }}" style="text-decoration: underline"> 180 <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id, 'ad_employer' => 0, 'ad_name' => 'Не указана вакансия' ]) }}" style="text-decoration: underline">
175 Вакансия не указана 181 Вакансия не указана
176 </a> 182 </a>
177 @endif 183 @endif
178 @else 184 @else
179 185
180 @endif 186 @endif
181 @endif 187 @endif
182 188
183 @if (isset($it->user_to)) 189 @if (isset($it->user_to))
184 @if ($it->user_to->id !== $user_id) 190 @if ($it->user_to->id !== $user_id)
185 @if (isset($it->vacancies)) 191 @if (isset($it->vacancies))
186 <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id, 'ad_employer' => $it->vacancies->id, 'ad_name' => $it->vacancies->name ]) }}" style="text-decoration: underline"> 192 <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id, 'ad_employer' => $it->vacancies->id, 'ad_name' => $it->vacancies->name ]) }}" style="text-decoration: underline">
187 {{ $it->vacancies->name." (".($it->vacancies->id).")" }} 193 {{ $it->vacancies->name." (".($it->vacancies->id).")" }}
188 </a> 194 </a>
189 @else 195 @else
190 <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id, 'ad_employer' => 0, 'ad_name' => 'Не указана вакансия' ]) }}" style="text-decoration: underline"> 196 <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id, 'ad_employer' => 0, 'ad_name' => 'Не указана вакансия' ]) }}" style="text-decoration: underline">
191 Вакансия не указана 197 Вакансия не указана
192 </a> 198 </a>
193 @endif 199 @endif
194 @else 200 @else
195 201
196 @endif 202 @endif
197 @endif 203 @endif
198 204
199 </div> 205 </div>
200 <div><span>Текст:</span>{{ $it->text }}</div> 206 <div><span>Текст:</span>{{ $it->text }}</div>
201 </div> 207 </div>
202 </div> 208 </div>
203 209
204 <div class="messages__item-date">{{ $it->created_at }}</div> 210 <div class="messages__item-date">{{ $it->created_at }}</div>
205 </div> 211 </div>
206 @endforeach 212 @endforeach
207 <div style="margin-top: 20px"> 213 <div style="margin-top: 20px">
208 {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }} 214 {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }}
209 </div><!-- конец --> 215 </div><!-- конец -->
210 @else 216 @else
211 <div class="notify"> 217 <div class="notify">
212 <svg> 218 <svg>
213 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 219 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
214 </svg> 220 </svg>
215 <span>Сообщений не найдено</span> 221 <span>Сообщений не найдено</span>
216 </div> 222 </div>
217 @endif 223 @endif
218 </div> 224 </div>
219 </div> 225 </div>
220 </div> 226 </div>
221 </div> 227 </div>
resources/views/workers/messages.blade.php
1 @extends('layout.frontend', ['title' => 'Мои сообщения - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Мои сообщения - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 4
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 <section class="cabinet"> 8 <section class="cabinet">
9 <div class="container"> 9 <div class="container">
10 <ul class="breadcrumbs cabinet__breadcrumbs"> 10 <ul class="breadcrumbs cabinet__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>Личный кабинет</b></li> 12 <li><b>Личный кабинет</b></li>
13 </ul> 13 </ul>
14 <div class="cabinet__wrapper"> 14 <div class="cabinet__wrapper">
15 <div class="cabinet__side"> 15 <div class="cabinet__side">
16 <div class="cabinet__side-toper"> 16 <div class="cabinet__side-toper">
17 @include('workers.emblema') 17 @include('workers.emblema')
18 18
19 </div> 19 </div>
20 20
21 @include('workers.menu', ['item' => 2]) 21 @include('workers.menu', ['item' => 2])
22 </div> 22 </div>
23 <div class="cabinet__body"> 23 <div class="cabinet__body">
24 <div class="cabinet__body-item"> 24 <div class="cabinet__body-item">
25 <h2 class="title cabinet__title">Сообщения</h2> 25 <h2 class="title cabinet__title">Сообщения</h2>
26 </div> 26 </div>
27 <div class="cabinet__body-item"> 27 <div class="cabinet__body-item">
28 <div class="cabinet__filters"> 28 <div class="cabinet__filters">
29 <div class="cabinet__filters-item"> 29 <div class="cabinet__filters-item">
30 <div class="cabinet__filters-buttons"> 30 <div class="cabinet__filters-buttons">
31 <a href="{{ route('worker.messages', ['type_message' => 'input']) }}" class="button button_light @if ($type_message == 'input') active @endif">Входящие ({{ $count_input }})</a> 31 <a href="{{ route('worker.messages', ['type_message' => 'input']) }}" class="button button_light @if ($type_message == 'input') active @endif">Входящие ({{ $count_input }})</a>
32 <a href="{{ route('worker.messages', ['type_message' => 'output']) }}" class="button button_light @if ($type_message == 'output') active @endif">Исходящие ({{ $count_output }})</a> 32 <a href="{{ route('worker.messages', ['type_message' => 'output']) }}" class="button button_light @if ($type_message == 'output') active @endif">Исходящие ({{ $count_output }})</a>
33 </div> 33 </div>
34 </div> 34 </div>
35 <!--<div class="cabinet__filters-item"> 35 <!--<div class="cabinet__filters-item">
36 <div class="select"> 36 <div class="select">
37 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 37 <select class="js-select2" id="sort_ajax" name="sort_ajax">
38 <option value="default">Сортировка (по умолчанию)</option> 38 <option value="default">Сортировка (по умолчанию)</option>
39 <option value="name (asc)">По имени (возрастание)</option> 39 <option value="name (asc)">По имени (возрастание)</option>
40 <option value="name (desc)">По имени (убывание)</option> 40 <option value="name (desc)">По имени (убывание)</option>
41 <option value="created_at (asc)">По дате (возрастание)</option> 41 <option value="created_at (asc)">По дате (возрастание)</option>
42 <option value="created_at (desc)">По дате (убывание)</option> 42 <option value="created_at (desc)">По дате (убывание)</option>
43 </select> 43 </select>
44 </div> 44 </div>
45 </div>--> 45 </div>-->
46 </div> 46 </div>
47 @if ($messages->count()) 47 @if ($messages->count())
48 @foreach($messages as $it) 48 @foreach($messages as $it)
49 <div class="messages__item"> 49 <div class="messages__item">
50 <div class="messages__item-info"> 50 <div class="messages__item-info">
51 <!--<pre> print_r(asset(Storage::url($it->user_from->employers[0]->logo))) }}</pre>--> 51 <!--<pre> print_r(asset(Storage::url($it->user_from->employers[0]->logo))) }}</pre>-->
52 <div class="messages__item-photo"> 52 <div class="messages__item-photo">
53 <svg> 53 <svg>
54 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 54 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
55 </svg> 55 </svg>
56 <!-- Комментарий: обновление структуры вывода картинок, все корректное --> 56 <!-- Комментарий: обновление структуры вывода картинок, все корректное -->
57 @if ($type_message == 'input') 57 @if ($type_message == 'input')
58 @if ($it->user_from->is_worker) 58 @if (isset($it->user_from->is_worker))
59 @if (isset($it->user_from->workers[0]->photo)) 59 @if ($it->user_from->is_worker)
60 <img src="{{ asset(Storage::url($it->user_to->workers[0]->photo)) }}" alt=""> 60 @if (isset($it->user_from->workers[0]->photo))
61 <img src="{{ asset(Storage::url($it->user_to->workers[0]->photo)) }}" alt="">
62 @else
63 <img src="{{ asset('images/default_man.jpg') }}" alt="">
64 @endif
61 @else 65 @else
62 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 66 @if (isset($it->user_from->employers[0]->logo))
67 <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt="">
68 @else
69 <img src=" asset('images/default_man.jpg') }}" alt="">
70 @endif
63 @endif 71 @endif
64 @else 72 @else
65 @if (isset($it->user_from->employers[0]->logo)) 73 <img src=" asset('images/default_man.jpg') }}" alt="">
66 <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt="">
67 @else
68 <img src=" asset('images/default_man.jpg') }}" alt="">
69 @endif
70 @endif 74 @endif
71 @endif 75 @endif
72 76
73 <!-- Обновление исходящих сообщений - фотографии компании и работника --> 77 <!-- Обновление исходящих сообщений - фотографии компании и работника -->
74 <!-- коммит 2 --> 78 <!-- коммит 2 -->
75 @if ($type_message == 'output') 79 @if ($type_message == 'output')
76 @if ($it->user_from->is_worker) 80 @if (isset($it->user_from->is_worker))
77 @if (isset($it->user_from->workers[0]->photo)) 81 @if ($it->user_from->is_worker)
78 <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> 82 @if (isset($it->user_from->workers[0]->photo))
83 <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt="">
84 @else
85 <img src="{{ asset('images/default_man.jpg') }}" alt="">
86 @endif
79 @else 87 @else
80 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 88 @if (isset($it->user_from->employers->logo))
89 <img src="{{ asset(Storage::url($it->user_from->employers->logo)) }}" alt="">
90 @else
91 <img src="{{ asset('images/default_man.jpg') }}" alt="">
92 @endif
81 @endif 93 @endif
82 @else 94 @else
83 @if (isset($it->user_from->employers->logo)) 95 <img src="{{ asset('images/default_man.jpg') }}" alt="">
84 <img src="{{ asset(Storage::url($it->user_from->employers->logo)) }}" alt="">
85 @else
86 <img src="{{ asset('images/default_man.jpg') }}" alt="">
87 @endif
88 @endif 96 @endif
89 @endif 97 @endif
90 </div> 98 </div>
91 <div class="messages__item-text"> 99 <div class="messages__item-text">
92 <div> 100 <div>
93 От: @if (isset($it->user_from)) 101 От: @if (isset($it->user_from))
94 @if ($it->user_from->id !== $user_id) 102 @if ($it->user_from->id !== $user_id)
95 <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline"> 103 <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline">
96 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} 104 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }}
97 </a> 105 </a>
98 @else 106 @else
99 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} 107 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }}
100 @endif 108 @endif
101 @else 109 @else
102 Удаленный пользователь 110 Удаленный пользователь
103 @endif 111 @endif
104 <br> 112 <br>
105 К: @if (isset($it->user_to)) 113 К: @if (isset($it->user_to))
106 @if ($it->user_to->id !== $user_id) 114 @if ($it->user_to->id !== $user_id)
107 <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline"> 115 <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline">
108 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} 116 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }}
109 </a> 117 </a>
110 @else 118 @else
111 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} 119 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }}
112 @endif 120 @endif
113 @else 121 @else
114 Удаленный пользователь 122 Удаленный пользователь
115 @endif 123 @endif
116 </div> 124 </div>
117 <div><span>Вакансия:</span>@if (isset($it->vacancies)) {{ $it->vacancies->name." (".($it->vacancies->id).")" }} @else Удалена @endif</div> 125 <div><span>Вакансия:</span>@if (isset($it->vacancies)) {{ $it->vacancies->name." (".($it->vacancies->id).")" }} @else Удалена @endif</div>
118 <div><span>Текст:</span>{{ $it->text }}</div> 126 <div><span>Текст:</span>{{ $it->text }}</div>
119 </div> 127 </div>
120 </div> 128 </div>
121 <div class="messages__item-date">{{ $it->created_at }}</div> 129 <div class="messages__item-date">{{ $it->created_at }}</div>
122 </div> 130 </div>
123 @endforeach 131 @endforeach
124 132
125 <div style="margin-top: 20px"> 133 <div style="margin-top: 20px">
126 {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }} 134 {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }}
127 </div><!-- конец --> 135 </div><!-- конец -->
128 136
129 @else 137 @else
130 <div class="notify"> 138 <div class="notify">
131 <svg> 139 <svg>
132 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 140 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
133 </svg> 141 </svg>
134 <span>Сообщений не найдено</span> 142 <span>Сообщений не найдено</span>
135 </div> 143 </div>
136 @endif 144 @endif
137 </div> 145 </div>