@extends('layouts.app') @section('title', '#' . $issue['id'] . ' ' . $issue['subject']) @section('content')
{{-- 頁首導覽 --}}
專案管理 {{ $issue['project']['name'] }} {{ $issue['id'] }}
{{-- 標題區 --}}

#{{ $issue['id'] }} {{ $issue['subject'] }}

@php $priColor = match($issue['priority']['name'] ?? '') { 'Urgent', '緊急' => 'danger', 'Immediate', '立即' => 'dark', 'High', '高' => 'warning', 'Low', '低' => 'secondary', default => 'info', }; @endphp {{ $issue['priority']['name'] ?? '-' }}
{{-- 屬性列 --}}
專案
{{ $issue['project']['name'] ?? '-' }}
追蹤標籤
{{ $issue['tracker']['name'] ?? '-' }}
狀態
{{ $issue['status']['name'] ?? '-' }}
指派給
{{ $issue['assigned_to']['name'] ?? '未指派' }}
建立者
{{ $issue['author']['name'] ?? '-' }}
建立日期
{{ \Carbon\Carbon::parse($issue['created_on'])->format('Y-m-d') }}
更新日期
{{ \Carbon\Carbon::parse($issue['updated_on'])->format('Y-m-d') }}
@if (!empty($issue['due_date']))
到期日
{{ $issue['due_date'] }}
@endif @if (isset($issue['estimated_hours']) && $issue['estimated_hours'] !== null)
預估工時
{{ $issue['estimated_hours'] }}小時
@endif
{{-- 完成度 --}} @php $done = $issue['done_ratio'] ?? 0; @endphp
完成度{{ $done }}%
{{-- 描述 --}} @if (!empty($issue['description']))
描述
{{ $issue['description'] }}
@endif {{-- 附件 --}} @if (!empty($issue['attachments']))
附件 {{ count($issue['attachments']) }}
@foreach ($issue['attachments'] as $att) @php $ext = strtolower(pathinfo($att['filename'], PATHINFO_EXTENSION)); $icon = match(true) { in_array($ext, ['jpg','jpeg','png','gif','webp','svg']) => 'bi-file-image-fill text-success', in_array($ext, ['pdf']) => 'bi-file-pdf-fill text-danger', in_array($ext, ['doc','docx']) => 'bi-file-word-fill text-primary', in_array($ext, ['xls','xlsx','csv']) => 'bi-file-excel-fill text-success', in_array($ext, ['ppt','pptx']) => 'bi-file-ppt-fill text-warning', in_array($ext, ['zip','rar','7z','tar','gz']) => 'bi-file-zip-fill text-secondary', in_array($ext, ['mp4','mov','avi','mkv']) => 'bi-file-play-fill text-purple', default => 'bi-file-earmark-fill text-secondary', }; $kb = round($att['filesize'] / 1024, 1); $size = $kb >= 1024 ? round($kb / 1024, 1) . ' MB' : $kb . ' KB'; @endphp @endforeach
@endif {{-- 相關議題 --}} @if (!empty($issue['relations']))
相關議題
@endif {{-- 留言記錄 --}} @php $fieldLabels = [ 'status_id' => '狀態', 'assigned_to_id' => '指派給', 'done_ratio' => '完成度', 'priority_id' => '優先權', 'tracker_id' => '追蹤標籤', 'subject' => '主旨', 'description' => '描述', 'due_date' => '到期日', 'start_date' => '開始日期', 'estimated_hours' => '預估工時', 'parent_id' => '父議題', 'is_private' => '私密', 'project_id' => '專案', 'fixed_version_id'=> '目標版本', 'category_id' => '分類', ]; // 解析 detail value 為人看得懂的文字 $resolveVal = function($name, $val) use ($statusMap, $priorityMap, $trackerMap, $userMap) { if ($val === null || $val === '') return '(已清除)'; return match($name) { 'status_id' => $statusMap[(int)$val] ?? "狀態 #{$val}", 'priority_id' => $priorityMap[(int)$val] ?? "優先權 #{$val}", 'tracker_id' => $trackerMap[(int)$val] ?? "追蹤標籤 #{$val}", 'assigned_to_id' => $userMap[(int)$val] ?? "用戶 #{$val}", 'done_ratio' => $val . '%', 'is_private' => $val ? '是' : '否', default => $val, }; }; $journals = collect($issue['journals'] ?? [])->filter(fn($j) => !empty($j['notes']) || !empty($j['details'])); @endphp @if ($journals->isNotEmpty())
歷程記錄({{ $journals->count() }} 筆)
@foreach ($journals as $journal)
{{ $journal['user']['name'] ?? '系統' }} {{ \Carbon\Carbon::parse($journal['created_on'])->format('Y-m-d H:i') }}
{{-- 欄位變更記錄 --}} @if (!empty($journal['details']))
    @foreach ($journal['details'] as $detail) @php $fname = $detail['name']; $label = $fieldLabels[$fname] ?? $fname; $oldVal = $detail['old_value'] ?? null; $newVal = $detail['new_value'] ?? null; $oldText = $oldVal !== null ? $resolveVal($fname, $oldVal) : null; $newText = $resolveVal($fname, $newVal); @endphp
  • {{ $label }}: @if ($oldText !== null) {{ $oldText }} @endif {{ $newText }}
  • @endforeach
@endif {{-- 留言內容 --}} @if (!empty($journal['notes']))
{{ $journal['notes'] }}
@endif
@endforeach
@endif {{-- 編輯議題 Modal --}}
@endsection @push('scripts') @endpush