mirror of
https://koodu.h-i.works/projects/thebadspace
synced 2025-06-25 16:04:37 -05:00
Turned on Index search
Activated the full text search on the index pages as well as plugging in a tempalte to show location information. Still needs to be styled but it's all wired up. Also cleaned some typos in the About description. One day I'll be able to spell. One day.
This commit is contained in:
@ -12,7 +12,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use App\Service\HandleLocations;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use App\Service\Auth;
|
||||
use App\Service\FileUploader;
|
||||
use App\Service\Render;
|
||||
@ -37,7 +36,6 @@ class Locations extends AbstractController
|
||||
Auth $auth,
|
||||
HandleLocations $locations,
|
||||
ManagerRegistry $doctrine,
|
||||
Connection $connection,
|
||||
Render $render,
|
||||
string $pageNum
|
||||
): Response {
|
||||
|
@ -16,7 +16,7 @@ use App\Service\Auth;
|
||||
class Members extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/den/members/page/{pageNum}", name="den-locations")
|
||||
* @Route("/den/members/page/{pageNum}", name="den-members-index")
|
||||
*/
|
||||
public function showMembers(
|
||||
Request $request,
|
||||
|
@ -21,7 +21,35 @@ class Index extends AbstractController
|
||||
public function showIndex(Request $request, Auth $auth, Render $render, HandleLocations $locations): Response
|
||||
{
|
||||
$list = $locations->getActiveLocations();
|
||||
return $render->page(["count" => count($list)], "This is The Bad Space", "front/index.twig");
|
||||
if ($request->getMethod() == "GET") {
|
||||
return $render->page(["count" => count($list)], "This is The Bad Space", "front/index.twig");
|
||||
} else {
|
||||
$results = $locations->searchLocations($request->request->get("index_search"));
|
||||
return $render->page(
|
||||
["count" => count($list),
|
||||
"items" => $results['items']
|
||||
],
|
||||
"This is The Bad Space",
|
||||
"front/index.twig"
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/location/{uuid}", name="front-location")
|
||||
*/
|
||||
public function showLocations(
|
||||
Request $request,
|
||||
Render $render,
|
||||
HandleLocations $locations,
|
||||
string $uuid = "none"
|
||||
): Response {
|
||||
$location = $locations->getLocationbyUUID($uuid);
|
||||
return $render->page(
|
||||
["location" => $location[0]],
|
||||
"The Bad Space | " . $location[0]->getName(),
|
||||
"front/location.twig"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user