@extends('layouts/default') {{-- Page title --}} @section('title') {{ $consumable->name }} {{ trans('general.consumable') }} - ({{ trans('general.remaining_var', ['count' => $consumable->numRemaining()]) }}) @parent @endsection @section('header_right') @endsection {{-- Page content --}} @section('content') @if ($consumable->deleted_at) {{ trans('general.item_deleted_warning', ['item_type' => trans('general.consumable')]) }} @elseif ($consumable->archived) {{ trans('general.item_archived_warning', ['item_type' => trans('general.consumable')]) }} @endif @can('checkout', $consumable) @endcan @if ($consumable->deleted_at) {{-- Soft-deleted: every write action stays visually present but non-interactive. Clone remains active because it produces a fresh row and leaves the deleted parent untouched. Restore takes the delete button's slot in the info panel. --}} @can('update', $consumable) @endcan @can('checkout', $consumable) @endcan @can('update', $consumable) @endcan @elseif ($consumable->archived) {{-- Archived (but live): mirror the deleted-row treatment on edit, checkout, and delete. Archived rows are retired from active inventory, so interactive paths that would extend their footprint stay visually present but non-interactive. Clone and adjust-quantity keep their existing archived-aware behavior. --}} @can('update', $consumable) @endcan @can('checkout', $consumable) @endcan @can('update', $consumable) @endcan @can('update', $consumable) {{-- Pull-right matches the delete button's alignment on live rows, so unarchive sits in the same slot in the info panel without the destructive action migrating around. --}}
@csrf
@endcan @else @can('update', $consumable) @php $lastOrder = $consumable->lastOrderDefaults(); @endphp @endcan @endif
@endsection @section('moar_scripts') @can('files', $consumable) @endcan @can('update', $consumable) @endcan @include ('partials.bootstrap-table', ['exportFile' => 'consumable-' . $consumable->name . '-export', 'search' => false]) @endsection