mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
feat: student name popover preview on /repertoire via htmx
This commit is contained in:
28
app/templates/partials/student-preview.php
Normal file
28
app/templates/partials/student-preview.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Partial: student popover preview.
|
||||
*
|
||||
* Expected variables:
|
||||
* $theses array rows of [id => int, title => string]
|
||||
* $name string student name
|
||||
*/
|
||||
?>
|
||||
<?php if (count($theses) === 1): ?>
|
||||
<iframe
|
||||
src="/tfe?id=<?= (int)$theses[0]['id'] ?>"
|
||||
class="student-preview__iframe"
|
||||
loading="lazy"
|
||||
title="Aperçu — <?= htmlspecialchars($name) ?>"
|
||||
></iframe>
|
||||
<?php else: ?>
|
||||
<p class="student-preview__name"><?= htmlspecialchars($name) ?></p>
|
||||
<ul class="student-preview__list">
|
||||
<?php foreach ($theses as $t): ?>
|
||||
<li>
|
||||
<a href="/tfe?id=<?= (int)$t['id'] ?>" class="student-preview__link">
|
||||
<?= htmlspecialchars($t['title']) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user