@extends('layouts.app') @section('title', $user->name . ' 的個人主頁') @push('styles') @endpush @section('content')
@if ($user->avatarUrl()) @else
{{ mb_substr($user->name, 0, 1) }}
@endif
{{ $user->name }}
—
{{ $user->email }}
@if ($user->department || $user->position)
{{ trim(($user->department ?? '') . ' ' . ($user->position ?? '')) }}
@endif @if ($user->phone)
{{ $user->phone }}
@endif @if ($user->birthday)
{{ $user->birthday->format('m/d') }}
@endif @if ($user->seat)
座位 {{ $user->seat }}
@endif
動態
@if ($isOwn)
@csrf
@error('media')
{{ $message }}
@enderror @foreach ((array) $errors->get('media.*') as $msgs) @foreach ($msgs as $m)
{{ $m }}
@endforeach @endforeach
@endif @if ($posts->isEmpty())
還沒有任何動態
@else @foreach ($posts as $post) @php $canManagePost = $isOwn || $me->isAdmin(); @endphp
@if ($post->user?->avatarUrl()) @else
{{ mb_substr($post->user->name ?? '?', 0, 1) }}
@endif
{{ $post->user->name ?? '' }}
{{ $post->created_at->format('Y-m-d H:i') }}
@if ($canManagePost)
@csrf @method('DELETE')
@endif
@if ($post->caption)
{{ $post->caption }}
@endif @if ($post->media->isNotEmpty())
@foreach ($post->media as $media)
@if ($media->type === 'video') @else @endif
@endforeach
@endif
{{ $post->comments->count() }}
@foreach ($post->comments as $comment)
@if ($comment->user?->avatarUrl()) @else
{{ mb_substr($comment->user->name ?? '?', 0, 1) }}
@endif
{{ $comment->user->name ?? '' }} {{ $comment->body }}
@if ($comment->user_id === $me->id || $me->isAdmin()) @endif
@endforeach
@endforeach
{{ $posts->links() }}
@endif
@endsection @push('scripts') @endpush