Features: - Implement two fee types: entrance fee and annual fee (both NT$1,000) - Add 50% discount for disability certificate holders - Add disability certificate upload in member profile - Integrate disability verification into cashier approval workflow - Add membership fee settings in system admin Document permissions: - Fix hard-coded role logic in Document model - Use permission-based authorization instead of role checks Additional features: - Add announcements, general ledger, and trial balance modules - Add income management and accounting entries - Add comprehensive test suite with factories - Update UI translations to Traditional Chinese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
119 lines
7.6 KiB
PHP
119 lines
7.6 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
角色詳情
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-6xl sm:px-6 lg:px-8 space-y-6">
|
|
@if (session('status'))
|
|
<div class="rounded-md bg-green-50 dark:bg-green-900/30 p-4">
|
|
<p class="text-sm font-medium text-green-800 dark:text-green-200">{{ session('status') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6 flex items-center justify-between">
|
|
<div>
|
|
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">{{ $role->name }}</h3>
|
|
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">{{ $role->description ?: __('No description') }}</p>
|
|
</div>
|
|
<a href="{{ route('admin.roles.edit', $role) }}" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 dark:bg-indigo-500 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-600 focus:ring-offset-2 dark:focus:ring-offset-gray-800">
|
|
編輯角色
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6 space-y-4">
|
|
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
|
指派使用者
|
|
</h3>
|
|
<form method="POST" action="{{ route('admin.roles.assign-users', $role) }}" class="space-y-3">
|
|
@csrf
|
|
<label for="user_ids" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
選擇要指派的使用者
|
|
</label>
|
|
<select name="user_ids[]" id="user_ids" class="mt-1 block w-full rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100" multiple size="5">
|
|
@foreach ($availableUsers as $user)
|
|
<option value="{{ $user->id }}">{{ $user->name }} ({{ $user->email }})</option>
|
|
@endforeach
|
|
</select>
|
|
@error('user_ids')
|
|
<p class="text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
<div class="flex justify-end">
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 dark:bg-indigo-500 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-600 focus:ring-offset-2 dark:focus:ring-offset-gray-800">
|
|
指派所選項目
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
|
<div class="px-4 py-5 sm:p-6 space-y-4">
|
|
<div class="flex items-center justify-between">
|
|
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
|
擁有此角色的使用者
|
|
</h3>
|
|
<form method="GET" action="{{ route('admin.roles.show', $role) }}" class="flex gap-2" role="search">
|
|
<input
|
|
type="text"
|
|
name="search"
|
|
value="{{ $search }}"
|
|
placeholder="搜尋使用者"
|
|
class="block rounded-md border-gray-300 dark:border-gray-700 shadow-sm focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100"
|
|
>
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-gray-200 dark:bg-gray-700 px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-600">
|
|
搜尋
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700" role="table">
|
|
<thead class="bg-gray-50 dark:bg-gray-700">
|
|
<tr>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">名稱</th>
|
|
<th scope="col" class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300">電子郵件</th>
|
|
<th scope="col" class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300"><span class="sr-only">移除</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 dark:divide-gray-700 bg-white dark:bg-gray-800">
|
|
@forelse ($users as $user)
|
|
<tr>
|
|
<td class="px-4 py-3 text-sm text-gray-900 dark:text-gray-100">{{ $user->name }}</td>
|
|
<td class="px-4 py-3 text-sm text-gray-900 dark:text-gray-100">{{ $user->email }}</td>
|
|
<td class="px-4 py-3 text-right text-sm">
|
|
<form method="POST" action="{{ route('admin.roles.remove-user', [$role, $user]) }}" onsubmit="return confirm('從使用者移除此角色?');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300">
|
|
移除
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="3" class="px-4 py-4 text-sm text-gray-500 dark:text-gray-400">
|
|
此角色未指派任何使用者。
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div>
|
|
{{ $users->links() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|
|
|