@extends('layouts.app') @section('title', $userGroup->name . ' — 群組管理') @push('styles') @endpush @section('content') {{-- ── Hero ────────────────────────────────────────────────────────── --}}
{{ $userGroup->name }}
@if($userGroup->description) {{ $userGroup->description }} @endif
{{ $userGroup->users->count() }} {{ $userGroup->projects->count() }} 個專案
返回
{{-- ── Main content ─────────────────────────────────────────────────── --}}
{{-- ── 左側:成員 ───────────────────────────────────────────────── --}}
成員
{{-- 加入成員表單 --}}
{{-- 成員清單 --}} @php $avatarColors = ['#4e79a7','#f28e2b','#e15759','#76b7b2','#59a14f','#edc948','#b07aa1','#ff9da7','#9c755f','#bab0ac']; @endphp
    @forelse($userGroup->users as $idx => $u)
  • {{ mb_substr($u->name, 0, 1) }}
    {{ $u->name }}
    @if($u->department)
    {{ $u->department }}
    @endif
  • @empty
  • 尚無成員
  • @endforelse
{{-- ── 右側:專案指派 ───────────────────────────────────────────── --}}
已加入專案
{{-- 加入專案表單 --}} @php $assignedIds = $userGroup->projects->pluck('id')->toArray(); $typeBadge = ['產品'=>'bg-info text-white','開發'=>'bg-primary text-white','維護'=>'bg-success text-white','保固'=>'bg-warning text-dark','結束'=>'bg-secondary text-white']; @endphp
@foreach($allProjects as $p) @endforeach
已選 0 個
{{-- 專案清單 --}} @php $roleLabels = $roles->pluck('label', 'id'); $typeBadgeSmall = ['產品'=>'bg-info','開發'=>'bg-primary','維護'=>'bg-success','保固'=>'bg-warning text-dark','結束'=>'bg-secondary']; @endphp
    @forelse($userGroup->projects as $p)
  • {{ $p->name }}
    {{ $p->project_type }} {{ $roleLabels[$p->pivot->role_id] ?? '—' }}
  • @empty
  • 尚未加入任何專案
  • @endforelse

將群組加入專案時,群組成員會自動成為專案成員。移除專案關聯不影響個別已加入的成員。

{{-- ── Floating Toast ──────────────────────────────────────────────── --}}
@endsection @push('scripts') @endpush