From 4dc412e1127605c3b2e3dd8b42c2e6272142fd13 Mon Sep 17 00:00:00 2001
From: Rhys Nute <nuterd@cardiff.ac.uk>
Date: Mon, 11 Dec 2023 18:46:27 +0000
Subject: [PATCH] updated

---
 .../Organisation/organisationControllers.java       |  4 ++--
 .../{WorkWith => templates}/towns-data.html         |  2 +-
 .../resources/{WorkWith => templates}/towns.html    | 13 +++++++------
 3 files changed, 10 insertions(+), 9 deletions(-)
 rename src/main/resources/{WorkWith => templates}/towns-data.html (95%)
 rename src/main/resources/{WorkWith => templates}/towns.html (59%)

diff --git a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java
index ba1c4ea7..1a768161 100644
--- a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java
+++ b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java
@@ -38,7 +38,7 @@ public class organisationControllers {
 
     @GetMapping("/towns")
     public ModelAndView getTownsPage() {
-        ModelAndView modelAndView = new ModelAndView("WorkWith/towns.html");
+        ModelAndView modelAndView = new ModelAndView("towns");
         List<addAddTowns> Towns = addAddTownsRepository.getAllAddTowns();
         modelAndView.addObject("towns", Towns);
         return modelAndView;
@@ -46,7 +46,7 @@ public class organisationControllers {
     @Autowired
     private addAddTownsRepository addAddTownsRepository;
 
-    @PostMapping("/townssub")
+    @PostMapping("/towns-data")
     public ModelAndView townsSent(@Valid @ModelAttribute("towns-data") addAddTowns towns, BindingResult bindingResult, Model model) {
         List<addAddTowns> addtowns = addAddTownsRepository.getAllAddTowns();
 
diff --git a/src/main/resources/WorkWith/towns-data.html b/src/main/resources/templates/towns-data.html
similarity index 95%
rename from src/main/resources/WorkWith/towns-data.html
rename to src/main/resources/templates/towns-data.html
index 5ed858c6..024b480c 100644
--- a/src/main/resources/WorkWith/towns-data.html
+++ b/src/main/resources/templates/towns-data.html
@@ -8,7 +8,7 @@
 <body>
 <div id="container1">
     <h2>Enter your Local authority</h2>
-    <form action="local-auth-data.php" method="post" id="data">
+    <form action="" method="post" id="data">
         <p>
             <label for="townName">Enter your town</label>
             <input type="text" name="town_Name" id="townName">
diff --git a/src/main/resources/WorkWith/towns.html b/src/main/resources/templates/towns.html
similarity index 59%
rename from src/main/resources/WorkWith/towns.html
rename to src/main/resources/templates/towns.html
index 4b268bd1..50b94596 100644
--- a/src/main/resources/WorkWith/towns.html
+++ b/src/main/resources/templates/towns.html
@@ -5,15 +5,16 @@
     <title>Towns</title>
     <link rel="stylesheet" href="../static/css/templatingstyle.css">
 </head>
+<header th:insert="~{/towns/Templating.html::header}"></header>
 <body>
-<h1>Developing a Thriving Town</h1>
-<h1>Supporting Local Businesses</h1>
+<h3>Developing a Thriving Town</h3>
+<h3>Supporting Local Businesses</h3>
 <p>Giving local businesses a voice in the community</p>
-<h1>Empowering Community Spirit</h1>
-<h1>Creating the towns Identity</h1>
+<h3>Empowering Community Spirit</h3>
+<h3>Creating the towns Identity</h3>
 <div>
-    <ul th:each="addAddTowns:${addTown}">
-        <li th:text="${addAddTowns}"></li>
+    <ul th:each="towns:${addTown}">
+        <li th:text="${towns}"></li>
     </ul>
 </div>
 <button id="submit">Towns log in here</button><a href="towns-data.html"></a>
-- 
GitLab