@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => '']) @include('components.search') @include('components.kanban-alert')
{{-- Recently Viewed Section --}} @if (isset($recently_viewed) && $recently_viewed->count() > 0)
Baru Dilihat
@foreach ($recently_viewed as $board) @php $isCustomImage = $board->image_path && (str_contains($board->image_path, '/') || str_contains($board->image_path, '\\')); $isHexColor = $board->image_path && str_starts_with($board->image_path, '#'); if ($isCustomImage) { $backgroundStyle = 'background-image: url(' . asset('storage/' . $board->image_path) . '); background-size: cover; background-position: center;'; } elseif ($isHexColor) { $backgroundStyle = 'background-color: ' . $board->image_path . ';'; } else { $backgroundStyle = 'background-color: #1e8c94;'; // fallback to primary color } @endphp
{{ $board->title }}
@endforeach
@endif {{-- My Boards Section --}}
Boards Saya
{{ isset($my_boards) ? $my_boards->count() : 0 }} boards
@if (isset($my_boards)) @foreach ($my_boards as $board) @php $isCustomImage = $board->image_path && (str_contains($board->image_path, '/') || str_contains($board->image_path, '\\')); $isHexColor = $board->image_path && str_starts_with($board->image_path, '#'); if ($isCustomImage) { $backgroundStyle = 'background-image: url(' . asset('storage/' . $board->image_path) . '); background-size: cover; background-position: center;'; } elseif ($isHexColor) { $backgroundStyle = 'background-color: ' . $board->image_path . ';'; } else { $backgroundStyle = 'background-color: #1e8c94;'; // fallback to primary color } @endphp @endforeach @endif {{-- Create New Board Card --}}
Buat Board Baru

Mulai kelola proyek Anda

{{-- Shared Boards Section --}} @if (isset($shared_boards) && $shared_boards->count() > 0)
Dibagikan dengan Anda
{{ $shared_boards->count() }} boards
@php // Ambil user_id dari session (bukan auth()->id()) $currentUsername = session('username'); $currentUserId = null; if ($currentUsername) { $u = \App\Models\User::find($currentUsername); $currentUserId = $u ? $u->id : null; } $boardIds = isset($shared_boards) ? $shared_boards->pluck('id') : collect(); // Map pivot: [board_id => role_in_board] $boardRoles = \DB::table('board_user') ->where('user_id', $currentUserId) ->whereIn('board_id', $boardIds) ->pluck('role_in_board', 'board_id'); @endphp @foreach ($shared_boards as $board) @php $isCustomImage = $board->image_path && (str_contains($board->image_path, '/') || str_contains($board->image_path, '\\')); $isHexColor = $board->image_path && str_starts_with($board->image_path, '#'); if ($isCustomImage) { $backgroundStyle = 'background-image: url(' . asset('storage/' . $board->image_path) . '); background-size: cover; background-position: center;'; } elseif ($isHexColor) { $backgroundStyle = 'background-color: ' . $board->image_path . ';'; } else { $backgroundStyle = 'background-color: #1e8c94;'; // fallback to primary color } // Tentukan role user pada board ini $roleInBoard = null; if (isset($board->pivot) && isset($board->pivot->role_in_board)) { $roleInBoard = $board->pivot->role_in_board; } else { $roleInBoard = $boardRoles->get($board->id); } $isAdminMember = is_string($roleInBoard) && strtolower(trim($roleInBoard)) === 'admin'; @endphp
Dibagikan
@if ($isAdminMember)
Admin
@endif
{{ $board->title }}
@endforeach
@endif
{{-- Create Board Modal --}} {{-- Archive Board Confirmation Modal --}} @endsection @push('css') @endpush @push('js') @endpush