@extends('layouts.admin')
@section('title', 'Skill: ' . $skill->skill)
@section('content')
{{-- Page Header --}}
@include('admin.components.page-header', [
'title' => $skill->skill,
'subtitle' => 'Manage skill details, tracks, and questions',
'icon' => 'brain',
'breadcrumbs' => [
['title' => 'Skills', 'url' => route('admin.skills.index')],
['title' => $skill->skill, 'url' => '']
],
'actions' => [
[
'text' => 'Edit Details',
'url' => route('admin.skills.edit', $skill),
'icon' => 'edit',
'class' => 'outline-primary'
],
[
'text' => 'Add Questions',
'onclick' => 'SkillManager.showBulkQuestions()',
'icon' => 'plus',
'class' => 'success'
],
[
'text' => 'Delete Skill',
'onclick' => 'SkillManager.deleteSkill(' . $skill->id . ')',
'icon' => 'trash',
'class' => 'outline-danger'
],
[
'text' => 'Actions',
'type' => 'dropdown',
'icon' => 'ellipsis-v',
'class' => 'outline-secondary',
'items' => [
['text' => 'Duplicate Skill', 'icon' => 'copy', 'onclick' => 'SkillManager.copySkill(' . $skill->id . ')'],
['text' => 'Export Questions', 'icon' => 'download', 'onclick' => 'SkillManager.exportQuestions()']
]
]
]
])
{{-- Statistics Row --}}
@include('admin.components.stats-row', [
'stats' => [
[
'value' => $skill->questions->count(),
'label' => 'Questions',
'color' => 'primary',
'icon' => 'question-circle'
],
[
'value' => $skill->tracks->count(),
'label' => 'Tracks',
'color' => 'info',
'icon' => 'route'
],
[
'value' => $skill->questions->where('qa_status', 'approved')->count(),
'label' => 'Approved',
'color' => 'success',
'icon' => 'check-circle'
],
[
'value' => $skill->questions->where('qa_status', 'flagged')->count(),
'label' => 'Flagged',
'color' => 'danger',
'icon' => 'flag'
]
]
])
{{-- Main Content --}}
{{-- Skill Details Card --}}
Skill Id/Name
{{ $skill->id. ': '. $skill->skill }}
Status
@if($skill->status_id == 3)
Active
@elseif($skill->status_id == 4)
Draft
@else
Unknown
@endif
Description
{{ $skill->description ?: 'Click to add description...' }}
Created By
{{ $skill->user->name ?? 'Unknown User' }} - {{ $skill->created_at->format('M j, Y') }}
{{-- Questions Card --}}
@if($skill->questions->count() > 0)
ID
Question
Type
Difficulty
Status
Actions
@foreach($skill->questions as $question)
#{{ $question->id }}
@php
$plainText = strip_tags($question->question);
$shouldTruncate = strlen($plainText) > 80;
@endphp
{!! $question->question !!}
@if($question->question_image)
Has image
@endif
{{ $question->type->type ?? 'MCQ' }}
@php
$difficulty = $question->difficulty->short_description ?? 'medium';
$badgeClass = match($difficulty) {
'easy' => 'bg-success',
'medium' => 'bg-warning',
'hard' => 'bg-danger',
default => 'bg-secondary'
};
@endphp
{{ ucfirst($difficulty) }}
@php
$status = $question->qa_status ?? 'draft';
$statusClass = match($status) {
'approved' => 'bg-success',
'flagged' => 'bg-danger',
'needs_revision' => 'bg-warning',
'unreviewed' => 'bg-secondary',
'ai_generated' => 'bg-info'
};
@endphp
{{ ucfirst(str_replace('_', ' ', $status)) }}
@endforeach
@else
@include('admin.components.empty-state', [
'icon' => 'question-circle',
'title' => 'No Questions Added',
'message' => 'Add your first question to this skill to get started'
])
@endif
{{-- Sidebar --}}
{{-- Tracks Card --}}
@if($skill->tracks->count() > 0)
@foreach($skill->tracks as $track)
{{ $track->track }}
@if($track->level)
@php
// define your badge colors
$statusColors = [
'Only Me' => 'badge bg-secondary', // grey
'Restricted' => 'badge bg-warning text-dark', // yellow
'Public' => 'badge bg-success', // green
'Draft' => 'badge bg-info text-dark', // light blue
];
$statusClass = $statusColors[$track->status->status] ?? 'badge bg-light text-dark';
@endphp
Level {{ $track->level->level }} - {{ $track->level->description }}
{{ $track->status->status }}
@endif
@endforeach
@else
@include('admin.components.empty-state', [
'icon' => 'route',
'title' => 'No tracks assigned',
'message' => ''
])
@endif
{{-- Video Links Card --}}
@if($skill->links && $skill->links->count() > 0)
@foreach($skill->links as $link)
{{ $link->title ?? 'Video ' . $loop->iteration }}
{{ basename($link->link) }}
@endforeach
@else
@include('admin.components.empty-state', [
'icon' => 'video',
'title' => 'No videos uploaded',
'message' => ''
])
@endif
{{-- Add Track Modal --}}