Improve templates

This commit is contained in:
DariusIII
2025-10-07 13:38:02 +02:00
parent ca1fee1c53
commit 40a469a2b7
11 changed files with 514 additions and 314 deletions
+18 -8
View File
@@ -10,7 +10,7 @@ class BrowseGroupController extends BasePageController
/**
* @throws \Exception
*/
public function show(Request $request): void
public function show(Request $request)
{
// Get the search term from the request
$search = $request->get('search', '') ?? '';
@@ -18,10 +18,7 @@ class BrowseGroupController extends BasePageController
// Get groups based on search term
$groupList = UsenetGroup::getGroupsRange($search, true);
// Pass data to the view
$this->smarty->assign('results', $groupList);
$this->smarty->assign('search', $search);
// Set meta data
$meta_title = 'Browse Groups';
$meta_keywords = 'browse,groups,description,details';
$meta_description = 'Browse groups';
@@ -30,8 +27,21 @@ class BrowseGroupController extends BasePageController
$meta_description = 'Browse groups search results for '.$search;
}
$content = $this->smarty->fetch('browsegroup.tpl');
$this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description'));
$this->pagerender();
// Render the content view
$content = view('browsegroup', [
'results' => $groupList,
'search' => $search,
'site' => $this->settings,
])->render();
// Prepare view data for main layout
$this->viewData = array_merge($this->viewData, [
'content' => $content,
'meta_title' => $meta_title,
'meta_keywords' => $meta_keywords,
'meta_description' => $meta_description,
]);
return $this->pagerender();
}
}