mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
feat: convert all file inputs to FilePond for standardized uploading
- Add csv_import queue type (storeAsFile, no async upload) for CSV import dialog - Convert file-field.php partial to FilePond with field-name→queue-type mapping - Conditionally skip server config for storeAsFile queues in buildFilePondOptions - Skip FilePond init for inputs inside closed <dialog> elements - Trigger FilePond init when import dialog opens - Load FilePond CSS/JS assets on admin index page
This commit is contained in:
@@ -58,7 +58,7 @@ class HomeController
|
||||
$year = null;
|
||||
}
|
||||
|
||||
// Default home view: random theses from latest year (no year filter, no explicit page)
|
||||
// Default home view: all published theses grouped by year (desc), shuffled within each year
|
||||
$isDefaultView = $year === null && $page === 1;
|
||||
|
||||
$itemsToLoad = [];
|
||||
@@ -80,9 +80,21 @@ class HomeController
|
||||
$totalItems = $this->db->countSearchResults(['year' => $year]);
|
||||
} elseif ($isDefaultView) {
|
||||
$latestYear = $this->db->getLatestPublishedYear();
|
||||
$itemsToLoad = $this->db->getLatestYearTheses(
|
||||
self::ITEMS_PER_PAGE,
|
||||
);
|
||||
$allTheses = $this->db->getAllPublishedTheses();
|
||||
|
||||
// Group by year, shuffle randomly within each year
|
||||
$byYear = [];
|
||||
foreach ($allTheses as $thesis) {
|
||||
$byYear[$thesis['year']][] = $thesis;
|
||||
}
|
||||
krsort($byYear, SORT_NUMERIC);
|
||||
|
||||
$itemsToLoad = [];
|
||||
foreach ($byYear as $yearGroup) {
|
||||
shuffle($yearGroup);
|
||||
$itemsToLoad = array_merge($itemsToLoad, $yearGroup);
|
||||
}
|
||||
|
||||
$totalItems = count($itemsToLoad); // no multi-page on default view
|
||||
} else {
|
||||
$itemsToLoad = $this->db->getPublishedTheses(
|
||||
|
||||
Reference in New Issue
Block a user