@extends('layouts.app') @section('content')
{{-- Back Button - Always Visible --}} @php if ($currentFolder) { $backUrl = $currentFolder->parent_id ? route('academy.show', $currentFolder->parent_id) : route('academy.show'); $backLabel = __('academy.back', ['default' => 'بازگشت']); } else { $backUrl = route('menu'); $backLabel = __('menu.menu', ['default' => 'منو']); } @endphp {{ $backLabel }} {{-- Page Title --}} @if($currentFolder)

{{ $currentFolder->folder_name }}

{{-- Folder Description --}} @if($currentFolder->description) @php $telegramLinkUrl = null; $telegramLinkText = null; $cleanedDescription = $currentFolder->description; $telegramLinkRegex = '/]*href=["\'](https?:\/\/t\.me\/[^"\']+)["\'][^>]*>(.*?)<\/a>/i'; preg_match($telegramLinkRegex, $currentFolder->description, $matches); if (!empty($matches) && isset($matches[1]) && isset($matches[2])) { $telegramLinkUrl = $matches[1]; $telegramLinkText = $matches[2]; $fullTag = $matches[0]; $cleanedDescription = str_replace($fullTag, '', $currentFolder->description); } $cleanedDescription = trim($cleanedDescription); $isRtl = preg_match('/[\x{0590}-\x{05FF}\x{0600}-\x{06FF}]/u', $cleanedDescription); $descriptionDir = $isRtl ? 'rtl' : 'ltr'; @endphp @if(!empty($cleanedDescription))

@endif @if($telegramLinkUrl) {!! $telegramLinkText !!} @endif @endif @else

@lang('academy.title', ['default' => 'آکادمی'])

@endif {{-- Folders Section --}} @if($folders->isNotEmpty())

@lang('academy.folders', ['default' => 'پوشه‌ها'])

@endif {{-- Files Section --}} @if($fileButtons->isNotEmpty())

@lang('academy.files', ['default' => 'فایل‌ها'])

@foreach($fileButtons as $fileButton) @endforeach
@endif {{-- Empty State --}} @if($folders->isEmpty() && $fileButtons->isEmpty())

@lang('academy.no_content', ['default' => 'محتوایی در این بخش یافت نشد.'])

@endif
{{-- Success Modal --}}
×

@lang('academy.js.modal_title', ['default' => 'ارسال شد!'])

@lang('academy.js.modal_text', ['default' => 'فایل با موفقیت به ربات تلگرام شما ارسال شد.'])

@lang('academy.js.modal_button', ['default' => 'باز کردن تلگرام'])
@endsection @push('scripts') @endpush