fix parent pages to adopt the school year logic
Tests / PHPUnit (push) Successful in 1m20s

This commit is contained in:
root
2026-07-17 00:02:53 -04:00
parent a5517b516a
commit 539d0eb220
12 changed files with 258 additions and 51 deletions
+11 -2
View File
@@ -1,5 +1,9 @@
<?= $this->extend('layout/main_layout') ?>
<?= $this->section('content') ?>
<?php
$isEditable = (bool) ($isEditable ?? true);
$disabledAttr = $isEditable ? '' : ' disabled';
?>
<div class="container my-5">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
<div>
@@ -16,6 +20,11 @@
<?php if (session()->getFlashdata('success')): ?>
<div class="alert alert-success"><?= esc(session()->getFlashdata('success')) ?></div>
<?php endif; ?>
<?php if (! $isEditable): ?>
<div class="alert alert-info">
You are viewing <?= esc($schoolYear ?: 'a closed school year') ?>. Report card signatures are read-only for closed years.
</div>
<?php endif; ?>
<?php if (empty($students)): ?>
<div class="alert alert-info">No students available for report cards.</div>
@@ -57,8 +66,8 @@
<?php if (! $signedAt): ?>
<form class="d-inline-flex align-items-center gap-2 ms-2" method="post" action="<?= base_url('parent/report-cards/sign/' . $sid) ?>">
<?= csrf_field() ?>
<input type="text" name="signed_name" class="form-control form-control-sm" placeholder="Full name" required>
<button class="btn btn-sm btn-success" type="submit">Sign</button>
<input type="text" name="signed_name" class="form-control form-control-sm" placeholder="Full name" required<?= $disabledAttr ?>>
<button class="btn btn-sm btn-success" type="submit"<?= $disabledAttr ?>>Sign</button>
</form>
<?php endif; ?>
</td>