79 lines
3.3 KiB
PHP
79 lines
3.3 KiB
PHP
<div>
|
|
@isset($post)
|
|
@php
|
|
$imgBg = array_key_exists('primary_color', DESIGN_PARAMETERS)
|
|
? DESIGN_PARAMETERS['primary_color']
|
|
: '#000';
|
|
@endphp
|
|
<style>
|
|
.post-card-image {
|
|
position: relative;
|
|
height: 250px;
|
|
background-position: center;
|
|
background-repeat: no-repeat;
|
|
background-size: cover;
|
|
}
|
|
|
|
.post-card-image::before {
|
|
content: '';
|
|
position: absolute;
|
|
height: 100%;
|
|
width: 100%;
|
|
left: 0;
|
|
top: 0;
|
|
background-color: {{$imgBg}};
|
|
opacity: 0.7;
|
|
z-index:0;
|
|
}
|
|
</style>
|
|
<div class="modal fade show d-block bg-dark" style="--bs-bg-opacity: .5;z-index:3000" id="postCardModal" data-bs-backdrop="static"
|
|
data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg modal-fullscreen-lg-down">
|
|
<div class="modal-content">
|
|
<div class="modal-body p-0 rounded-3 overflow-hidden border-light shadow">
|
|
|
|
@if ($post->image)
|
|
<div class="w-100 post-card-image d-flex align-items-end p-3 text-light fw-light"
|
|
style="
|
|
background-image:url('{{ $post->image }}');">
|
|
<div class="z-1">
|
|
<h1 class="z-1 text-uppercase">{{ $post->name }}</h1>
|
|
<div>
|
|
Опубиковано {{ $post->created_at->diffForHumans() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@else
|
|
<div class="w-100">
|
|
<h1 class="">{{ $post->name }}</h1>
|
|
</div>
|
|
@endif
|
|
<div class="position-absolute w-100 end-0 top-0 p-2 d-flex flex-row">
|
|
<div class="flex-fill hstack gap-2">
|
|
|
|
</div>
|
|
<button type="button" class="rounded rounded-pill bg-light bg-opacity-50 ms-auto btn-close" data-bs-dismiss="modal" aria-label="Close"
|
|
wire:click="close" style="width:1.5rem;height:1.5rem;"></button>
|
|
</div>
|
|
<div class="container px-5">
|
|
<p>
|
|
{!! $post->trixRender('content') !!}
|
|
</p>
|
|
<div class="d-flex flex-row gap-3 justify-content-end py-3">
|
|
@can('update', $post)
|
|
@livewire('post.form', ['post' => $post])
|
|
@endcan
|
|
@can('delete', $post)
|
|
<form action="{{ route('admin.posts.delete', $post) }}" method="POST" onsubmit="return confirm('Вы уверены?')">
|
|
@csrf
|
|
<button type="submit" class="btn btn-danger"><i class="bi bi-x-lg"></i> Удалить</button>
|
|
</form>
|
|
@endcan
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endisset
|
|
</div> |