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,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" x-data="themeSwitcher()" x-init="init()" :class="{'dark': isDark}">
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@@ -35,30 +35,5 @@
|
||||
{{ $slot }}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function themeSwitcher() {
|
||||
return {
|
||||
isDark: false,
|
||||
init() {
|
||||
const stored = localStorage.getItem('theme');
|
||||
if (stored) {
|
||||
this.isDark = stored === 'dark';
|
||||
} else {
|
||||
this.isDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
}
|
||||
this.apply();
|
||||
},
|
||||
toggle() {
|
||||
this.isDark = !this.isDark;
|
||||
localStorage.setItem('theme', this.isDark ? 'dark' : 'light');
|
||||
this.apply();
|
||||
},
|
||||
apply() {
|
||||
document.documentElement.classList.toggle('dark', this.isDark);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@@ -18,14 +18,14 @@
|
||||
<a href="#main-content" class="sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-white focus:text-black focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
||||
{{ __('Skip to main content') }}
|
||||
</a>
|
||||
<div class="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100">
|
||||
<div class="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100 dark:bg-gray-900">
|
||||
<div>
|
||||
<a href="/">
|
||||
<x-application-logo class="h-auto w-48 fill-current text-gray-500" />
|
||||
<img src="{{ asset('images/usher-logo-long.png') }}" class="h-auto fill-current text-gray-500" style="max-width: 384px;" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="main-content" class="w-full sm:max-w-md mt-6 px-6 py-4 bg-white shadow-md overflow-hidden sm:rounded-lg">
|
||||
<div id="main-content" class="w-full sm:max-w-md mt-6 px-6 py-4 bg-white dark:bg-gray-800 shadow-md overflow-hidden sm:rounded-lg">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,23 +13,23 @@
|
||||
<!-- Navigation Links -->
|
||||
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
|
||||
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
||||
{{ __('Dashboard') }}
|
||||
首頁
|
||||
</x-nav-link>
|
||||
|
||||
<x-nav-link :href="route('member.dashboard')" :active="request()->routeIs('member.dashboard')">
|
||||
{{ __('My Membership') }}
|
||||
我的會籍
|
||||
</x-nav-link>
|
||||
|
||||
<x-nav-link :href="route('documents.index')" :active="request()->routeIs('documents.*') && !request()->routeIs('admin.documents.*')">
|
||||
{{ __('Documents') }}
|
||||
文件
|
||||
</x-nav-link>
|
||||
|
||||
@if(Auth::user() && (Auth::user()->hasRole(['admin', 'membership_manager', 'finance_accountant', 'staff']) || Auth::user()->canAny(['view_finance_documents', 'view_accounting_transactions', 'manage_system_settings'])))
|
||||
@if(Auth::user() && (Auth::user()->hasRole(['admin', 'membership_manager', 'finance_accountant', 'finance_cashier', 'staff']) || Auth::user()->canAny(['view_finance_documents', 'view_incomes', 'view_accounting_transactions', 'manage_system_settings'])))
|
||||
<div class="hidden sm:flex sm:items-center">
|
||||
<x-dropdown align="right" width="48">
|
||||
<x-slot name="trigger">
|
||||
<button class="@if(request()->routeIs('admin.*')) inline-flex items-center px-1 pt-1 border-b-2 border-indigo-400 dark:border-indigo-600 text-sm font-medium leading-5 text-gray-900 dark:text-slate-100 focus:outline-none focus:border-indigo-700 dark:focus:border-indigo-300 transition duration-150 ease-in-out @else inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300 hover:border-gray-300 dark:hover:border-slate-600 focus:outline-none focus:text-gray-700 dark:focus:text-slate-300 focus:border-gray-300 dark:focus:border-slate-600 transition duration-150 ease-in-out @endif">
|
||||
<div>{{ __('Management') }}</div>
|
||||
<div>管理</div>
|
||||
|
||||
<div class="ms-1">
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
@@ -42,53 +42,64 @@
|
||||
<x-slot name="content">
|
||||
@can('view_announcements')
|
||||
<x-dropdown-link :href="route('admin.announcements.index')">
|
||||
{{ __('Admin: Announcements') }}
|
||||
公告管理
|
||||
</x-dropdown-link>
|
||||
@endcan
|
||||
@hasrole('admin|membership_manager')
|
||||
<x-dropdown-link :href="route('admin.members.index')">
|
||||
{{ __('Admin: Members') }}
|
||||
會員管理
|
||||
</x-dropdown-link>
|
||||
@endhasrole
|
||||
@role('admin')
|
||||
<x-dropdown-link :href="route('admin.roles.index')">
|
||||
{{ __('Admin: Roles') }}
|
||||
角色管理
|
||||
</x-dropdown-link>
|
||||
@endrole
|
||||
@can('view_finance_documents')
|
||||
<x-dropdown-link :href="route('admin.finance.index')">
|
||||
{{ __('Admin: Finance') }}
|
||||
報銷管理
|
||||
</x-dropdown-link>
|
||||
@endcan
|
||||
@can('view_incomes')
|
||||
<x-dropdown-link :href="route('admin.incomes.index')">
|
||||
收入管理
|
||||
</x-dropdown-link>
|
||||
@endcan
|
||||
@hasrole('admin|finance_accountant')
|
||||
<x-dropdown-link :href="route('admin.budgets.index')">
|
||||
{{ __('Admin: Budgets') }}
|
||||
預算管理
|
||||
</x-dropdown-link>
|
||||
@endhasrole
|
||||
@can('view_accounting_transactions')
|
||||
<x-dropdown-link :href="route('admin.transactions.index')">
|
||||
{{ __('Admin: Transactions') }}
|
||||
交易記錄
|
||||
</x-dropdown-link>
|
||||
<x-dropdown-link :href="route('admin.general-ledger.index')">
|
||||
總分類帳
|
||||
</x-dropdown-link>
|
||||
<x-dropdown-link :href="route('admin.trial-balance.index')">
|
||||
試算表
|
||||
</x-dropdown-link>
|
||||
@endcan
|
||||
<x-dropdown-link :href="route('admin.issues.index')">
|
||||
{{ __('Admin: Tasks') }}
|
||||
任務管理
|
||||
</x-dropdown-link>
|
||||
@role('admin')
|
||||
<x-dropdown-link :href="route('admin.audit.index')">
|
||||
{{ __('Admin: Audit Logs') }}
|
||||
稽核日誌
|
||||
</x-dropdown-link>
|
||||
<x-dropdown-link :href="route('admin.document-categories.index')">
|
||||
{{ __('Admin: Document Categories') }}
|
||||
文件分類管理
|
||||
</x-dropdown-link>
|
||||
@endrole
|
||||
@hasrole('admin|staff')
|
||||
<x-dropdown-link :href="route('admin.documents.index')">
|
||||
{{ __('Admin: Documents') }}
|
||||
文件管理
|
||||
</x-dropdown-link>
|
||||
@endhasrole
|
||||
@can('manage_system_settings')
|
||||
<x-dropdown-link :href="route('admin.settings.general')">
|
||||
{{ __('Admin: System Settings') }}
|
||||
系統設定
|
||||
</x-dropdown-link>
|
||||
@endcan
|
||||
</x-slot>
|
||||
@@ -115,7 +126,7 @@
|
||||
|
||||
<x-slot name="content">
|
||||
<x-dropdown-link :href="route('profile.edit')">
|
||||
{{ __('Profile') }}
|
||||
個人檔案
|
||||
</x-dropdown-link>
|
||||
|
||||
<!-- Authentication -->
|
||||
@@ -125,7 +136,7 @@
|
||||
<x-dropdown-link :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
{{ __('Log Out') }}
|
||||
登出
|
||||
</x-dropdown-link>
|
||||
</form>
|
||||
</x-slot>
|
||||
@@ -134,7 +145,7 @@
|
||||
|
||||
<!-- Hamburger -->
|
||||
<div class="-me-2 flex items-center sm:hidden">
|
||||
<button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out dark:text-slate-500 dark:hover:text-slate-400 dark:hover:bg-slate-800 dark:focus:bg-slate-800 dark:focus:text-slate-400" aria-label="{{ __('Main menu') }}">
|
||||
<button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out dark:text-slate-500 dark:hover:text-slate-400 dark:hover:bg-slate-800 dark:focus:bg-slate-800 dark:focus:text-slate-400" aria-label="主選單">
|
||||
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
|
||||
<path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
||||
<path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
||||
@@ -148,72 +159,83 @@
|
||||
<div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
|
||||
<div class="pt-2 pb-3 space-y-1">
|
||||
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
|
||||
{{ __('Dashboard') }}
|
||||
首頁
|
||||
</x-responsive-nav-link>
|
||||
|
||||
<x-responsive-nav-link :href="route('member.dashboard')" :active="request()->routeIs('member.dashboard')">
|
||||
{{ __('My Membership') }}
|
||||
我的會籍
|
||||
</x-responsive-nav-link>
|
||||
|
||||
<x-responsive-nav-link :href="route('documents.index')" :active="request()->routeIs('documents.*') && !request()->routeIs('admin.documents.*')">
|
||||
{{ __('Documents') }}
|
||||
文件
|
||||
</x-responsive-nav-link>
|
||||
|
||||
@if(Auth::user() && (Auth::user()->hasRole(['admin', 'membership_manager', 'finance_accountant', 'staff']) || Auth::user()->canAny(['view_finance_documents', 'view_accounting_transactions', 'manage_system_settings'])))
|
||||
@if(Auth::user() && (Auth::user()->hasRole(['admin', 'membership_manager', 'finance_accountant', 'finance_cashier', 'staff']) || Auth::user()->canAny(['view_finance_documents', 'view_incomes', 'view_accounting_transactions', 'manage_system_settings'])))
|
||||
<div class="pt-2 pb-1 border-t border-gray-200 dark:border-gray-700 mt-2">
|
||||
<div class="px-4 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">
|
||||
{{ __('Management') }}
|
||||
管理
|
||||
</div>
|
||||
</div>
|
||||
@can('view_announcements')
|
||||
<x-responsive-nav-link :href="route('admin.announcements.index')" :active="request()->routeIs('admin.announcements.*')">
|
||||
{{ __('Admin: Announcements') }}
|
||||
公告管理
|
||||
</x-responsive-nav-link>
|
||||
@endcan
|
||||
@hasrole('admin|membership_manager')
|
||||
<x-responsive-nav-link :href="route('admin.members.index')" :active="request()->routeIs('admin.members.*')">
|
||||
{{ __('Admin: Members') }}
|
||||
會員管理
|
||||
</x-responsive-nav-link>
|
||||
@endhasrole
|
||||
@role('admin')
|
||||
<x-responsive-nav-link :href="route('admin.roles.index')" :active="request()->routeIs('admin.roles.*')">
|
||||
{{ __('Admin: Roles') }}
|
||||
角色管理
|
||||
</x-responsive-nav-link>
|
||||
@endrole
|
||||
@can('view_finance_documents')
|
||||
<x-responsive-nav-link :href="route('admin.finance.index')" :active="request()->routeIs('admin.finance.*')">
|
||||
{{ __('Admin: Finance') }}
|
||||
報銷管理
|
||||
</x-responsive-nav-link>
|
||||
@endcan
|
||||
@can('view_incomes')
|
||||
<x-responsive-nav-link :href="route('admin.incomes.index')" :active="request()->routeIs('admin.incomes.*')">
|
||||
收入管理
|
||||
</x-responsive-nav-link>
|
||||
@endcan
|
||||
@hasrole('admin|finance_accountant')
|
||||
<x-responsive-nav-link :href="route('admin.budgets.index')" :active="request()->routeIs('admin.budgets.*')">
|
||||
{{ __('Admin: Budgets') }}
|
||||
預算管理
|
||||
</x-responsive-nav-link>
|
||||
@endhasrole
|
||||
@can('view_accounting_transactions')
|
||||
<x-responsive-nav-link :href="route('admin.transactions.index')" :active="request()->routeIs('admin.transactions.*')">
|
||||
{{ __('Admin: Transactions') }}
|
||||
交易記錄
|
||||
</x-responsive-nav-link>
|
||||
<x-responsive-nav-link :href="route('admin.general-ledger.index')" :active="request()->routeIs('admin.general-ledger.*')">
|
||||
總分類帳
|
||||
</x-responsive-nav-link>
|
||||
<x-responsive-nav-link :href="route('admin.trial-balance.index')" :active="request()->routeIs('admin.trial-balance.*')">
|
||||
試算表
|
||||
</x-responsive-nav-link>
|
||||
@endcan
|
||||
<x-responsive-nav-link :href="route('admin.issues.index')" :active="request()->routeIs('admin.issues.*')">
|
||||
{{ __('Admin: Tasks') }}
|
||||
任務管理
|
||||
</x-responsive-nav-link>
|
||||
@role('admin')
|
||||
<x-responsive-nav-link :href="route('admin.audit.index')" :active="request()->routeIs('admin.audit.*')">
|
||||
{{ __('Admin: Audit Logs') }}
|
||||
稽核日誌
|
||||
</x-responsive-nav-link>
|
||||
<x-responsive-nav-link :href="route('admin.document-categories.index')" :active="request()->routeIs('admin.document-categories.*')">
|
||||
{{ __('Admin: Document Categories') }}
|
||||
文件分類管理
|
||||
</x-responsive-nav-link>
|
||||
@endrole
|
||||
@hasrole('admin|staff')
|
||||
<x-responsive-nav-link :href="route('admin.documents.index')" :active="request()->routeIs('admin.documents.*')">
|
||||
{{ __('Admin: Documents') }}
|
||||
文件管理
|
||||
</x-responsive-nav-link>
|
||||
@endhasrole
|
||||
@can('manage_system_settings')
|
||||
<x-responsive-nav-link :href="route('admin.settings.general')" :active="request()->routeIs('admin.settings.*')">
|
||||
{{ __('Admin: System Settings') }}
|
||||
系統設定
|
||||
</x-responsive-nav-link>
|
||||
@endcan
|
||||
@endif
|
||||
@@ -228,7 +250,7 @@
|
||||
|
||||
<div class="mt-3 space-y-1">
|
||||
<x-responsive-nav-link :href="route('profile.edit')">
|
||||
{{ __('Profile') }}
|
||||
個人檔案
|
||||
</x-responsive-nav-link>
|
||||
|
||||
<!-- Authentication -->
|
||||
@@ -238,7 +260,7 @@
|
||||
<x-responsive-nav-link :href="route('logout')"
|
||||
onclick="event.preventDefault();
|
||||
this.closest('form').submit();">
|
||||
{{ __('Log Out') }}
|
||||
登出
|
||||
</x-responsive-nav-link>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user