Fix audit logs and issue reports pages, rename Issues to Tasks
修復稽核日誌與任務報表頁面,並將「問題」改名為「任務」 ## Changes 變更內容 ### Bug Fixes 錯誤修復 1. Fixed audit logs page 500 error - Added missing $auditableTypes variable to controller - Changed $events to $actions in view - Added description and ip_address columns to audit_logs table - Updated AuditLog model fillable array 2. Fixed issue reports page SQLite compatibility errors - Replaced MySQL NOW() function with Laravel now() helper - Replaced TIMESTAMPDIFF() with PHP-based date calculation - Fixed request->date() default value handling ### Feature Changes 功能變更 3. Renamed "Issues" terminology to "Tasks" throughout the system - Updated navigation menus (Admin: Issues → Admin: Tasks) - Updated all issue-related views to use task terminology - Changed Chinese labels from "問題" to "任務" - Updated dashboard, issue tracker, and reports pages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,17 +2,17 @@
|
||||
<x-slot name="header">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
||||
台灣尤塞氏症暨視聽弱協會|工作桌面
|
||||
</h2>
|
||||
<p class="text-sm text-gray-500 mt-1">會員服務、財務簽核、文件與公告都在這裡。</p>
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">會員服務、財務簽核、文件與公告都在這裡。</p>
|
||||
</div>
|
||||
<div class="hidden sm:flex items-center gap-3">
|
||||
<a href="{{ route('member.dashboard') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md bg-blue-50 text-blue-700 hover:bg-blue-100 border border-blue-200">
|
||||
<a href="{{ route('member.dashboard') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md bg-blue-50 dark:bg-blue-900 text-blue-700 dark:text-blue-200 hover:bg-blue-100 dark:hover:bg-blue-800 border border-blue-200 dark:border-blue-700">
|
||||
我的會籍/繳費
|
||||
</a>
|
||||
@can('create_finance_documents')
|
||||
<a href="{{ route('admin.finance.create') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md bg-emerald-50 text-emerald-700 hover:bg-emerald-100 border border-emerald-200">
|
||||
<a href="{{ route('admin.finance.create') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md bg-emerald-50 dark:bg-emerald-900 text-emerald-700 dark:text-emerald-200 hover:bg-emerald-100 dark:hover:bg-emerald-800 border border-emerald-200 dark:border-emerald-700">
|
||||
建立財務申請
|
||||
</a>
|
||||
@endcan
|
||||
@@ -24,11 +24,11 @@
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
|
||||
<!-- Primary cards -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div class="bg-white shadow-sm sm:rounded-lg border border-gray-100 p-5">
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg border border-gray-100 dark:border-gray-700 p-5">
|
||||
<div class="flex items-start justify-between">
|
||||
<div>
|
||||
<div class="text-sm font-semibold text-gray-700">會員狀態</div>
|
||||
<p class="mt-1 text-sm text-gray-500">查看會籍期限、繳費紀錄、下載收據</p>
|
||||
<div class="text-sm font-semibold text-gray-700 dark:text-gray-300">會員狀態</div>
|
||||
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">查看會籍期限、繳費紀錄、下載收據</p>
|
||||
</div>
|
||||
<span class="text-2xl">🎫</span>
|
||||
</div>
|
||||
@@ -36,18 +36,18 @@
|
||||
<a href="{{ route('member.dashboard') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md bg-blue-600 text-white hover:bg-blue-700">
|
||||
前往會員專區
|
||||
</a>
|
||||
<a href="{{ route('member.payments.create') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 text-gray-700 hover:bg-gray-50">
|
||||
<a href="{{ route('member.payments.create') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
自助繳費
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(Auth::user()->can('create_finance_documents') || Auth::user()->can('view_finance_documents'))
|
||||
<div class="bg-white shadow-sm sm:rounded-lg border border-gray-100 p-5">
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg border border-gray-100 dark:border-gray-700 p-5">
|
||||
<div class="flex items-start justify-between">
|
||||
<div>
|
||||
<div class="text-sm font-semibold text-gray-700">財務申請/審核</div>
|
||||
<p class="mt-1 text-sm text-gray-500">申請、審核、付款、對帳全流程</p>
|
||||
<div class="text-sm font-semibold text-gray-700 dark:text-gray-300">財務申請/審核</div>
|
||||
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">申請、審核、付款、對帳全流程</p>
|
||||
</div>
|
||||
<span class="text-2xl">💼</span>
|
||||
</div>
|
||||
@@ -58,7 +58,7 @@
|
||||
</a>
|
||||
@endcan
|
||||
@can('view_finance_documents')
|
||||
<a href="{{ route('admin.finance.index') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 text-gray-700 hover:bg-gray-50">
|
||||
<a href="{{ route('admin.finance.index') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
查看案件列表
|
||||
</a>
|
||||
@endcan
|
||||
@@ -67,25 +67,25 @@
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasRole(['admin', 'membership_manager']) || Auth::user()->can('view_audit_logs'))
|
||||
<div class="bg-white shadow-sm sm:rounded-lg border border-gray-100 p-5">
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg border border-gray-100 dark:border-gray-700 p-5">
|
||||
<div class="flex items-start justify-between">
|
||||
<div>
|
||||
<div class="text-sm font-semibold text-gray-700">管理/維運</div>
|
||||
<p class="mt-1 text-sm text-gray-500">會員匯入、角色權限、審計與問題追蹤</p>
|
||||
<div class="text-sm font-semibold text-gray-700 dark:text-gray-300">管理/維運</div>
|
||||
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">會員匯入、角色權限、審計與任務追蹤</p>
|
||||
</div>
|
||||
<span class="text-2xl">🛡️</span>
|
||||
</div>
|
||||
<div class="mt-4 flex gap-3 flex-wrap">
|
||||
@hasrole('admin|membership_manager')
|
||||
<a href="{{ route('admin.members.index') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 text-gray-700 hover:bg-gray-50">
|
||||
<a href="{{ route('admin.members.index') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
會員管理
|
||||
</a>
|
||||
@endhasrole
|
||||
@role('admin')
|
||||
<a href="{{ route('admin.roles.index') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 text-gray-700 hover:bg-gray-50">
|
||||
<a href="{{ route('admin.roles.index') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
角色與權限
|
||||
</a>
|
||||
<a href="{{ route('admin.audit.index') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 text-gray-700 hover:bg-gray-50">
|
||||
<a href="{{ route('admin.audit.index') }}" class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
審計日誌
|
||||
</a>
|
||||
@endrole
|
||||
@@ -95,60 +95,60 @@
|
||||
</div>
|
||||
|
||||
<!-- To-do by role (all roles see the buckets) -->
|
||||
@if(Auth::user()->hasRole(['admin', 'finance_cashier', 'payment_cashier', 'finance_accountant', 'payment_accountant', 'finance_chair', 'payment_chair']) || Auth::user()->can('create_finance_documents'))
|
||||
<div class="bg-white shadow-sm sm:rounded-lg border border-gray-100 p-6">
|
||||
@if(Auth::user()->hasRole(['admin', 'finance_cashier', 'finance_accountant', 'finance_chair']) || Auth::user()->can('create_finance_documents'))
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg border border-gray-100 dark:border-gray-700 p-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">待辦總覽</h3>
|
||||
<p class="text-sm text-gray-500">依職責挑選你需要處理的事項。</p>
|
||||
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">待辦總覽</h3>
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">依職責挑選你需要處理的事項。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
@can('create_finance_documents')
|
||||
<div class="p-4 rounded-lg border border-gray-100 bg-slate-50">
|
||||
<div class="p-4 rounded-lg border border-gray-100 dark:border-gray-700 bg-slate-50 dark:bg-gray-700">
|
||||
<div class="flex items-center justify-between">
|
||||
<h4 class="text-sm font-semibold text-gray-800">申請人 / 會員</h4><span>📝</span>
|
||||
<h4 class="text-sm font-semibold text-gray-800 dark:text-gray-200">申請人 / 會員</h4><span>📝</span>
|
||||
</div>
|
||||
<ul class="mt-3 space-y-2 text-sm text-gray-700">
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.finance.create') }}">建立財務申請</a></li>
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.finance.index') }}">查看我的申請進度</a></li>
|
||||
<li><a class="hover:text-blue-600" href="{{ route('member.dashboard') }}">查看會籍與繳費紀錄</a></li>
|
||||
<ul class="mt-3 space-y-2 text-sm text-gray-700 dark:text-gray-300">
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.finance.create') }}">建立財務申請</a></li>
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.finance.index') }}">查看我的申請進度</a></li>
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('member.dashboard') }}">查看會籍與繳費紀錄</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endcan
|
||||
@hasrole('finance_cashier|payment_cashier|admin')
|
||||
<div class="p-4 rounded-lg border border-gray-100 bg-slate-50">
|
||||
@hasrole('finance_cashier|admin')
|
||||
<div class="p-4 rounded-lg border border-gray-100 dark:border-gray-700 bg-slate-50 dark:bg-gray-700">
|
||||
<div class="flex items-center justify-between">
|
||||
<h4 class="text-sm font-semibold text-gray-800">出納</h4><span>💰</span>
|
||||
<h4 class="text-sm font-semibold text-gray-800 dark:text-gray-200">出納</h4><span>💰</span>
|
||||
</div>
|
||||
<ul class="mt-3 space-y-2 text-sm text-gray-700">
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.finance.index') }}">待出納審核的申請</a></li>
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.payment-orders.index') }}">待覆核/執行的付款單</a></li>
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.cashier-ledger.index') }}">填寫現金簿/匯出報表</a></li>
|
||||
<ul class="mt-3 space-y-2 text-sm text-gray-700 dark:text-gray-300">
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.finance.index') }}">待出納審核的申請</a></li>
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.payment-orders.index') }}">待覆核/執行的付款單</a></li>
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.cashier-ledger.index') }}">填寫現金簿/匯出報表</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endhasrole
|
||||
@hasrole('finance_accountant|payment_accountant|admin')
|
||||
<div class="p-4 rounded-lg border border-gray-100 bg-slate-50">
|
||||
@hasrole('finance_accountant|admin')
|
||||
<div class="p-4 rounded-lg border border-gray-100 dark:border-gray-700 bg-slate-50 dark:bg-gray-700">
|
||||
<div class="flex items-center justify-between">
|
||||
<h4 class="text-sm font-semibold text-gray-800">會計</h4><span>📊</span>
|
||||
<h4 class="text-sm font-semibold text-gray-800 dark:text-gray-200">會計</h4><span>📊</span>
|
||||
</div>
|
||||
<ul class="mt-3 space-y-2 text-sm text-gray-700">
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.finance.index') }}">待會計審核的申請</a></li>
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.payment-orders.index') }}">製作/更新付款單</a></li>
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.transactions.index') }}">建立交易分錄</a></li>
|
||||
<ul class="mt-3 space-y-2 text-sm text-gray-700 dark:text-gray-300">
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.finance.index') }}">待會計審核的申請</a></li>
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.payment-orders.index') }}">製作/更新付款單</a></li>
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.transactions.index') }}">建立交易分錄</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endhasrole
|
||||
@hasrole('finance_chair|payment_chair|admin')
|
||||
<div class="p-4 rounded-lg border border-gray-100 bg-slate-50">
|
||||
@hasrole('finance_chair|admin')
|
||||
<div class="p-4 rounded-lg border border-gray-100 dark:border-gray-700 bg-slate-50 dark:bg-gray-700">
|
||||
<div class="flex items-center justify-between">
|
||||
<h4 class="text-sm font-semibold text-gray-800">理事長/理事</h4><span>✅</span>
|
||||
<h4 class="text-sm font-semibold text-gray-800 dark:text-gray-200">理事長/理事</h4><span>✅</span>
|
||||
</div>
|
||||
<ul class="mt-3 space-y-2 text-sm text-gray-700">
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.finance.index') }}">待核准的中額/大額申請</a></li>
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.bank-reconciliations.index') }}">待核准的銀行調節表</a></li>
|
||||
<li><a class="hover:text-blue-600" href="{{ route('admin.roles.index') }}">角色/權限檢視</a></li>
|
||||
<ul class="mt-3 space-y-2 text-sm text-gray-700 dark:text-gray-300">
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.finance.index') }}">待核准的中額/大額申請</a></li>
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.bank-reconciliations.index') }}">待核准的銀行調節表</a></li>
|
||||
<li><a class="hover:text-blue-600 dark:hover:text-blue-400" href="{{ route('admin.roles.index') }}">角色/權限檢視</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endhasrole
|
||||
@@ -158,44 +158,46 @@
|
||||
|
||||
<!-- Issues / Documents -->
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
<div class="bg-white shadow-sm sm:rounded-lg border border-gray-100 p-6">
|
||||
@if(Auth::user() && (Auth::user()->hasRole(['admin', 'membership_manager', 'finance_accountant', 'staff']) || Auth::user()->canAny(['view_finance_documents', 'view_accounting_transactions', 'manage_system_settings'])))
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg border border-gray-100 dark:border-gray-700 p-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-lg font-semibold text-gray-900">問題追蹤</h3>
|
||||
<a href="{{ route('admin.issues.create') }}" class="text-sm text-blue-600 hover:text-blue-700">建立問題</a>
|
||||
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">任務追蹤</h3>
|
||||
<a href="{{ route('admin.issues.create') }}" class="text-sm text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300">建立任務</a>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-600">回報系統/流程問題,追蹤討論、附件與狀態。</p>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">內部項目管理、工作追蹤與協作工具。</p>
|
||||
<div class="mt-3 flex gap-3 text-sm">
|
||||
<a href="{{ route('admin.issues.index') }}" class="inline-flex items-center px-3 py-2 rounded-md border border-gray-200 text-gray-700 hover:bg-gray-50">查看全部</a>
|
||||
<a href="{{ route('admin.issue-reports.index') }}" class="inline-flex items-center px-3 py-2 rounded-md border border-gray-200 text-gray-700 hover:bg-gray-50">統計報表</a>
|
||||
<a href="{{ route('admin.issues.index') }}" class="inline-flex items-center px-3 py-2 rounded-md border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">查看全部</a>
|
||||
<a href="{{ route('admin.issue-reports.index') }}" class="inline-flex items-center px-3 py-2 rounded-md border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">統計報表</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($recentDocuments->isNotEmpty())
|
||||
<div class="bg-white shadow-sm sm:rounded-lg border border-gray-100">
|
||||
<div class="px-6 py-5 border-b border-gray-200 flex items-center justify-between">
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg border border-gray-100 dark:border-gray-700">
|
||||
<div class="px-6 py-5 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between">
|
||||
<div>
|
||||
<h3 class="text-lg font-semibold text-gray-900">最新文件/公告</h3>
|
||||
<p class="text-sm text-gray-500">協會文件、公告與外部發佈。</p>
|
||||
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">最新文件/公告</h3>
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">協會文件、公告與外部發佈。</p>
|
||||
</div>
|
||||
<a href="{{ route('documents.index') }}" class="text-sm text-blue-600 hover:text-blue-700">查看全部 →</a>
|
||||
<a href="{{ route('documents.index') }}" class="text-sm text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300">查看全部 →</a>
|
||||
</div>
|
||||
<div class="divide-y divide-gray-200">
|
||||
<div class="divide-y divide-gray-200 dark:divide-gray-700">
|
||||
@foreach($recentDocuments as $document)
|
||||
<div class="px-6 py-4 hover:bg-gray-50 transition">
|
||||
<div class="px-6 py-4 hover:bg-gray-50 dark:hover:bg-gray-700 transition">
|
||||
<div class="flex items-start">
|
||||
<div class="flex-shrink-0 text-3xl mr-4">
|
||||
{{ $document->currentVersion?->getFileIcon() ?? '📄' }}
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<h4 class="text-sm font-medium text-gray-900">
|
||||
<a href="{{ route('documents.public.show', $document->public_uuid) }}" class="hover:text-blue-600">
|
||||
<h4 class="text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||
<a href="{{ route('documents.public.show', $document->public_uuid) }}" class="hover:text-blue-600 dark:hover:text-blue-400">
|
||||
{{ $document->title }}
|
||||
</a>
|
||||
</h4>
|
||||
@if($document->description)
|
||||
<p class="mt-1 text-sm text-gray-500 line-clamp-1">{{ $document->description }}</p>
|
||||
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400 line-clamp-1">{{ $document->description }}</p>
|
||||
@endif
|
||||
<div class="mt-2 flex items-center space-x-4 text-xs text-gray-500">
|
||||
<div class="mt-2 flex items-center space-x-4 text-xs text-gray-500 dark:text-gray-400">
|
||||
<span>{{ $document->category->icon }} {{ $document->category->name }}</span>
|
||||
<span>📅 {{ $document->created_at->format('Y-m-d') }}</span>
|
||||
<span>📏 {{ $document->currentVersion?->getFileSizeHuman() }}</span>
|
||||
@@ -203,7 +205,7 @@
|
||||
</div>
|
||||
<div class="ml-4 flex-shrink-0">
|
||||
<a href="{{ route('documents.public.download', $document->public_uuid) }}"
|
||||
class="inline-flex items-center px-3 py-1.5 border border-gray-300 rounded-md text-xs font-medium text-gray-700 bg-white hover:bg-gray-50">
|
||||
class="inline-flex items-center px-3 py-1.5 border border-gray-300 dark:border-gray-600 rounded-md text-xs font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
||||
下載
|
||||
</a>
|
||||
</div>
|
||||
@@ -213,6 +215,41 @@
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Recent Announcements -->
|
||||
@if(isset($recentAnnouncements) && $recentAnnouncements->isNotEmpty())
|
||||
<div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg border border-gray-100 dark:border-gray-700">
|
||||
<div class="border-b border-gray-100 dark:border-gray-700 px-6 py-4">
|
||||
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">📢 最新公告</h3>
|
||||
</div>
|
||||
<div class="divide-y divide-gray-100 dark:divide-gray-700">
|
||||
@foreach($recentAnnouncements as $announcement)
|
||||
<div class="px-6 py-4 hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors">
|
||||
<div class="flex items-start">
|
||||
@if($announcement->is_pinned)
|
||||
<span class="mr-2 text-blue-500 flex-shrink-0" title="置頂公告">📌</span>
|
||||
@endif
|
||||
<div class="flex-1 min-w-0">
|
||||
<h4 class="text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1">
|
||||
{{ $announcement->title }}
|
||||
</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 line-clamp-2 mb-2">
|
||||
{{ $announcement->getExcerpt(120) }}
|
||||
</p>
|
||||
<div class="flex items-center space-x-3 text-xs text-gray-500 dark:text-gray-400">
|
||||
<span>{{ $announcement->published_at?->diffForHumans() ?? $announcement->created_at->diffForHumans() }}</span>
|
||||
@if($announcement->view_count > 0)
|
||||
<span>•</span>
|
||||
<span>👁 {{ $announcement->view_count }} 次</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user