diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 597c060..1dee8f5 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -42,6 +42,45 @@ class MainController extends AbstractController ); } + #[Route( + '/{namespace}', + name: 'main_namespace', + requirements: + [ + 'transaction' => '^N[A-z0-9]{33}$', + ], + methods: + [ + 'GET' + ] + )] + public function namespace( + ?Request $request + ): Response + { + $index = new \Kvazar\Index\Manticore(); + + return $this->render( + 'default/main/namespace.html.twig', + [ + 'request' => $request, + 'records' => $index->get( + $request->get('search') ? (string) $request->get('search') : '', + [ + 'crc32namespace' => crc32( + $request->get('namespace') + ) + ], + [ + 'time' => 'desc' + ], + $request->get('part') > 1 ? (int) $request->get('part') * $this->getParameter('app.main.index.limit') : 0, + $this->getParameter('app.main.index.limit') + ) + ] + ); + } + #[Route( '/{transaction}', name: 'main_transaction', diff --git a/templates/default/main/index.html.twig b/templates/default/main/index.html.twig index 800309d..cddff76 100644 --- a/templates/default/main/index.html.twig +++ b/templates/default/main/index.html.twig @@ -17,7 +17,7 @@