@extends('layouts.app') @section('title', 'Информация о группе') {{-- Ports app/Views/lesson/attendance_form.php (legacy, 799 lines) + the render() payload from App\Controllers\LessonController::attendanceForm() (app/Controllers/LessonController.php:413-461) — see the Phase 22 plan. Every write form/fetch on this page (check_lesson.php/check_lesson_exists.php/ submit_test_results.php/add_student_to_group_teacher.php/ remove_student_from_group.php/check_student_in_group.php) still posts to its exact unchanged legacy endpoint. Real Laravel CSRF as of Phase 62 — @csrf on the real forms, an X-CSRF-TOKEN header (read from the page's csrf-token meta tag, via layouts.app) on the two $.ajax calls and on the check_student_in_group.php fetch. check_student_in_group.php had no backend anywhere (dead route on both sides of the migration) until the duplicate-membership fix gave it one — its caller treats any failure as permission to proceed, so a 404 there meant the duplicate check never actually ran. The fetch keeps that fail-open .catch(), which is now safe because the write path checks too. No page-level role restriction beyond SessionAuth::check() — matches the legacy controller's constructor exactly. Every field in a student's row except the presence checkbox is behind a MODULE_TEACHER_LESSON_* flag (config/modules.php), so a white-label checkout can strip the row back to attendance alone — Tanym Education runs with all five off. The flags gate three places that must stay in step: the Blade markup below, the JS that builds a row for a just-added student (axBuildStudentRow), and the submit handler's "fill in every select" check, which would otherwise block submission on selects that are no longer rendered. $localGroupInfo/$localStudents/$comments/$commentCategories are DB::select() results (stdClass rows), unlike the legacy view's $pdo-fetched associative arrays — property access (->) is used throughout instead of array access. The two SQL queries the legacy view ran directly against $pdo (comments list, comment_categories+comments for the Comments modal) were moved into the controller — see its docblock. --}} @section('content') @php // White-label field toggles (config/modules.php). Everything on this form // except the presence checkbox itself is independently switchable, so a // checkout that only tracks attendance (Tanym Education) collapses each // student's row down to that checkbox alone. All default to true, so an // unconfigured deployment renders exactly what it rendered before. $showKr = \App\Support\Modules::enabled('teacher_lesson_kr'); $showDz = \App\Support\Modules::enabled('teacher_lesson_dz'); $showLateness = \App\Support\Modules::enabled('teacher_lesson_lateness'); $showComments = \App\Support\Modules::enabled('teacher_lesson_comments'); $showTestScore = \App\Support\Modules::enabled('teacher_lesson_test_score'); // Which selects the submit handler must see filled in, and how to name // them in the error toast. Derived here rather than hardcoded in the JS // so a hidden field can't be demanded by a validation rule that outlived // it — with all three off the check is skipped entirely. $requiredSelects = array_values(array_filter([ $showKr ? 'select.kr-select' : null, $showDz ? 'select.dz-select' : null, $showLateness ? 'select.lateness-select' : null, ])); $requiredLabels = array_values(array_filter([ $showKr ? 'КР' : null, $showDz ? 'ДЗ' : null, $showLateness ? 'Опоздание' : null, ])); // "КР, ДЗ и Опоздание" — the original wording when all three are on. $requiredLabelText = count($requiredLabels) > 1 ? implode(', ', array_slice($requiredLabels, 0, -1)).' и '.$requiredLabels[count($requiredLabels) - 1] : implode('', $requiredLabels); // Both of these are handed to @json() below as a bare variable on purpose: // the directive splits its argument on commas looking for its options and // depth arguments, so an expression containing one (a jQuery selector // list, a Russian sentence) silently compiles to the wrong json_encode() // call. $requiredSelector = implode(', ', $requiredSelects); $requiredMessage = 'Пожалуйста, выберите '.$requiredLabelText.' для всех учеников!'; @endphp
Отделение: {{ $local->language_name ?? 'не указано' }}
Предмет: {!! nl2br(e($local->discipline_name ?? '—')) !!}
Класс: {{ $local->class_name }}
Тип обучения: {{ $local->learning_type_name }}