@extends('layouts.app') @section('title', $doc->title . ' — ' . $project->name) @push('styles') @endpush @section('content') @php $canEdit = auth()->user()->can('contributeDoc', $project); $isSheet = $fileType === 'spreadsheet'; $isPresentation = $fileType === 'presentation'; $backUrl = route("{$routePrefix}.index", array_filter(['project' => $project->id, 'folder_id' => $doc->parent_id])); $updateUrl = route("{$routePrefix}.update", [$project, $doc]); $logBaseUrl = route("{$routePrefix}.showLog", [$project, $doc, '__LOG__']); $shareUrl = route("{$routePrefix}.share", [$project, $doc]); $exportPdf = route("{$routePrefix}.exportPdf", [$project, $doc]); $exportOdt = route("{$routePrefix}.exportOdt", [$project, $doc]); $presenceUrl = route("{$routePrefix}.presence", [$project, $doc]); $logUrlMap = $logs->mapWithKeys(fn($l) => [ $l->id => route("{$routePrefix}.showLog", [$project, $doc, $l->id]) ]); $browserDocs = $project->docs() ->where('file_type', '!=', 'folder') ->where('type', $docType) ->orderBy('title') ->get(['id', 'title', 'file_type', 'updated_at']) ->map(fn($d) => [ 'id' => $d->id, 'title' => $d->title, 'type' => $d->file_type, 'updated' => $d->updated_at ? $d->updated_at->format('Y-m-d') : '', 'url' => route("{$routePrefix}.show", [$project, $d]), 'current' => $d->id === $doc->id, ])->values(); @endphp {{-- Escape outer container-fluid py-4 padding so doc chrome spans full viewport width --}}
{{-- ══════════════════════════════════════════════ ROW 1 — Title bar ══════════════════════════════════════════════ --}}
{{-- Mac traffic lights (visible only with data-theme="mac") --}}
{{-- Back --}} {{-- File icon --}} @if($isSheet) @elseif($isPresentation) @else @endif {{-- Title + star + breadcrumb --}}
@if($canEdit) @else
{{ $doc->title }}
@endif
{{ $project->name }} @if($doc->parent) {{ $doc->parent->title }} @endif
{{-- Right actions --}}
@if($canEdit) @endif
{{-- ══════════════════════════════════════════════ ROW 2 — Menu bar ══════════════════════════════════════════════ --}}
{{-- 檔案 --}} @if($canEdit) {{-- 編輯 --}} @endif {{-- 查看 --}} @if($canEdit && $isSheet) {{-- 格式 (試算表) --}} @endif @if($canEdit && !$isSheet) {{-- 插入 --}} {{-- 格式 --}} @endif {{-- 工具 --}} {{-- 說明 --}} {{-- Online presence (right side) --}}
{{-- Find & Replace bar --}} @if($canEdit && !$isSheet)
@endif {{-- Summernote toolbar row (document only, JS will move .note-toolbar here) --}} @if($canEdit && !$isSheet && !$isPresentation)
@endif {{-- Horizontal ruler (visible by default for documents, hidden for spreadsheets/presentations) --}} @if(!$isSheet && !$isPresentation)
@endif {{-- ══════════════════════════════════════════════ Content row: V-ruler (fixed) + body panels ══════════════════════════════════════════════ --}}
{{-- Vertical ruler fixed to left, not pushed by TOC --}} @if(!$isSheet && !$isPresentation)
@endif {{-- Body (TOC + editor + history) --}}
{{-- TOC panel (left) --}} @if(!$isSheet && !$isPresentation)
文件大綱
尚無標題
@endif {{-- Editor column + diff overlay --}}
{{-- TOC toggle tab (left edge, visible when TOC closed) --}} @if(!$isSheet && !$isPresentation) @endif {{-- Diff overlay --}}
已刪除 已新增
比對中…
{{-- Editor area --}}
@if($isPresentation) {{-- ══ 簡報編輯器 ══ --}}
{{-- 左側面板:縮圖 + 大綱 --}}
{{-- 分頁標籤 --}}
{{-- 縮圖列表 --}}
{{-- 大綱列表 --}} @if($canEdit)
@endif
{{-- 主畫布區 --}}
{{-- 投影片工具列 --}} @if($canEdit)
1 / 1
{{-- 版型選擇按鈕 --}}
{{-- 版型選擇面板 --}}
{{-- 主題選擇按鈕 --}}
{{-- 轉場效果按鈕 --}}
{{-- 物件動畫按鈕 --}}
{{-- 插入選單 --}}
{{-- 表格大小選擇器 --}}
1 × 1
{{-- 隱藏圖片上傳 input --}}
{{-- 放映按鈕 --}}
@endif {{-- 投影片畫布 --}}
{{-- 主題裝飾層(由 JS 控制)--}}
{{-- 標題 --}}
{{-- 內容 --}}
{{-- 雙欄版型第二欄(hidden by default)--}}
{{-- 備忘稿 --}}
備忘稿
@elseif($isSheet)
@if($canEdit)
{{-- 格式化 --}} {{-- 文字格式 --}} {{-- 水平對齊 --}} {{-- 垂直對齊 --}} {{-- 換行 + 旋轉 --}} {{-- 結構 --}}
@endif
fx
@if($canEdit) @endif
{{-- Sheet Find/Replace bar --}} @elseif($canEdit) @else
{!! $doc->content ?? '' !!}
@endif
{{-- History panel --}}
版本歷史
@forelse($logs as $log)
{{ $log->action === 'created' ? '建立' : ($log->action === 'updated' ? '更新' : '刪除') }}
{{ $log->user?->name ?? '—' }}
{{ $log->created_at->format('Y-m-d H:i') }}
點擊查看修改
@empty
尚無歷史紀錄
@endforelse
{{-- end content row --}} {{-- ══════════════════════════════════════════════ Modals ══════════════════════════════════════════════ --}} {{-- 開啟文件 --}} {{-- 頁面設定 --}} {{-- Word Count --}} {{-- Keyboard Shortcuts --}} {{-- Share --}} {{-- ── Copy modal ── --}}
{{-- /docChrome --}} @endsection @push('scripts') @if($isSheet) @else @if($canEdit) @endif @endif {{-- ── Diff engine ──────────────────────────────────────────── --}} {{-- ── Save (canEdit only) ─────────────────────────────────── --}} @if($canEdit) @endif {{-- ── Share JS ──────────────────────────────────────────────────── --}} {{-- ── Menu bar JS ─────────────────────────────────────────────── --}} {{-- ── Presence / who's online ────────────────────────────── --}} {{-- ── Ruler & Print Layout JS ─────────────────────────────── --}} {{-- ── TOC & Fullscreen JS ──────────────────────────────── --}} @endpush