Blame view
resources/views/chats/chats_list.blade.php
5.14 KB
71329f175 правки |
1 2 |
@if ($chats->count() || $admin_chat) @csrf |
f98ccb92c Массова рассылка |
3 |
|
71329f175 правки |
4 5 6 7 8 9 10 11 12 |
@if($admin_chat) <div class="messages__item hover-shadow admin-chat-wrap"> <a class="messages__item-info" href="{{ route($user_type . '.dialog', ['chat' => $admin_chat->id]) }}"> @include('svg.logo_icon') <div class="messages__item-text"> <div> <b>Администратор сайта</b> </div> <div> |
09a2fc9d8 messages and subs... |
13 |
{{ $admin_chat->last_message?->text }} |
71329f175 правки |
14 |
</div> |
df58eaf86 правки |
15 |
</div> |
71329f175 правки |
16 |
</a> |
4e9bbc666 правки |
17 |
|
71329f175 правки |
18 19 20 |
<div class="messages__item-actions" data-chat-id="{{ $admin_chat->id }}"> <div class="messages__item-date max-content">{{ date(' H:i, d.m.Y', strtotime($admin_chat->created_at)) }}</div> <div class="messages__item-buttons"> |
09a2fc9d8 messages and subs... |
21 22 |
@if($admin_chat->unread_messages_count > 0) <div class="unread-messages-count mr-15">{{ $admin_chat->unread_messages_count }}</div> |
71329f175 правки |
23 24 |
@endif </div> |
4e9bbc666 правки |
25 |
</div> |
f98ccb92c Массова рассылка |
26 |
</div> |
71329f175 правки |
27 |
@endif |
f98ccb92c Массова рассылка |
28 |
|
71329f175 правки |
29 |
@if ($chats->count()) |
2f592b01f сообщения |
30 |
@foreach($chats as $chat) |
09a2fc9d8 messages and subs... |
31 |
@if(!$chat->is_admin_chat) |
2f592b01f сообщения |
32 |
<div class="messages__item hover-shadow {{ intval($chat->is_fixed) == 1 ? 'chat-fixed' : '' }}"> |
f98ccb92c Массова рассылка |
33 |
<a class="messages__item-info" href="{{ route($user_type . '.dialog', ['chat' => $chat->id]) }}"> |
2f592b01f сообщения |
34 |
<div class="messages__item-photo"> |
d721fd846 правки по сообщен... |
35 36 37 38 39 40 41 |
@if (isset($chat->employer->logo)) <img src="{{ asset(Storage::url($chat->employer->logo)) }}" alt=""> @elseif(isset($chat->worker->photo)) <img src="{{ asset(Storage::url($chat->worker->photo)) }}" alt=""> @else <img src="{{ asset('images/default_man.jpg') }}" alt=""> @endif |
2f592b01f сообщения |
42 43 44 |
</div> <div class="messages__item-text"> <div> |
d834955fe task-132687 додел... |
45 |
<b id="chat_name"> |
d721fd846 правки по сообщен... |
46 47 |
@if ($chat->employer && $chat->employer->name_company) {{ $chat->employer->name_company }} |
40d22381b fix chat |
48 |
@elseif($chat->user) |
d721fd846 правки по сообщен... |
49 50 51 |
{{ $chat->user->surname . ' ' . $chat->user->name_man . ' ' . $chat->user->surname2 }} @endif </b> |
2f592b01f сообщения |
52 53 |
</div> <div> |
09a2fc9d8 messages and subs... |
54 |
{{ $chat->last_message?->text }} |
2f592b01f сообщения |
55 56 |
</div> </div> |
d721fd846 правки по сообщен... |
57 |
</a> |
2f592b01f сообщения |
58 59 60 61 62 63 64 65 66 67 68 |
<div class="messages__item-actions" data-chat-id="{{ $chat->id }}"> <div class="messages__item-date max-content">{{ date(' H:i, d.m.Y', strtotime($chat->created_at)) }}</div> <div class="messages__item-buttons"> @if($chat->unread_messages_count > 0) <div class="unread-messages-count mr-15">{{ $chat->unread_messages_count }}</div> @endif <button class="pin-chat {{ intval($chat->is_fixed) == 1 ? 'pin-on' : 'pin-off' }} mr-15"> @include('svg.pin_off') </button> |
d834955fe task-132687 додел... |
69 |
<button class="remove-chat" data-user="{{ $chat->user_id }}" data-fancybox data-src="#remove_chat"> |
2f592b01f сообщения |
70 71 72 73 74 75 76 77 |
<svg> <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> </svg> </button> </div> <div class="clear"></div> </div> </div> |
09a2fc9d8 messages and subs... |
78 |
@endif |
2f592b01f сообщения |
79 80 81 82 |
@endforeach <div style="margin-top: 20px"> {{ $chats->onEachSide(0)->appends($_GET)->links('paginate') }} </div><!-- конец --> |
71329f175 правки |
83 |
@endif |
2f592b01f сообщения |
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
@else <div class="notify"> <svg> <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> </svg> <span>Сообщений не найдено</span> </div> @endif <script> $(function (){ $('.pin-chat').click(function(){ var this_btn = $(this); var chat_id = this_btn.closest('.messages__item-actions').data('chat-id'); var $is_fixed = this_btn.hasClass('pin-on') ? 0 : 1; $.ajax({ type: "POST", url: "{{ route('employer.pin_chat') }}", data: { id: chat_id, is_fixed: $is_fixed }, headers: { 'X-CSRF-TOKEN': $('[name="_token"]').val() }, success: function(){ location.reload(); } }); }); $('.remove-chat').click(function(){ var this_btn = $(this); var chat_id = this_btn.closest('.messages__item-actions').data('chat-id'); var wrap = this_btn.closest('.messages__item'); |
d834955fe task-132687 додел... |
120 |
var target = wrap.find('.messages__item-text').find('#chat_name').text(); |
2f592b01f сообщения |
121 122 123 124 125 126 |
$('#remove_chat').data('chat-id', chat_id); $('#remove_chat').find('.target-chat').text(target.trim()); }); }); </script> |