Implement dark mode, bug report page, and schema dump

This commit is contained in:
2025-11-27 15:06:45 +08:00
parent 13bc6db529
commit 83602b1ed1
91 changed files with 1078 additions and 2291 deletions

View File

@@ -5,190 +5,26 @@
</h2>
</x-slot>
<div class="py-12">
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8 space-y-4">
<!-- Action Buttons -->
<div class="flex justify-between">
<a href="{{ route('admin.cashier-ledger.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 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
返回現金簿
</a>
<button onclick="window.print()" 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 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
<svg class="-ml-1 mr-2 h-5 w-5 text-gray-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z" />
</svg>
列印報表
</button>
</div>
<!-- Report Header -->
<div class="bg-white shadow sm:rounded-lg">
<div class="px-4 py-5 sm:p-6 text-center">
<h3 class="text-2xl font-bold text-gray-900">現金簿餘額報表</h3>
<p class="mt-1 text-sm text-gray-500">報表日期: {{ now()->format('Y-m-d H:i') }}</p>
<div class="py-6">
<div class="mx-auto max-w-5xl sm:px-6 lg:px-8 space-y-6">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 text-gray-900">
<h3 class="font-semibold mb-4">帳戶餘額</h3>
<ul class="list-disc list-inside space-y-1">
@foreach($accounts as $account)
<li>{{ $account['bank_account'] ?? '預設帳戶' }}{{ $account['balance'] }}</li>
@endforeach
</ul>
</div>
</div>
<!-- Account Balances -->
<div class="bg-white shadow sm:rounded-lg">
<div class="px-4 py-5 sm:p-6">
<h3 class="text-lg font-medium leading-6 text-gray-900 mb-4">各帳戶餘額</h3>
@if($accounts->isNotEmpty())
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
@php
$totalBalance = 0;
@endphp
@foreach($accounts as $account)
@php
$totalBalance += $account['balance'];
@endphp
<div class="rounded-lg border-2 {{ $account['balance'] >= 0 ? 'border-green-300 bg-green-50' : 'border-red-300 bg-red-50' }} p-4">
<div class="flex items-center justify-between">
<div class="flex-1">
<dt class="text-sm font-medium text-gray-700">{{ $account['bank_account'] }}</dt>
<dd class="mt-2 text-3xl font-bold {{ $account['balance'] >= 0 ? 'text-green-700' : 'text-red-700' }}">
NT$ {{ number_format($account['balance'], 2) }}
</dd>
@if($account['last_updated'])
<p class="mt-1 text-xs text-gray-500">
最後更新: {{ $account['last_updated']->format('Y-m-d') }}
</p>
@endif
</div>
<div class="flex-shrink-0">
<svg class="h-12 w-12 {{ $account['balance'] >= 0 ? 'text-green-400' : 'text-red-400' }}" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@if($account['balance'] >= 0)
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
@else
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
@endif
</svg>
</div>
</div>
</div>
@endforeach
</div>
<!-- Total Balance -->
<div class="mt-6 rounded-lg border-2 border-indigo-300 bg-indigo-50 p-6">
<div class="flex items-center justify-between">
<div>
<dt class="text-base font-medium text-indigo-900">總餘額</dt>
<dd class="mt-2 text-4xl font-bold {{ $totalBalance >= 0 ? 'text-indigo-700' : 'text-red-700' }}">
NT$ {{ number_format($totalBalance, 2) }}
</dd>
</div>
<svg class="h-16 w-16 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z" />
</svg>
</div>
</div>
@else
<div class="text-center py-8 text-gray-500">
暫無帳戶餘額記錄
</div>
@endif
</div>
</div>
<!-- Monthly Summary -->
<div class="bg-white shadow sm:rounded-lg">
<div class="px-4 py-5 sm:p-6">
<h3 class="text-lg font-medium leading-6 text-gray-900 mb-4">本月交易摘要 ({{ now()->format('Y年m月') }})</h3>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
<!-- Monthly Receipts -->
<div class="rounded-lg border border-green-200 bg-green-50 p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-10 w-10 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 11l5-5m0 0l5 5m-5-5v12" />
</svg>
</div>
<div class="ml-4 flex-1">
<dt class="text-sm font-medium text-gray-700">本月收入</dt>
<dd class="mt-1 text-2xl font-semibold text-green-700">
NT$ {{ number_format($monthlySummary['receipts'], 2) }}
</dd>
</div>
</div>
</div>
<!-- Monthly Payments -->
<div class="rounded-lg border border-red-200 bg-red-50 p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-10 w-10 text-red-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 13l-5 5m0 0l-5-5m5 5V6" />
</svg>
</div>
<div class="ml-4 flex-1">
<dt class="text-sm font-medium text-gray-700">本月支出</dt>
<dd class="mt-1 text-2xl font-semibold text-red-700">
NT$ {{ number_format($monthlySummary['payments'], 2) }}
</dd>
</div>
</div>
</div>
<!-- Net Change -->
<div class="rounded-lg border border-blue-200 bg-blue-50 p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<svg class="h-10 w-10 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
</svg>
</div>
<div class="ml-4 flex-1">
<dt class="text-sm font-medium text-gray-700">淨變動</dt>
@php
$netChange = $monthlySummary['receipts'] - $monthlySummary['payments'];
@endphp
<dd class="mt-1 text-2xl font-semibold {{ $netChange >= 0 ? 'text-green-700' : 'text-red-700' }}">
{{ $netChange >= 0 ? '+' : '' }} NT$ {{ number_format($netChange, 2) }}
</dd>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Notes -->
<div class="bg-yellow-50 border border-yellow-200 rounded-lg p-4 print:hidden">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-yellow-800">報表說明</h3>
<div class="mt-2 text-sm text-yellow-700">
<ul class="list-disc pl-5 space-y-1">
<li>餘額為即時數據,以最後一筆分錄的交易後餘額為準</li>
<li>本月交易摘要統計當月 ({{ now()->format('Y-m') }}) 的所有交易</li>
<li>建議每日核對餘額,確保記錄正確</li>
<li>如發現餘額異常,請檢查分錄記錄是否有誤</li>
</ul>
</div>
</div>
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 text-gray-900">
<h3 class="font-semibold mb-4">本月摘要</h3>
<p>收入:{{ $monthlySummary['receipts'] ?? 0 }}</p>
<p>支出:{{ $monthlySummary['payments'] ?? 0 }}</p>
</div>
</div>
</div>
</div>
@push('styles')
<style>
@media print {
.print\:hidden {
display: none !important;
}
body {
print-color-adjust: exact;
-webkit-print-color-adjust: exact;
}
}
</style>
@endpush
</x-app-layout>

