{{-- 文件功能:星光留言板页面(含公共留言、收件箱、发件箱三个分类) 支持公开留言和悄悄话私信功能 @extends layouts.app --}} @extends('layouts.app') @section('title', '星光留言板 - 飘落流星') @section('nav-icon', '✉️') @section('nav-title', '星光留言板') @section('content')
{{-- 验证错误信息 --}} @if (isset($errors) && $errors->any())
@endif {{-- 弹窗遮罩层 --}} {{-- 主体内容区 --}}
{{-- 左侧:分类导航 --}} {{-- 右侧:留言流列表 --}}
@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 {{-- 消息卡片 --}}
{{-- 卡片头部:发件人 / 收件人 / 时间 --}}
{{-- 发件人头像占位 --}}
{{ mb_substr($msg->who, 0, 1) }}
{{ $msg->who }} {{ $msg->towho ?: '大家' }} @if ($isSecret) 🔒 您您话 @endif
{{ \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)) !!}

{{-- 回复TA按钒 --}} @if (!Auth::check() || $msg->who !== Auth::user()->username)
@endif
@empty
📭

暂无信件

这里是空空如也的荒原。

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