forked from eatvio/eatvio-infra
WIP recipe
This commit is contained in:
@@ -1,30 +1,229 @@
|
||||
<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('recipe.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">{{ __('recipe.my_recipes') }}</span></a>
|
||||
<div class="fs-5 text-center">
|
||||
<div class="--f_bolder">{{ __('recipe.editing') }}</div>
|
||||
<section class="py-5 diet" id="main">
|
||||
<div class="diet__container">
|
||||
<div class="diet__header">
|
||||
<a href="{{ route('recipe.index') }}" class="diet__back icon-arrow-short-left">
|
||||
<span>Мой блог</span>
|
||||
</a>
|
||||
<h1 class="diet__title">{{ __('recipe.editing') }}</h1>
|
||||
</div>
|
||||
<div class="d-none d-md-flex w-md-30"></div>
|
||||
</div>
|
||||
<div class="container mb-4 py-3 overflow-hidden --bg_white --shadow --radius --mw-1000">
|
||||
<div class="mb-4 fs-4_5">
|
||||
<div class="mb-2">{{ __('recipe.title') }}</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">
|
||||
<label>{{ __('recipe.type') }}</label>
|
||||
<select wire:model="type" class="form-select mt-3 ps-4 pe-5 py-3 --f_bold">
|
||||
<option value="first_meals" @selected($type == 'first_meals')>{{ __('recipe.first_meals') }}</option>
|
||||
<option value="second_meals" @selected($type == 'second_meals')>{{ __('recipe.second_meals') }}</option>
|
||||
<option value="salads" @selected($type == 'salads')>{{ __('recipe.salads') }}</option>
|
||||
<option value="snacks" @selected($type == 'snacks')>{{ __('recipe.snacks') }}</option>
|
||||
<option value="sweets" @selected($type == 'sweets')>{{ __('recipe.sweets') }}</option>
|
||||
<option value="drinks" @selected($type == 'drinks')>{{ __('recipe.drinks') }}</option>
|
||||
<option value="other" @selected($type == 'other')>{{ __('recipe.other') }}</option>
|
||||
</select>
|
||||
<div class="diet__form">
|
||||
<div class="diet__form-row">
|
||||
<label class="label">{{ __('recipe.title') }}</label>
|
||||
<input wire:model="title" type="text" class="input" placeholder="Заголовок" />
|
||||
</div>
|
||||
<div class="diet__form-row">
|
||||
<label class="label">{{ __('recipe.type') }}</label>
|
||||
<select wire:model="type" class="input">
|
||||
<option value="first_meals" @selected($type == 'first_meals')>{{ __('recipe.first_meals') }}</option>
|
||||
<option value="second_meals" @selected($type == 'second_meals')>{{ __('recipe.second_meals') }}</option>
|
||||
<option value="salads" @selected($type == 'salads')>{{ __('recipe.salads') }}</option>
|
||||
<option value="snacks" @selected($type == 'snacks')>{{ __('recipe.snacks') }}</option>
|
||||
<option value="sweets" @selected($type == 'sweets')>{{ __('recipe.sweets') }}</option>
|
||||
<option value="drinks" @selected($type == 'drinks')>{{ __('recipe.drinks') }}</option>
|
||||
<option value="other" @selected($type == 'other')>{{ __('recipe.other') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="diet__form-row">
|
||||
<div class="diet__form-columns lg-columns">
|
||||
<div class="diet__form-column">
|
||||
<div class="label">{{ __('recipe.picture') }}</div>
|
||||
<label class="file">
|
||||
<input type="file" wire:model="image" name="file" class="file__input hidden" hidden="">
|
||||
<span class="file__content">
|
||||
<span class="file__formats">
|
||||
@if(is_null($image))
|
||||
<img src="/img/formats-2.svg" alt="formats">
|
||||
@else
|
||||
<img src="{{ is_string($image) ? Storage::url($image) : $image->temporaryUrl() }}" />
|
||||
@endif
|
||||
</span>
|
||||
<span class="file__title">
|
||||
@if(is_null($image))
|
||||
Нажмите для выбора или перетащите изображание
|
||||
@endif
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
@error('image') <span class="error">{{ $message }}</span> @enderror
|
||||
</div>
|
||||
<div class="diet__form-column diet__form-column-lg">
|
||||
<div class="diet__form-row">
|
||||
<div class="label">
|
||||
Тип записи
|
||||
</div>
|
||||
<div class="diary__stats-tablist" role="tablist" aria-labelledby="label">
|
||||
<button class="btn" role="tab" type="button" id="tab-1" aria-selected="true" aria-controls="tabpanel-1">Рецепт</button>
|
||||
<button class="btn" role="tab" type="button" id="tab-2" aria-selected="false" aria-controls="tabpanel-2" tabindex="-1">Cтатья</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabpanel" role="tabpanel" id="tabpanel-1" tabindex="0" aria-labelledby="tab-1">
|
||||
<div class="diet__form-column">
|
||||
<div class="diet__form-row">
|
||||
<div class="label">{{ __('recipe.cooking_time') }}</div>
|
||||
<div class="dropdown" x-data="{ open: false }" >
|
||||
<button
|
||||
type="button"
|
||||
:class="open ? 'dropdown__button active' : 'dropdown__button'"
|
||||
x-on:click="open = ! open">
|
||||
{{ __('recipe.t' . $cooking_time . 'm') }}
|
||||
</button>
|
||||
<ul :class="open ? 'dropdown__list visible' : 'dropdown__list'">
|
||||
<li wire:click="$set('cooking_time','10')" @click="open = !open" :class="$wire.cooking_time =='10'? 'dropdown__list-item active' : 'dropdown__list-item'">{{ __('recipe.t10m') }}</li>
|
||||
<li wire:click="$set('cooking_time','20')" @click="open = !open" :class="$wire.cooking_time =='20' ? 'dropdown__list-item active' : 'dropdown__list-item'">{{ __('recipe.t20m') }}</li>
|
||||
<li wire:click="$set('cooking_time','30')" @click="open = !open" :class="$wire.cooking_time =='30' ? 'dropdown__list-item active' : 'dropdown__list-item'">{{ __('recipe.t30m') }}</li>
|
||||
<li wire:click="$set('cooking_time','60')" @click="open = !open" :class="$wire.cooking_time =='60' ? 'dropdown__list-item active' : 'dropdown__list-item'">{{ __('recipe.t60m') }}</li>
|
||||
<li wire:click="$set('cooking_time','120')" @click="open = !open" :class="$wire.cooking_time =='120' ? 'dropdown__list-item active' : 'dropdown__list-item'">{{ __('recipe.t120m') }}</li>
|
||||
<li wire:click="$set('cooking_time','14400')" @click="open = !open" :class="$wire.cooking_time =='14400' ? 'dropdown__list-item active' : 'dropdown__list-item'">{{ __('recipe.t14400m') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="diet__form-column">
|
||||
<div class="diet__form-row">
|
||||
<div class="label">{{ __('recipe.record_state') }}</div>
|
||||
<div class="dropdown" x-data="{ open: false }">
|
||||
<button type="button"
|
||||
:class="open ? 'dropdown__button active' : 'dropdown__button'"
|
||||
x-on:click="open = ! open"
|
||||
>{{ $state == 'active' ? __('recipe.record_state_active') : __('recipe.record_state_not_active') }}
|
||||
</button>
|
||||
<ul :class="open ? 'dropdown__list visible' : 'dropdown__list'">
|
||||
<li wire:click="$set('state','active')" @click="open = !open" :class="$wire.state == 'active' ? 'dropdown__list-item active' : 'dropdown__list-item'">{{ __('recipe.record_state_active') }}</li>
|
||||
<li wire:click="$set('state','archived')" @click="open = !open" :class="$wire.state == 'archived' ? 'dropdown__list-item active' : 'dropdown__list-item'">{{ __('recipe.record_state_not_active') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="diet__form-column diet__form-column-xl">
|
||||
@if(!empty($ingredients))
|
||||
<div class="content__table diet__form-row">
|
||||
<div class="content__table-wrapper">
|
||||
<table class="cabinet__table-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('recipe.name_of_product')}}</th>
|
||||
<th>{{ __('recipe.portion')}}</th>
|
||||
<th>{{ __('recipe.units')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($ingredients as $ingredient)
|
||||
<tr>
|
||||
<td>{{ $ingredient['name'] }}</td>
|
||||
<td>{{ $ingredient['portion'] }}</td>
|
||||
<td>{{ __('recipe.' . $ingredient['unit']) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="diet__form-columns">
|
||||
<div class="diet__form-column diet__form-column-lg">
|
||||
<input wire:model="ingredients_name" type="text" name="name" class="input" placeholder="Введите название продукта">
|
||||
</div>
|
||||
<div class="diet__form-column">
|
||||
<div class="diet__form-adding">
|
||||
<div class="diet__form-column">
|
||||
<input wire:model="ingredients_portion" type="num" name="portion" class="input" placeholder="Порция">
|
||||
<select wire:model="ingredients_unit" name="unit" class="input">
|
||||
<option value="gr">гр</option>
|
||||
<option value="teespoon">ч. ложек</option>
|
||||
<option value="tablespoon">ст. ложек</option>
|
||||
<option value="ml">мл</option>
|
||||
<option value="pcs">шт</option>
|
||||
<option value="clove">зубчик</option>
|
||||
<option value="to_taste">по вкусу</option>
|
||||
</select>
|
||||
<button wire:click="addIngredient" type="button" class="btn btn-primary icon-plus"></button>
|
||||
</div>
|
||||
<button type="button" class="icon-gear"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- <div class="tabpanel" role="tabpanel" id="tabpanel-1" tabindex="0" aria-labelledby="tab-1">
|
||||
<div class="diet__form-column">
|
||||
<div class="diet__form-row">
|
||||
<div class="label">
|
||||
Время приготавления
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="dropdown__button">
|
||||
1 час
|
||||
</button>
|
||||
<ul class="dropdown__list">
|
||||
<li data-value="1" class="dropdown__list-item active">1 час</li>
|
||||
<li data-value="30" class="dropdown__list-item">30 минут</li>
|
||||
</ul>
|
||||
<input type="text" name="time" class="dropdown__input hidden" hidden="" value="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="diet__form-column">
|
||||
<div class="diet__form-row">
|
||||
<div class="label">
|
||||
Статус
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="dropdown__button">
|
||||
Активна
|
||||
</button>
|
||||
<ul class="dropdown__list">
|
||||
<li data-value="active" class="dropdown__list-item active">Активна</li>
|
||||
<li data-value="unactive" class="dropdown__list-item">Неактивна</li>
|
||||
</ul>
|
||||
<input type="text" name="status" class="dropdown__input hidden" hidden="" value="unactive">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="diet__form-column diet__form-column-xl">
|
||||
<div class="diet__form-columns">
|
||||
<div class="diet__form-column diet__form-column-lg">
|
||||
<input type="text" name="product" class="input" placeholder="Введите название продукта">
|
||||
</div>
|
||||
<div class="diet__form-column">
|
||||
<div class="diet__form-adding">
|
||||
<div class="diet__form-column">
|
||||
<input type="num" name="ccal" class="input" placeholder="Порция">
|
||||
<button type="button" class="btn btn-primary icon-plus"></button>
|
||||
</div>
|
||||
<button type="button" class="icon-gear"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<div class="tabpanel tabpanel--hidden" role="tabpanel" id="tabpanel-2" tabindex="0" aria-labelledby="tab-2">
|
||||
<div class="diet__form-column">
|
||||
<div class="diet__form-row">
|
||||
<div class="label">
|
||||
Статус
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="dropdown__button">
|
||||
Активна
|
||||
</button>
|
||||
<ul class="dropdown__list">
|
||||
<li data-value="active" class="dropdown__list-item active">Активна</li>
|
||||
<li data-value="unactive" class="dropdown__list-item">Неактивна</li>
|
||||
</ul>
|
||||
<input type="text" name="status" class="dropdown__input hidden" hidden="" value="unactive">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row fs-4_5">
|
||||
<div class="diet__form">
|
||||
<div class="row fs-4_5">
|
||||
<div class="col-12 col-sm-12 col-xl-4 my-4 dnd_file">
|
||||
<label for="form-image">{{ __('recipe.picture') }}</label>
|
||||
<div class="form__item mt-3 p-3 --radius --bordered text-center --f_grey">
|
||||
@@ -175,7 +374,7 @@
|
||||
</div>
|
||||
<div class="col-sm-7 col-lg-8 mb-3 mb-sm-0 px-sm-2 flex-grow-1">
|
||||
<div class="d-flex align-items-center form-control --textarea py-3 w-100 h-100" onclick="this.children[0].focus()">
|
||||
<textarea name="step[{{$i}}][description]" wire:mode.defer="steps.{{$i}}.description" autoresize="" placeholder="Введи описание шага" rows="5">{{ $steps[$i]['description'] ?? '' }}</textarea>
|
||||
<textarea name="step[{{$i}}][description]" wire:model.defer="steps.{{$i}}.description" autoresize="" placeholder="Введи описание шага" rows="5">{{ $steps[$i]['description'] ?? '' }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex flex-sm-column ps-sm-2 justify-content-between">
|
||||
@@ -194,6 +393,7 @@
|
||||
<input wire:model="video_url" type="text" class="form-control fs-4_5 py-3 w-100" placeholder="Прикрипите ссылку на YouTube видео" />
|
||||
</div>
|
||||
</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">
|
||||
@@ -207,11 +407,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container mb-5 p-0 --mw-1000">
|
||||
@foreach ($errors->all() as $message)
|
||||
<div class="alert alert-warning">{{ $message }}</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user