Files
eatvio-infra/resources/views/livewire/blog-post/create.blade.php
2023-10-04 17:57:09 +03:00

118 lines
6.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<section class="py-5" id="main">
<div class="container d-flex justify-content-between align-items-center flex-nowrap mb-4 px-4 py-3 --bg_white --shadow --radius --mw-1000 --f_bold --f_main overflow-x-xs-scroll">
<a href="{{ route('blog_post.index') }}" class="d-flex w-md-30 align-items-center --f_bold"><svg width="17" height="16" class="me-2"><use xlink:href="#GoBack"></use></svg><span class="d-none d-md-inline --f_main">Мой блог</span></a>
<div class="fs-5 text-center">
<div class="--f_bolder">Добавление в блог</div>
</div>
<div class="d-none d-md-flex w-md-30"></div>
</div>
{{-- <form> --}}
<div class="container mb-4 py-3 overflow-hidden --bg_white --shadow --radius --mw-1000">
<div class="row fs-4_5">
<div class="col-12 col-sm-12 col-xl-4 my-4 dnd_file">
<label for="form-image">{{ __('blog_post.picture') }}</label>
<div class="form__item mt-3 p-3 --radius --bordered text-center --f_grey">
<input wire:model="image" type="file" name="form-image" id="form-image">
@error('image') <span class="error">{{ $message }}</span> @enderror
<label for="form-image" class="file-label">
@if(is_null($image))
<p><svg width="88" height="88"><use xlink:href="#dndFileIcon"></use></svg></p>
<div class="px-3">{{ __('blog_post.tap_to_select_or_drag_and_drop') }}</div>
<div id="file-name"></div>
@else
{{-- @php dd($image) @endphp --}}
<p><img src="{{ $image->temporaryUrl() }}" /> </p>
@endif
</label>
</div>
</div>
<div class="col-12 col-sm-7 col-md-8 my-4 d-flex flex-column justify-content-between">
<div class="mb-4">
<label>Тип записи</label>
<ul class="mt-3 nav nav-pills flex-nowrap w-100 --bordered --radius --tabs_blue overflow-x-xs-scroll" role="radiogroup">
<li class="nav-item" role="presentation">
{{-- <label class="btn btn-lg nav-link py-3 --radius" data-bs-toggle="pill" role="radio" aria-selected="false"> --}}
<a href="{{ route('recipe.create') }}" class="btn btn-lg nav-link py-3">Рецепт</a>
{{-- </label> --}}
</li>
<li class="nav-item" role="presentation">
{{-- <label class="btn btn-lg nav-link py-3 --radius active" data-bs-toggle="pill" role="radio" aria-selected="true"> --}}
<label class="btn btn-lg nav-link py-3 --radius active disabled">Статья</label>
{{-- </label> --}}
</li>
</ul>
</div>
<div class="row">
<div class="col-12 col-sm-6 d-flex flex-column mt-3 mt-sm-0">
<label>Статус</label>
<select wire:model="state" class="form-select mt-3 ps-4 pe-5 py-3 --f_bold">
<option value="active" selected>Активна</option>
<option value="archived">Не активна</option>
</select>
</div>
</div>
</div>
</div>
<div class="mb-4 fs-4_5">
<div class="mb-2">Заголовок</div>
<input wire:model="title" type="text" class="form-control fs-4_5 py-3 w-100" placeholder="Заголовок" />
</div>
<div class="mb-4 fs-4_5" wire:ignore>
<label for="txtFormatter" class="mb-2">{{ __('blog_post.content') }}</label>
<div
class="form-textarea w-full"
x-data="{}"
x-init="ClassicEditor.create($refs.myIdentifierHere,
{
toolbar: {
items: [
'heading', '|',
'bold', 'italic', '|',
'bulletedList', 'numberedList', '|',
'outdent', 'indent', '|',
'blockQuote', 'undo', 'redo'
],
shouldNotGroupWhenFull: true
}
})
.then( function(editor){
editor.model.document.on('change:data', () => {
$dispatch('input', editor.getData())
})
})
.catch( error => {
console.error( error );
});"
wire:ignore
wire:key="myIdentifierHere"
x-ref="myIdentifierHere"
wire:model.live.debounce.9999999ms="description"></div>
</div>
<div class="mb-4 fs-4_5">
<div class="mb-2" data-tags="{{ json_encode($tags) }}">Теги</div>
<livewire:tags-component />
</div>
<div class="mb-4 fs-4_5">
<div class="mb-2">Ссылка на видео (YouTube)</div>
<input wire:model="videoUrl" type="text" class="form-control fs-4_5 py-3 w-100" placeholder="Прикрипите ссылку на YouTube видео" />
</div>
</div>
<div class="container mb-5 p-0 --mw-1000">
<div class="row gx-3 gx-lg-4 gy-3 gy-lg-4">
<div class="col">
<button wire:click="draft" class="btn btn-lg btn-secondary btn-block w-100 --f_bolder --no_wrap">В ЧЕРНОВИК</button>
</div>
<div class="col">
<button wire:click="preview" class="btn btn-lg btn-secondary btn-block w-100 --f_bolder --no_wrap">ПРЕВЬЮ</button>
</div>
<div class="col">
<button wire:click="publish" class="btn btn-lg btn-primary btn-block w-100 --f_bolder --no_wrap" type="submit">ОПУБЛИКОВАТЬ</button>
</div>
</div>
</div>
{{-- </form> --}}
</section>