Add membership fee system with disability discount and fix document permissions
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>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800">
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
||||
文件中心
|
||||
</h2>
|
||||
</x-slot>
|
||||
@@ -8,41 +8,41 @@
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8 space-y-6">
|
||||
<!-- Categories -->
|
||||
<div class="bg-white shadow sm:rounded-lg p-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">文件類別</h3>
|
||||
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg p-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-4">文件類別</h3>
|
||||
<div class="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-6">
|
||||
<a href="{{ route('documents.index') }}"
|
||||
class="flex flex-col items-center p-4 border rounded-lg hover:bg-gray-50 transition
|
||||
{{ !request('category') ? 'border-indigo-500 bg-indigo-50' : 'border-gray-200' }}">
|
||||
class="flex flex-col items-center p-4 border rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition
|
||||
{{ !request('category') ? 'border-indigo-500 bg-indigo-50 dark:bg-indigo-900/30' : 'border-gray-200 dark:border-gray-700' }}">
|
||||
<span class="text-3xl mb-2">📚</span>
|
||||
<span class="text-sm font-medium text-gray-900">全部文件</span>
|
||||
<span class="text-xs text-gray-500 mt-1">{{ $documents->total() }}</span>
|
||||
<span class="text-sm font-medium text-gray-900 dark:text-gray-100">全部文件</span>
|
||||
<span class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ $documents->total() }}</span>
|
||||
</a>
|
||||
@foreach($categories as $category)
|
||||
<a href="{{ route('documents.index', ['category' => $category->id]) }}"
|
||||
class="flex flex-col items-center p-4 border rounded-lg hover:bg-gray-50 transition
|
||||
{{ request('category') == $category->id ? 'border-indigo-500 bg-indigo-50' : 'border-gray-200' }}">
|
||||
class="flex flex-col items-center p-4 border rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition
|
||||
{{ request('category') == $category->id ? 'border-indigo-500 bg-indigo-50 dark:bg-indigo-900/30' : 'border-gray-200 dark:border-gray-700' }}">
|
||||
<span class="text-3xl mb-2">{{ $category->getIconDisplay() }}</span>
|
||||
<span class="text-sm font-medium text-gray-900 text-center">{{ $category->name }}</span>
|
||||
<span class="text-xs text-gray-500 mt-1">{{ $category->active_documents_count }}</span>
|
||||
<span class="text-sm font-medium text-gray-900 dark:text-gray-100 text-center">{{ $category->name }}</span>
|
||||
<span class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ $category->active_documents_count }}</span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Search -->
|
||||
<div class="bg-white shadow sm:rounded-lg p-6">
|
||||
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg p-6">
|
||||
<form method="GET" action="{{ route('documents.index') }}" class="flex gap-4">
|
||||
<input type="hidden" name="category" value="{{ request('category') }}">
|
||||
<div class="flex-1">
|
||||
<input type="text" name="search" value="{{ request('search') }}" placeholder="搜尋文件標題或說明..."
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
class="block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
|
||||
</div>
|
||||
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-6 py-2 text-sm font-medium text-white hover:bg-indigo-700">
|
||||
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-6 py-2 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-500">
|
||||
搜尋
|
||||
</button>
|
||||
@if(request('search') || request('category'))
|
||||
<a href="{{ route('documents.index') }}" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50">
|
||||
<a href="{{ route('documents.index') }}" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600">
|
||||
清除
|
||||
</a>
|
||||
@endif
|
||||
@@ -52,7 +52,7 @@
|
||||
<!-- Documents List -->
|
||||
<div class="space-y-4">
|
||||
@forelse($documents as $document)
|
||||
<div class="bg-white shadow sm:rounded-lg hover:shadow-md transition">
|
||||
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg hover:shadow-md transition">
|
||||
<div class="px-6 py-5">
|
||||
<div class="flex items-start">
|
||||
<div class="flex-shrink-0 text-4xl mr-4">
|
||||
@@ -61,15 +61,15 @@
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-start justify-between">
|
||||
<div class="flex-1">
|
||||
<h3 class="text-lg font-medium text-gray-900">
|
||||
<a href="{{ route('documents.public.show', $document->public_uuid) }}" class="hover:text-indigo-600">
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
<a href="{{ route('documents.public.show', $document->public_uuid) }}" class="hover:text-indigo-600 dark:hover:text-indigo-400">
|
||||
{{ $document->title }}
|
||||
</a>
|
||||
</h3>
|
||||
@if($document->description)
|
||||
<p class="mt-1 text-sm text-gray-500">{{ $document->description }}</p>
|
||||
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">{{ $document->description }}</p>
|
||||
@endif
|
||||
<div class="mt-2 flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-gray-500">
|
||||
<div class="mt-2 flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<span class="inline-flex items-center">
|
||||
{{ $document->category->icon }} {{ $document->category->name }}
|
||||
</span>
|
||||
@@ -91,11 +91,11 @@
|
||||
</div>
|
||||
<div class="ml-6 flex flex-col space-y-2">
|
||||
<a href="{{ route('documents.public.show', $document->public_uuid) }}"
|
||||
class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700">
|
||||
class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-500">
|
||||
檢視
|
||||
</a>
|
||||
<a href="{{ route('documents.public.download', $document->public_uuid) }}"
|
||||
class="inline-flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50">
|
||||
class="inline-flex items-center justify-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-600">
|
||||
下載
|
||||
</a>
|
||||
</div>
|
||||
@@ -105,16 +105,16 @@
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg">
|
||||
<div class="px-6 py-12 text-center">
|
||||
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<svg class="mx-auto h-12 w-12 text-gray-400 dark:text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
||||
</svg>
|
||||
<h3 class="mt-2 text-sm font-medium text-gray-900">找不到文件</h3>
|
||||
<p class="mt-1 text-sm text-gray-500">目前沒有符合條件的文件</p>
|
||||
<h3 class="mt-2 text-sm font-medium text-gray-900 dark:text-gray-100">找不到文件</h3>
|
||||
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">目前沒有符合條件的文件</p>
|
||||
@if(request('search') || request('category'))
|
||||
<div class="mt-6">
|
||||
<a href="{{ route('documents.index') }}" class="text-indigo-600 hover:text-indigo-900">
|
||||
<a href="{{ route('documents.index') }}" class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300">
|
||||
瀏覽所有文件
|
||||
</a>
|
||||
</div>
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
<!-- Pagination -->
|
||||
@if($documents->hasPages())
|
||||
<div class="bg-white shadow sm:rounded-lg p-6">
|
||||
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg p-6">
|
||||
{{ $documents->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user