{{-- 文件功能:星光留言板页面(含公共留言、收件箱、发件箱三个分类) 支持公开留言和悄悄话私信功能 @extends layouts.app --}} @extends('layouts.app') @section('title', '星光留言板 - 飘落流星') @section('nav-icon', '✉️') @section('nav-title', '星光留言板') @section('nav-left') 返回大厅 @endsection @section('nav-right') @endsection @section('body-class', 'flex flex-col h-screen overflow-hidden') @section('body-data', "x-data=\"{ showWriteForm: false, towho: '{{ $defaultTo }}' }\"") @section('content') {{-- 验证错误信息 --}} @if (isset($errors) && $errors->any())
@endif {{-- 写信/留言表单区 (Alpine 控制显隐) --}}
@csrf
{{-- 主体内容区 --}}
{{-- 左侧:分类导航 --}} {{-- 右侧:留言流列表 --}}
@forelse($messages as $msg) @php $isSecret = $msg->secret == 1; $isToMe = Auth::check() && $msg->towho === Auth::user()->username; $isFromMe = Auth::check() && $msg->who === Auth::user()->username; @endphp
@if ($isSecret)
🔒 私密信件
@endif
{{ $msg->who }} {{ $msg->towho ?: '大家' }} 留言:
{{ \Carbon\Carbon::parse($msg->post_time)->diffForHumans() }} @if ($isFromMe || $isToMe || (Auth::check() && Auth::user()->user_level >= 15))
@csrf @method('DELETE')
@endif
{!! nl2br(e($msg->text_body)) !!}
@if (!Auth::check() || $msg->who !== Auth::user()->username)
@endif
@empty
📭

暂无信件

这里是空空如也的荒原。

@endforelse {{-- 分页 --}}
{{ $messages->links() }}
{{-- 移动端底部分类栏 --}}
🌍 公共墙 📥 收件箱 📤 发件箱
@endsection