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>
171 lines
10 KiB
PHP
171 lines
10 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<div class="flex items-center justify-between">
|
|
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
|
公告詳情
|
|
</h2>
|
|
<div class="flex items-center space-x-2">
|
|
<a href="{{ route('admin.announcements.index') }}" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
← 返回列表
|
|
</a>
|
|
@if($announcement->canBeEditedBy(auth()->user()))
|
|
<a href="{{ route('admin.announcements.edit', $announcement) }}" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 dark:bg-indigo-500 px-3 py-2 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600">
|
|
編輯公告
|
|
</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="mx-auto max-w-4xl sm:px-6 lg:px-8 space-y-6">
|
|
@if (session('status'))
|
|
<div class="rounded-md bg-green-50 dark:bg-green-900/50 p-4">
|
|
<p class="text-sm font-medium text-green-800 dark:text-green-200">{{ session('status') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
@if (session('error'))
|
|
<div class="rounded-md bg-red-50 dark:bg-red-900/50 p-4">
|
|
<p class="text-sm font-medium text-red-800 dark:text-red-200">{{ session('error') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
<!-- Announcement Content -->
|
|
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg p-6">
|
|
<div class="mb-6">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-2xl font-bold text-gray-900 dark:text-gray-100">
|
|
@if($announcement->is_pinned)
|
|
<span class="text-blue-500" title="置頂公告">📌</span>
|
|
@endif
|
|
{{ $announcement->title }}
|
|
</h3>
|
|
<span class="inline-flex rounded-full px-3 py-1 text-sm font-semibold
|
|
@if($announcement->status === 'draft') bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300
|
|
@elseif($announcement->status === 'published') bg-green-100 dark:bg-green-900/50 text-green-800 dark:text-green-300
|
|
@else bg-yellow-100 dark:bg-yellow-900/50 text-yellow-800 dark:text-yellow-300
|
|
@endif">
|
|
{{ $announcement->getStatusLabel() }}
|
|
</span>
|
|
</div>
|
|
|
|
<div class="prose dark:prose-invert max-w-none">
|
|
<div class="whitespace-pre-wrap text-gray-700 dark:text-gray-300">{{ $announcement->content }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Metadata -->
|
|
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg p-6">
|
|
<h4 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4">公告資訊</h4>
|
|
<dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2">
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">存取權限</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $announcement->getAccessLevelLabel() }}</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">瀏覽次數</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $announcement->view_count }}</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">建立者</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $announcement->creator->name ?? 'N/A' }}</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">建立時間</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $announcement->created_at->format('Y-m-d H:i:s') }}</dd>
|
|
</div>
|
|
@if($announcement->published_at)
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">發布時間</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $announcement->published_at->format('Y-m-d H:i:s') }}
|
|
@if($announcement->isScheduled())
|
|
<span class="ml-2 inline-flex rounded-full bg-blue-100 dark:bg-blue-900/50 px-2 py-1 text-xs font-semibold text-blue-800 dark:text-blue-300">排程中</span>
|
|
@endif
|
|
</dd>
|
|
</div>
|
|
@endif
|
|
@if($announcement->expires_at)
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">過期時間</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $announcement->expires_at->format('Y-m-d H:i:s') }}
|
|
@if($announcement->isExpired())
|
|
<span class="ml-2 inline-flex rounded-full bg-red-100 dark:bg-red-900/50 px-2 py-1 text-xs font-semibold text-red-800 dark:text-red-300">已過期</span>
|
|
@endif
|
|
</dd>
|
|
</div>
|
|
@endif
|
|
@if($announcement->lastUpdatedBy)
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">最後更新者</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $announcement->lastUpdatedBy->name }}</dd>
|
|
</div>
|
|
<div>
|
|
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">最後更新時間</dt>
|
|
<dd class="mt-1 text-sm text-gray-900 dark:text-gray-100">{{ $announcement->updated_at->format('Y-m-d H:i:s') }}</dd>
|
|
</div>
|
|
@endif
|
|
</dl>
|
|
</div>
|
|
|
|
<!-- Actions -->
|
|
@if($announcement->canBeEditedBy(auth()->user()))
|
|
<div class="bg-white dark:bg-gray-800 shadow sm:rounded-lg p-6">
|
|
<h4 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4">操作</h4>
|
|
<div class="flex flex-wrap gap-3">
|
|
@if($announcement->isDraft() && auth()->user()->can('publish_announcements'))
|
|
<form method="POST" action="{{ route('admin.announcements.publish', $announcement) }}">
|
|
@csrf
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-green-600 dark:bg-green-500 px-4 py-2 text-sm font-medium text-white hover:bg-green-700 dark:hover:bg-green-600">
|
|
發布公告
|
|
</button>
|
|
</form>
|
|
@endif
|
|
|
|
@if($announcement->isPublished() && auth()->user()->can('publish_announcements'))
|
|
<form method="POST" action="{{ route('admin.announcements.archive', $announcement) }}">
|
|
@csrf
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
歸檔公告
|
|
</button>
|
|
</form>
|
|
@endif
|
|
|
|
@if(!$announcement->is_pinned && auth()->user()->can('edit_announcements'))
|
|
<form method="POST" action="{{ route('admin.announcements.pin', $announcement) }}">
|
|
@csrf
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
📌 置頂公告
|
|
</button>
|
|
</form>
|
|
@endif
|
|
|
|
@if($announcement->is_pinned && auth()->user()->can('edit_announcements'))
|
|
<form method="POST" action="{{ route('admin.announcements.unpin', $announcement) }}">
|
|
@csrf
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
取消置頂
|
|
</button>
|
|
</form>
|
|
@endif
|
|
|
|
@if(auth()->user()->can('delete_announcements'))
|
|
<form method="POST" action="{{ route('admin.announcements.destroy', $announcement) }}"
|
|
onsubmit="return confirm('確定要刪除此公告嗎?');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="inline-flex items-center rounded-md border border-transparent bg-red-600 dark:bg-red-500 px-4 py-2 text-sm font-medium text-white hover:bg-red-700 dark:hover:bg-red-600">
|
|
刪除公告
|
|
</button>
|
|
</form>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|