gruene-seele/resources/views/admin/inventory/packaging-items/index.blade.php

73 lines
3.4 KiB
PHP

@extends('layouts.layout-2')
@section('content')
<div class="card">
<h6 class="card-header d-flex justify-content-between align-items-center">
<span>{{ $pageTitle }}</span>
<a href="{{ route('admin.inventory.packaging-items.create', ['category' => $category]) }}" class="btn btn-sm btn-primary">{{ __('Neu anlegen') }}</a>
</h6>
<div class="card-datatable table-responsive">
<table class="datatables-style table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Material') }}</th>
<th>{{ __('Gewicht (g)') }}</th>
<th>{{ __('Lieferant') }}</th>
<th>{{ __('URL') }}</th>
<th>{{ __('Status') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($values as $value)
<tr>
<td>
<a href="{{ route('admin.inventory.packaging-items.edit', $value) }}" class="btn icon-btn btn-sm btn-primary">
<span class="far fa-edit"></span>
</a>
</td>
<td>{{ $value->name }}</td>
<td>{{ $value->packagingMaterial?->name ?? '—' }}</td>
<td>{{ $value->weight_grams }}</td>
<td>{{ $value->supplier?->name ?? '—' }}</td>
<td>
@if($value->url)
<a href="{{ $value->url }}" target="_blank" title="{{ $value->url }}"><i class="fa fa-external-link-alt"></i></a>
@else
@endif
</td>
<td data-sort="{{ $value->active ? 1 : 0 }}">
@if($value->active)
<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>
@else
<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>
@endif
</td>
<td>
<form action="{{ route('admin.inventory.packaging-items.destroy', $value) }}" method="post" class="d-inline"
onsubmit="return confirm('{{ __('Really delete entry?') }}');">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-link text-danger p-0"><i class="far fa-trash-alt"></i></button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<script>
$(document).ready(function () {
$('.datatables-style').dataTable({
"bLengthChange": false,
"iDisplayLength": 100,
"order": [[1, "asc"]],
"language": {"url": "/js/German.json"}
});
});
</script>
@endsection