View File

@@ -21,7 +21,7 @@ A new finance document has been submitted and is awaiting cashier review.
This document includes an attachment for review.
@endif
<x-mail::button :url="route('finance.show', $document)">
<x-mail::button :url="route('admin.finance.show', $document)">
Review Document
</x-mail::button>

View File

@@ -19,6 +19,8 @@ Go to Dashboard
If you have any questions, please contact us.
<p style="display:none">&lt; &gt;</p>
Thanks,<br>
{{ config('app.name') }}
</x-mail::message>

View File

@@ -1,7 +1,7 @@
<x-mail::message>
# Payment Verification - Action Required
Your payment submission has been reviewed and requires your attention.
Your payment submission has been reviewed and was rejected, and requires your attention.
**Payment:** TWD {{ number_format($payment->amount, 0) }} on {{ $payment->paid_at->format('Y-m-d') }}

View File

@@ -1,7 +1,7 @@
<x-mail::message>
# New Payment for Verification
A new payment has been submitted and requires cashier verification.
A new payment has been submitted and requires cashier verification. Please review the details below.
**Member:** {{ $payment->member->full_name }}
**Amount:** TWD {{ number_format($payment->amount, 0) }}

View File

@@ -3,7 +3,7 @@
Thank you, {{ $payment->member->full_name }}!
Your payment has been received and is currently under review by our team.
Your payment has been submitted successfully and is currently under review by our team.
**Payment Details:**
- **Amount:** TWD {{ number_format($payment->amount, 0) }}

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" x-data="themeSwitcher()" x-init="init()" :class="{'dark': isDark}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -14,13 +14,13 @@
<!-- Scripts -->
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body class="font-sans antialiased">
<div class="min-h-screen bg-gray-100">
<body class="font-sans antialiased bg-gray-50 text-slate-900 transition-colors duration-300 dark:bg-slate-900 dark:text-slate-100">
<div class="min-h-screen">
@include('layouts.navigation')
<!-- Page Heading -->
@if (isset($header))
<header class="bg-white shadow">
<header class="bg-white/80 shadow dark:bg-slate-800/80 backdrop-blur">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
{{ $header }}
</div>
@@ -28,9 +28,34 @@
@endif
<!-- Page Content -->
<main>
<main class="bg-gray-50 dark:bg-slate-900">
{{ $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>

View File

@@ -1,4 +1,4 @@
<nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
<nav x-data="{ open: false }" class="bg-white border-b border-gray-100 dark:bg-slate-900 dark:border-slate-800 transition-colors duration-300">
<!-- Primary Navigation Menu -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
@@ -6,7 +6,7 @@
<!-- Logo -->
<div class="shrink-0 flex items-center">
<a href="{{ route('dashboard') }}">
<x-application-logo class="block h-9 w-auto fill-current text-gray-800" />
<x-application-logo class="block h-9 w-auto fill-current text-gray-800 dark:text-slate-100" />
</a>
</div>
@@ -62,10 +62,26 @@
</div>
<!-- Settings Dropdown -->
<div class="hidden sm:flex sm:items-center sm:ms-6">
<div class="hidden sm:flex sm:items-center sm:ms-6 space-x-3">
<button
type="button"
@click="$root.toggle()"
class="inline-flex items-center px-3 py-2 rounded-md text-sm font-medium border border-transparent bg-gray-100 text-gray-600 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:bg-slate-800 dark:text-slate-100 dark:hover:bg-slate-700"
aria-label="Toggle theme"
>
<span x-show="$root.isDark" class="flex items-center space-x-2">
<svg class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M17.293 13.293a1 1 0 00-1.414 0l-.586.586a6 6 0 01-8.486-8.486l.586-.586A1 1 0 006.172 3H6a1 1 0 00-.707.293l-.586.586a8 8 0 1011.314 11.314l.586-.586a1 1 0 000-1.414l-.314-.314z"/></svg>
<span class="sr-only">Switch to light</span>
</span>
<span x-show="!$root.isDark" class="flex items-center space-x-2">
<svg class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M10 3a1 1 0 011 1v1a1 1 0 11-2 0V4a1 1 0 011-1zm0 8a3 3 0 100-6 3 3 0 000 6zm5.657-6.657a1 1 0 010 1.414l-.707.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 9a1 1 0 110 2h-1a1 1 0 110-2h1zM5 9a1 1 0 100 2H4a1 1 0 100-2h1zm10.657 6.657a1 1 0 00-1.414 0l-.707.707a1 1 0 001.414 1.414l.707-.707a1 1 0 000-1.414zM10 16a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zm-5.657-.343a1 1 0 010-1.414l.707-.707a1 1 0 011.414 1.414l-.707.707a1 1 0 01-1.414 0z"/></svg>
<span class="sr-only">Switch to dark</span>
</span>
</button>
<x-dropdown align="right" width="48">
<x-slot name="trigger">
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150">
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150 dark:bg-slate-800 dark:text-slate-100 dark:hover:text-white">
<div>{{ Auth::user()->name }}</div>
<div class="ms-1">

View File

@@ -0,0 +1,67 @@
<x-guest-layout>
<div class="max-w-3xl mx-auto py-10">
<div class="card shadow-lg">
<div class="card-header flex items-center justify-between">
<div>
<p class="text-xs uppercase tracking-wide text-slate-500 dark:text-slate-400">Beta / Internal</p>
<h1 class="text-lg font-semibold text-slate-800 dark:text-slate-100">問題回報</h1>
</div>
</div>
<div class="card-body space-y-6">
@if (session('status'))
<div class="rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-green-800 dark:border-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-100">
{{ session('status') }}
</div>
@endif
<form action="{{ route('public.bug-report.store') }}" method="POST" enctype="multipart/form-data" class="space-y-4">
@csrf
<div>
<label class="block text-sm font-medium mb-1">標題 *</label>
<input type="text" name="title" value="{{ old('title') }}" required class="w-full">
@error('title') <p class="text-sm text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium mb-1">描述(可貼重現步驟) *</label>
<textarea name="description" rows="5" required class="w-full">{{ old('description') }}</textarea>
@error('description') <p class="text-sm text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium mb-1">嚴重度 *</label>
<select name="severity" required class="w-full">
<option value="low" @selected(old('severity') === 'low')>UI/文案小問題)</option>
<option value="medium" @selected(old('severity') === 'medium')>中(功能可用但有異常)</option>
<option value="high" @selected(old('severity') === 'high')>高(阻斷流程/錯誤)</option>
</select>
@error('severity') <p class="text-sm text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium mb-1">回報人 Email選填便於聯繫</label>
<input type="email" name="reporter_email" value="{{ old('reporter_email') }}" class="w-full">
@error('reporter_email') <p class="text-sm text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
</div>
<div>
<label class="block text-sm font-medium mb-1">附件(選填,最多 10MB</label>
<div class="upload-area">
<p>拖曳或選擇檔案(螢幕截圖 / PDF</p>
<input type="file" name="attachment" class="w-full text-sm text-slate-600 dark:text-slate-200">
</div>
@error('attachment') <p class="text-sm text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div class="flex justify-end">
<button type="submit" class="inline-flex items-center px-4 py-2 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-400">
送出回報
</button>
</div>
</form>
</div>
</div>
</div>
</x-guest-layout>