Add admin messages show view

This commit is contained in:
Daniel Supernault 2019-06-18 19:55:05 -06:00
parent a71a2c96b7
commit 7e015bfb6d
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -0,0 +1,34 @@
@extends('admin.partial.template-full')
@section('section')
<div class="title">
<div class="d-flex justify-content-between align-items-center">
<div class="font-weight-bold"># {{$message->id}}</div>
<div class="font-weight-bold h3">Message</div>
<div>
@if($message->read_at)
<span class="btn btn-outline-secondary btn-sm disabled" disabled>Read</span>
@else
<button type="button" class="btn btn-outline-primary btn-sm" id="markRead">Mark Read</button>
@endif
</div>
</div>
</div>
<hr>
@endsection
@push('scripts')
<script type="text/javascript">
$('#markRead').on('click', function(e) {
e.preventDefault();
axios.post('/i/admin/messages/mark-read', {
id: '{{$message->id}}',
}).then(res => {
window.location.href = window.location.href;
})
})
</script>
@endpush