From 5ad29f78f6b216a0e1db8d6aebcfbe2087db4c70 Mon Sep 17 00:00:00 2001 From: Ro Date: Wed, 11 Jan 2023 15:26:38 -0800 Subject: [PATCH] Hot fix for template for staging Starting to get the production environment together, so some hot fixes are needed to the index template that haven't been accouted for yet. This one was updating the index template to use the new render class when login fails --- src/Controller/Routes/Back/Index.php | 7 ++----- src/Controller/Routes/Back/Locations.php | 4 +--- templates/back/index.twig | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Controller/Routes/Back/Index.php b/src/Controller/Routes/Back/Index.php index af99b82..4c4ed96 100644 --- a/src/Controller/Routes/Back/Index.php +++ b/src/Controller/Routes/Back/Index.php @@ -21,7 +21,7 @@ class Index extends AbstractController public function enterTheDen(Request $request, Auth $auth, RequestStack $requestStack, Render $render): Response { if ($request->getMethod() == "GET") { - return $render->page([], "This is the Den", "back/index.twig"); + return $render->page([], "The Bad Space | Den", "back/index.twig"); } else { //handles login $handle = $request->request->get("handle"); @@ -31,10 +31,7 @@ class Index extends AbstractController header("Location:/den"); return new Response("LOGGED IN"); } else { - return $this->render("back/index.twig", [ - "title" => "Close the door behind you", - "notice" => $result["message"] - ]); + return $render->page(["notice" => $result["message"]], "The Bad Space | Den", "back/index.twig"); } } } diff --git a/src/Controller/Routes/Back/Locations.php b/src/Controller/Routes/Back/Locations.php index 837f7da..880ef7c 100644 --- a/src/Controller/Routes/Back/Locations.php +++ b/src/Controller/Routes/Back/Locations.php @@ -50,9 +50,7 @@ class Locations extends AbstractController //$search = $connection->fetchAllAssociative("SELECT * FROM searchlocations('agenda')"); return $render->page(["list" => $list, "mode" => "index"], "Bad Space | Locations", "back/locations.twig"); } else { - return $this->render("back/index.twig", [ - "title" => "Close the door behind you", - ]); + return $render->page([], "The Bad Space | Den", "back/index.twig"); } } diff --git a/templates/back/index.twig b/templates/back/index.twig index f9abdf7..3ae1fe5 100644 --- a/templates/back/index.twig +++ b/templates/back/index.twig @@ -17,9 +17,9 @@ {% else %}

This is the Den


- {% if notice is defined %} + {% if options.notice is defined %}
- {{ notice }} + {{ options.notice }}
{% endif %} {{ include("forms/login-form.twig") }}