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:
@@ -203,6 +203,30 @@ class SearchController
|
||||
* Render the repertoire index partial and exit (for HTMX swaps).
|
||||
* Never returns.
|
||||
*/
|
||||
/**
|
||||
* HTMX endpoint: returns a popover snippet for a student name.
|
||||
* Renders directly and exits.
|
||||
*/
|
||||
public function handleStudentPreview(): never {
|
||||
$name = trim($_GET['name'] ?? '');
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
if ($name === '') {
|
||||
echo '';
|
||||
exit();
|
||||
}
|
||||
|
||||
$theses = $this->db->getThesesByAuthorName($name);
|
||||
|
||||
if (empty($theses)) {
|
||||
echo '';
|
||||
exit();
|
||||
}
|
||||
|
||||
include APP_ROOT . '/templates/partials/student-preview.php';
|
||||
exit();
|
||||
}
|
||||
|
||||
private function renderRepertoirePartial(
|
||||
array $repData,
|
||||
array $activeFilters,
|
||||
|
||||
Reference in New Issue
Block a user