初始化
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('title', '产品管理')
|
||||
@section('page-title', '产品管理')
|
||||
@section('actions')
|
||||
<a href="{{ route('admin.products.create') }}" class="btn btn-primary btn-sm"><x-icon name="plus" :size="16"/> 新建产品</a>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<table class="data-table">
|
||||
<thead><tr><th>名称</th><th>型号</th><th>分类</th><th>状态</th><th class="col-op">操作</th></tr></thead>
|
||||
<tbody>
|
||||
@forelse ($products as $p)
|
||||
<tr>
|
||||
<td>{{ $p->name }}</td>
|
||||
<td class="muted">{{ $p->model ?: '-' }}</td>
|
||||
<td>{{ $p->category?->name ?: '-' }}</td>
|
||||
<td>{{ $p->status === 'published' ? '已发布' : '草稿' }}</td>
|
||||
<td class="row-actions">
|
||||
<a href="{{ route('admin.products.edit', $p) }}" class="btn btn-sm"><x-icon name="edit" :size="16"/></a>
|
||||
<form method="POST" action="{{ route('admin.products.destroy', $p) }}" onsubmit="return confirm('确认删除该产品?')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="btn btn-sm btn-danger"><x-icon name="trash" :size="16"/></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="5" class="muted">暂无产品。</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $products->links('pagination::bootstrap-5') }}
|
||||
@endsection
|
||||
Reference in New Issue
Block a user