Commit 50eb849a5f559c3dfbbd990151b7897d3ec50e39
Exists in
master
Работа на сервере - сообщения
Showing 2 changed files 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') |
108 | @if ($it->user_from->is_worker) | 106 | |
109 | @if (isset($it->user_from->workers[0]->photo)) | 107 | @if (isset($it->user_from->is_worker)) |
110 | <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> | 108 | @if ($it->user_from->is_worker) |
111 | @else | 109 | @if (isset($it->user_from->workers[0]->photo)) |
112 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | ||
113 | @endif | 110 | <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> |
114 | @else | 111 | @else |
115 | @if (isset($it->user_from->employers[0]->logo)) | 112 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
116 | <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt=""> | 113 | @endif |
117 | @else | 114 | @else |
118 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 115 | @if (isset($it->user_from->employers[0]->logo)) |
119 | @endif | 116 | <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt=""> |
120 | @endif | 117 | @else |
121 | @endif | 118 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
122 | 119 | @endif | |
120 | @endif | ||
121 | @else | ||
122 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | ||
123 | @if ($type_message == 'output') | 123 | @endif |
124 | @if ($it->user_from->is_worker) | 124 | @endif |
125 | @if (isset($it->user_from->workers[0]->photo)) | 125 | |
126 | <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> | 126 | @if ($type_message == 'output') |
127 | @else | 127 | @if (isset($it->user_from->is_worker)) |
128 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 128 | @if ($it->user_from->is_worker) |
129 | @if (isset($it->user_from->workers[0]->photo)) | ||
130 | <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> | ||
131 | @else | ||
132 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | ||
129 | @endif | 133 | @endif |
130 | @else | 134 | @else |
135 | @if (isset($it->user_from->employers[0]->logo)) | ||
136 | <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt=""> | ||
137 | @else | ||
138 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | ||
131 | @if (isset($it->user_from->employers[0]->logo)) | 139 | @endif |
132 | <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt=""> | 140 | @endif |
133 | @else | 141 | @else |
134 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | ||
135 | @endif | ||
136 | @endif | ||
137 | @endif | ||
138 | </div> | 142 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
139 | <div class="messages__item-text"> | 143 | @endif |
140 | <div> | 144 | @endif |
141 | От: @if (isset($it->user_from)) | 145 | </div> |
142 | @if ($it->user_from->id !== $user_id) | 146 | <div class="messages__item-text"> |
143 | <!--<a href=" route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline">--> | 147 | <div> |
144 | {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} | 148 | От: @if (isset($it->user_from)) |
145 | <!--</a>--> | 149 | @if ($it->user_from->id !== $user_id) |
146 | @else | 150 | <!--<a href=" route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline">--> |
147 | {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} | 151 | {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} |
148 | @endif | 152 | <!--</a>--> |
149 | @else | 153 | @else |
150 | Удаленный пользователь | 154 | {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} |
151 | @endif | 155 | @endif |
152 | <br> | 156 | @else |
153 | К: @if (isset($it->user_to)) | 157 | Удаленный пользователь |
154 | @if ($it->user_to->id !== $user_id) | 158 | @endif |
155 | <!--<a href=" route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline">--> | 159 | <br> |
156 | {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} | 160 | К: @if (isset($it->user_to)) |
157 | <!--</a>--> | 161 | @if ($it->user_to->id !== $user_id) |
158 | @else | 162 | <!--<a href=" route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline">--> |
159 | {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} | 163 | {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} |
160 | @endif | 164 | <!--</a>--> |
161 | @else | 165 | @else |
162 | Удаленный пользователь | 166 | {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} |
163 | @endif | 167 | @endif |
164 | </div> | 168 | @else |
165 | <div> | 169 | Удаленный пользователь |
166 | <span>Вакансия: </span> | 170 | @endif |
167 | @if (isset($it->user_from)) | 171 | </div> |
168 | @if ($it->user_from->id !== $user_id) | 172 | <div> |
169 | @if (isset($it->vacancies)) | 173 | <span>Вакансия: </span> |
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"> | 174 | @if (isset($it->user_from)) |
171 | {{ $it->vacancies->name." (".($it->vacancies->id).")" }} | 175 | @if ($it->user_from->id !== $user_id) |
172 | </a> | 176 | @if (isset($it->vacancies)) |
173 | @else | 177 | <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"> |
174 | <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id, 'ad_employer' => 0, 'ad_name' => 'Не указана вакансия' ]) }}" style="text-decoration: underline"> | 178 | {{ $it->vacancies->name." (".($it->vacancies->id).")" }} |
175 | Вакансия не указана | 179 | </a> |
176 | </a> | 180 | @else |
177 | @endif | 181 | <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id, 'ad_employer' => 0, 'ad_name' => 'Не указана вакансия' ]) }}" style="text-decoration: underline"> |
178 | @else | 182 | Вакансия не указана |
179 | 183 | </a> | |
180 | @endif | 184 | @endif |
181 | @endif | 185 | @else |
182 | 186 | ||
183 | @if (isset($it->user_to)) | 187 | @endif |
184 | @if ($it->user_to->id !== $user_id) | 188 | @endif |
185 | @if (isset($it->vacancies)) | 189 | |
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"> | 190 | @if (isset($it->user_to)) |
187 | {{ $it->vacancies->name." (".($it->vacancies->id).")" }} | 191 | @if ($it->user_to->id !== $user_id) |
188 | </a> | 192 | @if (isset($it->vacancies)) |
189 | @else | 193 | <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"> |
190 | <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id, 'ad_employer' => 0, 'ad_name' => 'Не указана вакансия' ]) }}" style="text-decoration: underline"> | 194 | {{ $it->vacancies->name." (".($it->vacancies->id).")" }} |
191 | Вакансия не указана | 195 | </a> |
192 | </a> | 196 | @else |
193 | @endif | 197 | <a href="{{ route('employer.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id, 'ad_employer' => 0, 'ad_name' => 'Не указана вакансия' ]) }}" style="text-decoration: underline"> |
194 | @else | 198 | Вакансия не указана |
195 | 199 | </a> | |
196 | @endif | 200 | @endif |
197 | @endif | 201 | @else |
198 | 202 | ||
199 | </div> | 203 | @endif |
200 | <div><span>Текст:</span>{{ $it->text }}</div> | 204 | @endif |
201 | </div> | 205 | |
202 | </div> | 206 | </div> |
203 | 207 | <div><span>Текст:</span>{{ $it->text }}</div> | |
204 | <div class="messages__item-date">{{ $it->created_at }}</div> | 208 | </div> |
205 | </div> | 209 | </div> |
206 | @endforeach | 210 | |
207 | <div style="margin-top: 20px"> | 211 | <div class="messages__item-date">{{ $it->created_at }}</div> |
208 | {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }} | 212 | </div> |
209 | </div><!-- конец --> | 213 | @endforeach |
210 | @else | 214 | <div style="margin-top: 20px"> |
211 | <div class="notify"> | 215 | {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }} |
212 | <svg> | 216 | </div><!-- конец --> |
213 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> | 217 | @else |
214 | </svg> | 218 | <div class="notify"> |
215 | <span>Сообщений не найдено</span> | 219 | <svg> |
216 | </div> | 220 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> |
217 | @endif | 221 | </svg> |
218 | </div> | 222 | <span>Сообщений не найдено</span> |
219 | </div> | 223 | </div> |
220 | </div> | 224 | @endif |
221 | </div> | 225 | </div> |
222 | </div> | 226 | </div> |
223 | </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 | <!-- Обновление исходящих сообщений - фотографии компании и работника --> |
78 | <!-- коммит 2 --> | ||
74 | <!-- коммит 2 --> | 79 | @if ($type_message == 'output') |
75 | @if ($type_message == 'output') | 80 | @if (isset($it->user_from->is_worker)) |
76 | @if ($it->user_from->is_worker) | 81 | @if ($it->user_from->is_worker) |
77 | @if (isset($it->user_from->workers[0]->photo)) | 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 | ||
78 | <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> | 87 | @else |
79 | @else | 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 | ||
80 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 93 | @endif |
81 | @endif | 94 | @else |
82 | @else | 95 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
83 | @if (isset($it->user_from->employers->logo)) | ||
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 | 96 | @endif |
88 | @endif | 97 | @endif |
89 | @endif | 98 | </div> |
90 | </div> | 99 | <div class="messages__item-text"> |
91 | <div class="messages__item-text"> | 100 | <div> |
92 | <div> | 101 | От: @if (isset($it->user_from)) |
93 | От: @if (isset($it->user_from)) | 102 | @if ($it->user_from->id !== $user_id) |
94 | @if ($it->user_from->id !== $user_id) | 103 | <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline"> |
95 | <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline"> | 104 | {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} |
96 | {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} | 105 | </a> |
97 | </a> | 106 | @else |
98 | @else | 107 | {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} |
99 | {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} | 108 | @endif |
100 | @endif | 109 | @else |
101 | @else | 110 | Удаленный пользователь |
102 | Удаленный пользователь | 111 | @endif |
103 | @endif | 112 | <br> |
104 | <br> | 113 | К: @if (isset($it->user_to)) |
105 | К: @if (isset($it->user_to)) | 114 | @if ($it->user_to->id !== $user_id) |
106 | @if ($it->user_to->id !== $user_id) | 115 | <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline"> |
107 | <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline"> | 116 | {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} |
108 | {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} | 117 | </a> |
109 | </a> | 118 | @else |
110 | @else | 119 | {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} |
111 | {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} | 120 | @endif |
112 | @endif | 121 | @else |
113 | @else | 122 | Удаленный пользователь |
114 | Удаленный пользователь | 123 | @endif |
115 | @endif | 124 | </div> |
116 | </div> | 125 | <div><span>Вакансия:</span>@if (isset($it->vacancies)) {{ $it->vacancies->name." (".($it->vacancies->id).")" }} @else Удалена @endif</div> |
117 | <div><span>Вакансия:</span>@if (isset($it->vacancies)) {{ $it->vacancies->name." (".($it->vacancies->id).")" }} @else Удалена @endif</div> | 126 | <div><span>Текст:</span>{{ $it->text }}</div> |
118 | <div><span>Текст:</span>{{ $it->text }}</div> | 127 | </div> |
119 | </div> | 128 | </div> |
120 | </div> | 129 | <div class="messages__item-date">{{ $it->created_at }}</div> |
121 | <div class="messages__item-date">{{ $it->created_at }}</div> | 130 | </div> |
122 | </div> | 131 | @endforeach |
123 | @endforeach | 132 | |
124 | 133 | <div style="margin-top: 20px"> | |
125 | <div style="margin-top: 20px"> | 134 | {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }} |
126 | {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }} | 135 | </div><!-- конец --> |
127 | </div><!-- конец --> | 136 | |
128 | 137 | @else | |
129 | @else | 138 | <div class="notify"> |
130 | <div class="notify"> | 139 | <svg> |
131 | <svg> | 140 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> |
132 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> | 141 | </svg> |
133 | </svg> | 142 | <span>Сообщений не найдено</span> |
134 | <span>Сообщений не найдено</span> | 143 | </div> |
135 | </div> | 144 | @endif |
136 | @endif | 145 | </div> |