Files
backend-mm/resources/views/nova/chat.blade.php

68 lines
2.9 KiB
PHP

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="robots" content="noindex">
<title>{{ __('Chat') }} — {{ config('nova.name', config('app.name')) }}</title>
<style>{!! $chatCss !!}</style>
</head>
<body>
<div class="mm-chat" id="mm-chat">
<header class="mm-chat__top">
<a class="mm-chat__back" href="{{ url('/panel') }}">{{ __('Back to panel') }}</a>
<h1>{{ __('Chat') }}</h1>
<span class="mm-chat__badge" id="mm-chat-unread" hidden>0</span>
</header>
<div class="mm-chat__shell">
<aside class="mm-chat__inbox">
<div class="mm-chat__inbox-head">{{ __('Conversations') }}</div>
<div class="mm-chat__list" id="mm-chat-list"></div>
<p class="mm-chat__empty" id="mm-chat-empty-inbox" hidden>{{ __('No conversations yet.') }}</p>
</aside>
<section class="mm-chat__thread">
<div class="mm-chat__thread-head" id="mm-chat-thread-head">{{ __('Select a conversation') }}</div>
<div class="mm-chat__messages" id="mm-chat-messages"></div>
<p class="mm-chat__view-only" id="mm-chat-view-only" hidden>{{ __('View only — the store owner replies here.') }}</p>
<form class="mm-chat__composer" id="mm-chat-form" hidden>
<textarea
id="mm-chat-input"
rows="1"
maxlength="5000"
placeholder="{{ __('Write a message...') }}"
autocomplete="off"
></textarea>
<button type="submit" id="mm-chat-send">{{ __('Send') }}</button>
</form>
</section>
</div>
</div>
<audio id="mm-chat-sound" src="/assets/panel/audio/sound.mp3" preload="auto" playsinline></audio>
<script>
window.MM_CHAT = {
conversationsUrl: @json(url('/panel/chat/conversations')),
messagesUrl: @json(url('/panel/chat/conversations')),
csrf: @json(csrf_token()),
broadcastAuth: @json(url('/panel/broadcasting/auth')),
broadcastAuthPath: '/panel/broadcasting/auth',
pusher: @json($pusher),
inboxChannel: @json($inboxChannel),
strings: {
select: @json(__('Select a conversation')),
noMessages: @json(__('No messages yet.')),
you: @json(__('You')),
support: @json(__('Support')),
viewOnly: @json(__('View only — the store owner replies here.')),
},
};
</script>
@foreach ($chatScripts as $script)
<script>{!! $script !!}</script>
@endforeach
</body>
</html>