From 9cafb6a530f063ac97f23cd46145c10a071a1ad1 Mon Sep 17 00:00:00 2001 From: Rhys Nute <nuterd@cardiff.ac.uk> Date: Wed, 13 Dec 2023 05:59:14 +0000 Subject: [PATCH] updated --- .../Organisation/organisationControllers.java | 4 +- src/main/resources/templates/towns-data.html | 38 ++++++++----------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java index 3f153cf7..14bd8685 100644 --- a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java +++ b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java @@ -43,8 +43,8 @@ public class organisationControllers { modelAndView.addObject("towns", Towns); return modelAndView; } - @GetMapping("/townForm") - public ModelAndView getLocalAuthPage(){ + @GetMapping("/townsForm") + public ModelAndView getTownsSubPage(){ ModelAndView modelAndView = new ModelAndView("towns-data"); modelAndView.addObject("addAddTowns",new addAddTowns()); return modelAndView; diff --git a/src/main/resources/templates/towns-data.html b/src/main/resources/templates/towns-data.html index 5d876291..c15d05ae 100644 --- a/src/main/resources/templates/towns-data.html +++ b/src/main/resources/templates/towns-data.html @@ -10,32 +10,26 @@ <body> <div id="container1"> <h2>Enter your Town</h2> - <form action="\town-data" method="post" id="data" name="data" th:object="*{towns-data}"> + <form action="\town-data" method="post" id="data" name="data" th:object="${addAddTowns}"> <label>Enter your town - <input type="text" th:field="*{townName}" name="town_Name" id="townName"> + <input type="text" th:field="*{townName}"> </label><br><br> - <label for="address1">Please enter first line of your address - <input type="text" name="address_1" id="address1"> + <label>Please enter first line of your address + <input type="text" th:field="*{address1}"> + </label><br><br> + <label>Please enter second line of your address (optional) + <input type="text" th:field="*{address2}"> </label><br><br> - </p> - <p> - <label>Please enter second line of your address (optional)</label> - <input type="text" th:field="*{address2}"> - </p> - <p> <label>Please enter the City/Town - <input type="text" th:field="*{city}"> - </label> - </p> - <p> - <label for="county">Please enter you county (optional)</label> - <input type="text" name="county" id="county"> - </p> - <p> - <label for="postcode">Please enter your postcode</label> - <input type="text" name="post_code" id="postcode"> - </p> - <input type="submit" value="Submit Data"> + <input type="text" th:field="*{city}"> + </label><br><br> + <label>Please enter you county (optional) + <input type="text" th:field="*{county}" name="county" id="county"> + </label><br><br> + <label for="postcode">Please enter your postcode + <input type="text" name="post_code" id="postcode"> + </label><br><br> + <input type="submit"> </form> </div> </body> -- GitLab