@extends('layouts.admin') @section('title', 'Track Management') @push('styles') @endpush @section('content')
{{-- Page Header --}} @include('admin.components.page-header', [ 'title' => 'Track Management', 'subtitle' => 'Manage educational tracks, levels, and skills', 'icon' => 'route', 'breadcrumbs' => [ ['title' => 'Tracks', 'url' => ''] ], 'actions' => [ [ 'text' => 'Add Track', 'url' => route('admin.tracks.create'), 'icon' => 'plus', 'class' => 'success' ], [ 'text' => 'Actions', 'type' => 'dropdown', 'icon' => 'ellipsis-v', 'class' => 'outline-secondary', 'items' => [ ['text' => 'Import Tracks', 'icon' => 'upload', 'onclick' => 'showImportModal()'], ['text' => 'Export All', 'icon' => 'download', 'onclick' => 'exportTracks()'], 'divider', ['text' => 'Bulk Operations', 'icon' => 'cogs', 'onclick' => 'showBulkOperations()'] ] ] ] ]) {{-- Stats --}} @include('admin.components.stats-row', [ 'stats' => [ [ 'value' => $tracks->count(), 'label' => 'Total Tracks', 'color' => 'primary', 'icon' => 'route', 'id' => 'totalTracksCount' ], [ 'value' => $tracks->where('status_id', 3)->count(), 'label' => 'Active Tracks', 'color' => 'success', 'icon' => 'check-circle', 'id' => 'activeTracksCount' ], [ 'value' => $tracks->sum(function($track) { return $track->skills ? $track->skills->count() : 0; }), 'label' => 'Total Skills', 'color' => 'info', 'icon' => 'brain', 'id' => 'totalSkillsCount' ], [ 'value' => $tracks->where('status_id', 4)->count(), 'label' => 'Draft Tracks', 'color' => 'warning', 'icon' => 'edit', 'id' => 'draftTracksCount' ] ] ]) {{-- Filters --}} @component('admin.components.filters-card', ['items' => $tracks])
@endcomponent {{-- Table --}} @if($tracks->isEmpty()) @include('admin.components.empty-state', [ 'icon' => 'route', 'title' => 'No Tracks Found', 'message' => 'Create your first track to get started' ]) @else
Tracks Overview
@php $statusConfig = [ 'Public' => ['class' => 'success', 'icon' => 'globe'], 'Draft' => ['class' => 'warning', 'icon' => 'edit'], 'Only Me' => ['class' => 'info', 'icon' => 'lock'], 'Restricted' => ['class' => 'secondary', 'icon' => 'ban'] ]; $allStatusLabels = array_keys($statusConfig); @endphp @foreach($tracks as $track) @php $statusText = $track->status->status ?? 'Unknown'; $statusMeta = $statusConfig[$statusText] ?? ['class' => 'secondary', 'icon' => 'question']; @endphp {{-- Id --}} {{-- Image --}} {{-- Track (editable text) --}} {{-- Description (editable text) --}} {{-- Level (editable select) --}} {{-- Skills (read-only) --}} {{-- Status (editable select) --}} {{-- Image Upload Modal --}} {{-- Created --}} {{-- Actions --}} @endforeach
Id Image Track Description Level Skills Status Created Actions
{{ $track->id }}
{{ $track->track }}
@if(strlen($track->description ?? '') > 160) {{ substr($track->description, 0, 160) }}... @else {{ $track->description ?? 'No description' }} @endif @if($track->level) {{ $track->level->description }} @else No level assigned @endif @if($track->skills && $track->skills->count() > 0) {{ $track->skills->count() }} @else 0 @endif {{ $statusText }} {{ $track->created_at->format('M j, Y') }}
{{-- No Results --}}
@include('admin.components.empty-state', [ 'icon' => 'search', 'title' => 'No matching results', 'message' => 'Try adjusting your search filters' ])
@endif
{{-- Copy Track Modal --}} @endsection @push('scripts') @endpush