@extends('layouts.app') @section('title', __('Календарно-тематический план')) @section('content')

{{ __('Календарно-тематический план') }}

{{ __('Выполнение КТП') }}

{{ __('Темы уроков по дисциплинам. Преподаватель выбирает тему из этого списка при заполнении аттенданса; если у дисциплины плана нет, выбор не требуется.') }}

@forelse ($disciplines as $d) {{ $d->name }} {{ $d->topics_count }} @empty
{{ __('Дисциплин нет — добавьте их в') }} {{ __('«Справочниках»') }}.
@endforelse
@if (! $discipline)
{{ __('Выберите дисциплину слева.') }}
@else

{{ $discipline->name }}

{{-- Plans per level (129): the general plan, then one per group level. --}} @if ($plans !== []) @php $currentPlan = collect($plans)->firstWhere('level_id', $levelId); @endphp

@if ($levelId === null) {{ __('Общий план — для групп без уровня и для групп, у уровня которых своего плана нет.') }} @elseif ($currentPlan && $currentPlan->topics_count > 0) {{ __('План для групп уровня «:level».', ['level' => $currentPlan->name]) }} @else {{ __('У уровня «:level» своего плана пока нет — его группы идут по общему плану. Как только здесь появится тема, они перейдут на этот план.', ['level' => $currentPlan->name ?? '']) }} @endif @if ($currentPlan) {{ __('Активных групп по этому плану: :n.', ['n' => $currentPlan->groups_count]) }} @endif

@endif @php $activeTopics = array_values(array_filter($topics, fn ($t) => (int) $t->is_active === 1)); $hasSections = $sections !== []; $sectionOf = fn ($t) => $t?->section_id !== null ? (int) $t->section_id : null; $columns = $hasSections ? 6 : 5; @endphp {{-- Разделы (097): headings the topics are grouped under. --}}
{{ __('Разделы') }}
@foreach ($sections as $i => $section)
@csrf {{ $i + 1 }}. {{ $section->topics_count }}
@endforeach
@csrf
@if ($hasSections && $activeTopics !== [])
@csrf
{{ __('Темы №') }}
—
{{ __('перенести в') }}
@endif
@if ($hasSections)@endif @php $headerShownFor = 'none'; @endphp @forelse ($topics as $topic) @php $active = (int) $topic->is_active === 1; $pos = $active ? array_search($topic, $activeTopics, true) : false; $formId = 'topicForm'.$topic->id; // ▲/▼ only move inside the раздел. $firstInSection = $active && ($pos === 0 || $sectionOf($activeTopics[$pos - 1]) !== $sectionOf($topic)); $lastInSection = $active && ($pos === count($activeTopics) - 1 || $sectionOf($activeTopics[$pos + 1]) !== $sectionOf($topic)); $groupKey = $active ? (string) $sectionOf($topic) : 'inactive'; @endphp @if ($hasSections && $groupKey !== $headerShownFor) @php $headerShownFor = $groupKey; @endphp @endif @if ($hasSections) @endif @empty @endforelse
№ {{ __('Тема') }}{{ __('Раздел') }}{{ __('Часы') }} {{ __('Уроков') }}
{{ ! $active ? __('Отключённые темы') : ($topic->section_title ?? __('Без раздела')) }}
{{ $active ? $pos + 1 : '—' }} @if (! $active)
{{ __('Отключена — преподавателям не предлагается') }}
@endif {{ __('Материалы') }}@if ($topic->materials_count > 0) ({{ $topic->materials_count }})@endif
{{ $topic->lessons_count }}
@csrf @if ($active) @else @endif
{{ __('Плана пока нет — добавьте темы ниже.') }}
{{ __('Добавить темы') }}
@csrf @if ($hasSections)
@endif
{{ __('Можно вставить весь план сразу — темы добавятся в конец раздела в том же порядке. Строка, начинающаяся с #, — новый раздел: темы после неё попадут в него, например: # Алгебра, 7 класс') }}
@endif
@endsection