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

42 lines
2.8 KiB
PHP

<div class="w-full max-w-xs container mx-auto rounded overflow-hidden shadow-lg --bg_white --shadow">
<div class="mt-6 mb-6 grid">
<div class="justify-self-center">
<a href="{{ route('product_nutritional_value.create')}}" class="bg-blue-500 text-white active:bg-blue-600 font-bold uppercase text-xs px-4 py-2 rounded shadow hover:shadow-md outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150">new</a>
</div>
</div>
<div class="mt-6 mb-6">
<table class="table-auto">
<thead>
<tr>
<th class="px-4 py-2">Group</th>
<th class="px-4 py-2">Name</th>
<th class="px-4 py-2">100 gr value</th>
<th class="px-4 py-2">portion value</th>
<th class="px-4 py-2">Image</th>
<th class="px-4 py-2">Description</th>
<th class="px-4 py-2">Formulations</th>
<th class="px-4 py-2">Actions</th>
</tr>
</thead>
<tbody>
@foreach($products as $product)
<tr>
<td class="border px-4 py-2"><div class="overflow-auto md:overflow-scroll h-24 w-32">{{ $product->product_group->name }}</div></td>
<td class="border px-4 py-2"><div class="overflow-auto md:overflow-scroll h-24 w-32">{{ $product->name }}</div></td>
<td class="border px-4 py-2">{{ $product->energy_on_100gr . "/" . $product->proteins_on_100gr . "/" . $product->fats_on_100gr . "/" . $product->carbohydrates_on_100gr }}</td>
<td class="border px-4 py-2">{{ $product->portion_mass_gr . "gr/" . $product->energy_on_portion . "/" . $product->proteins_on_portion . "/" . $product->fats_on_portion . "/" . $product->carbohydrates_on_portion }}</td>
@if(mb_strlen($product->image) < 3)
<td class="border px-4 py-2"><img src="{{ Storage::url("product_nutritional/grey_logo.png") }}" alt="{{$product->description}} image" style="width:100px"/> </td>
@else
<td class="border px-4 py-2"><img src="{{ Storage::url($product->image) }}" alt="{{$product->description}} image" style="width:100px"/> </td>
@endif
<td class="border px-4 py-2"><div class="overflow-auto md:overflow-scroll h-24 w-24">{{ $product->description}}</div></td>
<td class="border px-4 py-2"><div class="overflow-auto md:overflow-scroll h-24 w-24">{{ $product->formulations}}</div></td>
<td class="border px-4 py-2"><a href="{{ route('product_nutritional_value.edit', $product) }}">Edit</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>