@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
══════════════════════════════════════════════ --}}
{{-- 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
{{-- 版型選擇按鈕 --}}
{{-- 主題選擇按鈕 --}}
{{-- 轉場效果按鈕 --}}
{{-- 物件動畫按鈕 --}}
{{-- 插入選單 --}}
{{-- 隱藏圖片上傳 input --}}
{{-- 放映按鈕 --}}
@endif
{{-- 投影片畫布 --}}
{{-- 主題裝飾層(由 JS 控制)--}}
{{-- 標題 --}}
{{-- 內容 --}}
{{-- 雙欄版型第二欄(hidden by default)--}}
{{-- 備忘稿 --}}
@elseif($isSheet)
@if($canEdit)
@endif
—
fx
{{-- 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 --}}
| Ctrl+S | 儲存 |
| Ctrl+H | 尋找與取代 |
| Ctrl+Z | 復原 |
| Ctrl+Y | 重做 |
| 格式 |
| Ctrl+B | 粗體 |
| Ctrl+I | 斜體 |
| Ctrl+U | 底線 |
{{-- Share --}}
@if($doc->share_token)已公開@else未公開@endif
任何有連結的人皆可查看(唯讀)
已複製到剪貼簿
{{-- ── 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