@extends('central.super.layout') @section('title', __('super.kb.title')) @section('content') {{-- Stats --}}

{{ $categories->count() }}

{{ __('super.kb.categories') }}

{{ $totalArticles }}

{{ __('super.kb.total_articles') }}

{{ $publishedArticles }}

{{ __('super.kb.published') }}

{{ $totalArticles - $publishedArticles }}

{{ __('super.kb.draft') }}

{{-- Categories with articles --}} @forelse($categories as $cat) @php $gradients = [['#6366f1','#818cf8'],['#3b82f6','#60a5fa'],['#10b981','#34d399'],['#f59e0b','#fbbf24'],['#ec4899','#f472b6']]; $g = $gradients[$loop->index % count($gradients)]; @endphp

{{ $cat->name }}

@if($cat->description)

{{ Str::limit($cat->description, 80) }}

@endif
{{ $cat->articles_count }} {{ $cat->articles_count == 1 ? __('super.kb.article') : __('super.kb.articles') }}
{{ __('super.kb.add_article') }} @php $catDeleteConfig = json_encode(["title" => __("super.kb.delete_category"), "text" => __("super.kb.delete_category_text", ["name" => $cat->name]), "icon" => "warning", "confirmButtonText" => __("super.kb.yes_delete"), "confirmButtonColor" => "#ef4444"]); @endphp
@csrf @method('DELETE')
@if($cat->articles_count > 0)
@foreach($cat->articles as $article) @endforeach
{{ __('super.kb.title_col') }} {{ __('super.kb.status') }} {{ __('super.kb.order') }} {{ __('super.kb.updated') }}
{{ $article->title }} {{ $article->slug }} @if($article->is_published) {{ __('super.kb.published') }} @else {{ __('super.kb.draft') }} @endif {{ $article->sort_order }} {{ $article->updated_at->diffForHumans() }}
@php $articleDeleteConfig = json_encode(["title" => __("super.kb.delete_article"), "text" => __("super.kb.delete_article_text", ["name" => $article->title]), "icon" => "warning", "confirmButtonText" => __("super.kb.delete"), "confirmButtonColor" => "#ef4444"]); @endphp
@csrf @method('DELETE')
@else

{{ __('super.kb.no_articles') }}

{{ __('super.kb.create_first_article') }}
@endif
@empty

{{ __('super.kb.no_categories') }}

{{ __('super.kb.no_categories_desc') }}

{{ __('super.kb.create_first_category') }}
@endforelse @push('scripts') @endpush @endsection