Files
eatvio-infra/resources/views/livewire/product-nutritional/edit.blade.php
2023-10-04 17:57:09 +03:00

113 lines
9.0 KiB
PHP

<div class="w-full max-w-xs container mx-auto rounded overflow-hidden shadow-lg --bg_white --shadow">
<div class="flex flex-wrap -mx-3 mb-6 mt-4">
<div class="w-full md:w-1/2 px-3 mb-6 md:mb-0">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-first-name">
{{ __('nutriational.group') }}
</label>
<div class="relative">
<select wire:model.live="product_group" class="block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-state">
@foreach($productGroups as $group)
<option value="{{ $group->id }}">{{ $group->name}}</option>
@endforeach
</select>
</div>
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-first-name">
{{ __('nutriational.name') }}
</label>
<input wire:model.live="name" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-red-500 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" id="grid-first-name" type="text" placeholder="{{ __('nutriational.name') }}">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-first-name">
{{ __('nutriational.description') }}
</label>
<input wire:model.live="description" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-red-500 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" id="grid-first-name" type="text" placeholder="{{ __('nutriational.description') }}">
<!-- <p class="text-red-500 text-xs italic">Please fill out this field.</p> -->
</div>
<div class="w-full md:w-1/2 px-3 dnd_file">
<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) || trim($image) == "")
<p><svg width="88" height="88"><use xlink:href="#dndFileIcon"></use></svg></p>
<div class="px-3">{{ __('recipe.tap_to_select_or_drag_and_drop') }}</div>
<div id="file-name"></div>
@else
{{-- @php dd($image) @endphp --}}
<p><img src="{{ is_string($image) ? Storage::url($image) : $image->temporaryUrl() }}" /> </p>
@endif
</label>
</div>
</div>
</div>
<div class="flex flex-wrap -mx-3 mb-6">
<div class="w-full px-3">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-first-name">
{{ __('nutriational.ingredients') }}
</label>
<textarea wire:model.live="formulations" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-red-500 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" id="grid-first-name" type="text" placeholder="{{ __('nutriational.ingredients') }}"></textarea>
<hr />
</div>
</div>
<div class="flex flex-wrap -mx-3 mb-4">
<div class="w-full md:w-1/2 px-3 mb-6 md:mb-0">
<h3> {{ __('nutriational.cpfc_per_100gr')}}</h3>
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-city">
{{ __('nutriational.energy_kkal')}}
</label>
<input wire:model.live="energy_on_100gr" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.energy_kkal')}}">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-city">
{{ __('nutriational.proteins')}}
</label>
<input wire:model.live="proteins_on_100gr" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.proteins') }} {{ __('nutriational.grams')}}">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-city">
{{ __('nutriational.fats')}}
</label>
<input wire:model.live="fats_on_100gr" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.fats')}} {{ __('nutriational.grams')}}">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-city">
{{ __('nutriational.carbs')}}
</label>
<input wire:model.live="carbohydrates_on_100gr" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.carbs')}} {{ __('nutriational.grams')}}">
</div>
<div class="w-full md:w-1/2 px-3 mb-6 md:mb-0">
<h3>{{ __('nutriational.cpfc_per_portion')}} </h3>
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-city">
{{ __('nutriational.portion_mass')}}
</label>
<input wire:model.live="portion_mass_gr" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.portion_mass')}} {{ __('nutriational.grams')}}">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-city">
{{ __('nutriational.energy_kkal')}}
</label>
<input wire:model.live="energy_on_portion" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.energy_kkal')}}">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-city">
{{ __('nutriational.proteins')}}
</label>
<input wire:model.live="proteins_on_portion" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.proteins')}} {{ __('nutriational.grams')}}">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-city">
{{ __('nutriational.fats')}}
</label>
<input wire:model.live="fats_on_portion" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.fats')}} {{ __('nutriational.grams')}}">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2 mt-2" for="grid-city">
{{ __('nutriational.carbs')}}
</label>
<input wire:model.live="carbohydrates_on_portion" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-city" type="text" placeholder="{{ __('nutriational.carbs')}} {{ __('nutriational.grams')}}">
</div>
<div class="w-full px-3 mb-6 md:mb-0">
<hr />
</div>
</div>
<div class="flex flex-wrap -mx-3 mb-4">
<div class="w-full md:w-1/2 px-3 mb-6 md:mb-0">
<button wire:click="save" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 border border-blue-700 rounded">
{{ __('nutriational.save') }}
</button>
</div>
<div class="w-full md:w-1/2 px-3 mb-6 md:mb-0">
<button wire:click="delete" class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 border border-red-700 rounded">
{{ __('nutriational.delete') }}
</button>
</div>
</div>
</div>