star-cloud/resources/views/admin/app/ui-bundles/index.blade.php
terrylee 9ea68c770c style(app-ui): APP管理三頁改用站上設計系統(luxury按鈕/標準表格/膠囊tabs/標準modal/刪除確認)
- btn-luxury-primary/secondary + x-delete-confirm-modal
- 膠囊式頁籤(對齊 x-tab-nav 外觀)
- 「新增」改用 __('Create')=新增(不動全域 New=新值,那是 products 變更紀錄用)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-16 10:11:47 +08:00

81 lines
5.5 KiB
PHP

@extends('layouts.admin')
@section('content')
<div class="px-6 py-8" x-data="{ showCreate: false, isDeleteConfirmOpen: false, deleteFormAction: '' }">
@include('admin.app._tabs', ['active' => 'bundles'])
<div class="flex justify-end mb-4">
<button type="button" @click="showCreate = true" class="btn-luxury-primary">
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>
{{ __('Create') }}
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full bg-white dark:bg-gray-800 rounded-lg overflow-hidden">
<thead class="bg-gray-100 dark:bg-gray-700">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-400 uppercase w-20">{{ __('ID') }}</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-400 uppercase">{{ __('Name') }}</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-400 uppercase">{{ __('Actions') }}</th>
</tr>
</thead>
<tbody class="divide-y border-gray-200 dark:border-gray-700">
@forelse($bundles as $bundle)
<tr x-data="{ editing: false }">
<td class="px-6 py-4 text-gray-500 dark:text-gray-400">{{ $bundle->id }}</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-200">
<span x-show="!editing">{{ $bundle->name }}</span>
<form x-show="editing" x-cloak method="POST" action="{{ route('admin.app.ui-bundles.update', $bundle) }}" class="flex gap-2 items-center">
@csrf @method('PUT')
<input type="text" name="name" value="{{ $bundle->name }}" class="px-3 py-1.5 bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 border rounded-md text-gray-900 dark:text-gray-200 text-sm focus:ring-2 focus:ring-cyan-500">
<button type="submit" class="text-emerald-600 hover:text-emerald-800 text-sm font-medium">{{ __('Save') }}</button>
<button type="button" @click="editing = false" class="text-gray-400 hover:text-gray-600 text-sm">{{ __('Cancel') }}</button>
</form>
</td>
<td class="px-6 py-4">
<div class="flex items-center gap-4">
<button type="button" @click="editing = !editing" class="text-gray-500 hover:text-gray-700 dark:hover:text-gray-300">{{ __('Rename') }}</button>
<a href="{{ route('admin.app.ui-bundles.content', $bundle) }}" class="text-cyan-600 hover:text-cyan-800 font-medium">{{ __('Content Settings') }}</a>
<button type="button"
@click="deleteFormAction = '{{ route('admin.app.ui-bundles.destroy', $bundle) }}'; isDeleteConfirmOpen = true"
class="text-red-600 hover:text-red-800">{{ __('Delete') }}</button>
</div>
</td>
</tr>
@empty
<tr><td colspan="3" class="px-6 py-4 text-center text-gray-600 dark:text-gray-400">{{ __('No data') }}</td></tr>
@endforelse
</tbody>
</table>
</div>
{{-- 新增組合 Modal --}}
<div x-show="showCreate" x-cloak class="fixed inset-0 z-50 overflow-y-auto" @keydown.escape.window="showCreate = false">
<div class="flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:p-0">
<div class="fixed inset-0 transition-opacity bg-slate-900/60 backdrop-blur-sm" @click="showCreate = false"></div>
<div class="relative bg-white dark:bg-gray-800 rounded-2xl shadow-xl transform transition-all sm:max-w-md sm:w-full mx-4 text-left">
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
<h3 class="text-gray-900 dark:text-gray-200 text-lg font-semibold">{{ __('Create') }} {{ __('UI Bundles') }}</h3>
</div>
<form action="{{ route('admin.app.ui-bundles.store') }}" method="POST">
@csrf
<div class="px-6 py-4 space-y-4">
<div>
<label class="text-gray-600 dark:text-gray-400 text-sm block mb-1">{{ __('Name') }} <span class="text-rose-500">*</span></label>
<input type="text" name="name" required class="w-full px-3 py-2 bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 border rounded-md text-gray-900 dark:text-gray-200 focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
</div>
</div>
<div class="px-6 py-4 border-t border-gray-200 dark:border-gray-700 flex justify-end space-x-3">
<button type="button" @click="showCreate = false" class="btn-luxury-secondary">{{ __('Cancel') }}</button>
<button type="submit" class="btn-luxury-primary">{{ __('Create') }}</button>
</div>
</form>
</div>
</div>
</div>
<x-delete-confirm-modal :message="__('Are you sure you want to delete this item? This action cannot be undone.')" />
</div>
@endsection