forked from eatvio/eatvio-infra
WIP recipe
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
</a>
|
||||
<h1 class="diet__title">{{ __('recipe.adding') }}</h1>
|
||||
</div>
|
||||
<div action="#" class="diet__form">
|
||||
<div class="mb-4 fs-4_5">
|
||||
<div class="mb-2">{{ __('recipe.title') }}</div>
|
||||
<div class="diet__form">
|
||||
<div class="diet__form-row">
|
||||
<div class="label">{{ __('recipe.title') }}</div>
|
||||
<input wire:model="title" type="text" class="input" placeholder="Заголовок" />
|
||||
</div>
|
||||
<div class="mb-4 fs-4_5">
|
||||
<label>{{ __('recipe.type') }}</label>
|
||||
<div class="diet__form-row">
|
||||
<div class="label">{{ __('recipe.type') }}</div>
|
||||
<select wire:model="type" class="input">
|
||||
<option value="first_meals">{{ __('recipe.first_meals') }}</option>
|
||||
<option value="second_meals">{{ __('recipe.second_meals') }}</option>
|
||||
@@ -90,17 +90,50 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="diet__form-column diet__form-column-xl">
|
||||
</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 type="text" name="product" class="input" placeholder="Введите название продукта">
|
||||
<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 type="num" name="ccal" class="input" placeholder="Порция">
|
||||
<button type="button" class="btn btn-primary icon-plus"></button>
|
||||
<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>
|
||||
@@ -131,7 +164,9 @@
|
||||
})
|
||||
.then( function(editor){
|
||||
editor.model.document.on('change:data', () => {
|
||||
$dispatch('input', editor.getData())
|
||||
console.log(editor.getData());
|
||||
// $dispatch('input', editor.getData())
|
||||
@this.set('description', editor.getData());
|
||||
})
|
||||
})
|
||||
.catch( error => {
|
||||
@@ -165,7 +200,7 @@
|
||||
@endif
|
||||
</span>
|
||||
</label>
|
||||
<textarea name="desc-step-1" class="textarea" placeholder="Введите описание шага"></textarea>
|
||||
<textarea name="desc-step-1" class="textarea" wire:model="steps.{{$i}}.description" id="step[{{$i}}][description]" placeholder="Введите описание шага"></textarea>
|
||||
<div class="diet__form-column">
|
||||
<button type="button" wire:click="removeStep({{$i}})" class="diet__form-add btn {{ $i == 0 ? 'btn-gray' : 'btn-primary' }}" @disabled($i == 0)>-</button>
|
||||
<button type="button" wire:click="addStep" class="diet__form-add btn btn-primary" data-bs-original-title="Добавить шаг">+</button>
|
||||
|
||||
Reference in New Issue
Block a user