From 15d7b383ec5f169dd2f35e466d58c3f3405d1e87 Mon Sep 17 00:00:00 2001 From: Rhys Nute <nuterd@cardiff.ac.uk> Date: Tue, 12 Dec 2023 19:34:11 +0000 Subject: [PATCH] updated --- .../Organisation/organisationControllers.java | 4 +- .../resources/templates/local-auth-data.html | 58 +++++++++---------- .../templates/local-authorities.html | 4 +- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java index 05cfe0ba..dbb21d3a 100644 --- a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java +++ b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java @@ -25,7 +25,7 @@ public class organisationControllers { } @GetMapping("/localForm") public ModelAndView getLocalAuthForm(){ - ModelAndView modelAndView = new ModelAndView("local-auth-data.html"); + ModelAndView modelAndView = new ModelAndView("local-auth-data"); modelAndView.addObject("localAuthority",new localAuthority()); return modelAndView; } @@ -34,7 +34,7 @@ public class organisationControllers { @PostMapping("/local-auth-data1") public ModelAndView localAuthSent(@Valid @ModelAttribute("localAuthority")localAuthority localAuthority, BindingResult bindingResult, Model model ) { if (bindingResult.hasErrors()){ - ModelAndView modelAndView = new ModelAndView("local-auth-data.html", model.asMap()); + ModelAndView modelAndView = new ModelAndView("local-auth-data1", model.asMap()); return modelAndView; }else{// converts user input using the organisation constructor into a submittable format to the sql table diff --git a/src/main/resources/templates/local-auth-data.html b/src/main/resources/templates/local-auth-data.html index 3bfcf75d..dd217e1f 100644 --- a/src/main/resources/templates/local-auth-data.html +++ b/src/main/resources/templates/local-auth-data.html @@ -1,45 +1,39 @@ <!DOCTYPE html> -<html lang="en"> +<html lang="en" xmlns="http://www.w3.org/1999/html"> <head> <meta charset="UTF-8"> <title>Local Authority</title> - <link rel="stylesheet" th:href="@{css/localAuthortyPageStyle.css}"> - <link rel="stylesheet" th:href="@{../static/css/templatingstyle.css}"> + <link rel="stylesheet" th:href="@{css/landmarkFormStyle.css}"> + <link rel="stylesheet" th:href="@{css/templatingstyle.css}"> </head> <header th:insert="~{/towns/Templating.html::header}"></header> <body> <div id="container1"> <h2>Enter your Local authority</h2> - <form action="/local-auth-data1" method="post" id="data"> - <p> - <label for="localAuthorityName">Enter your local authority</label> - <input type="text" name="authority_name" id="localAuthorityName"> - </p> - <p> - <label for="address1">Please enter first line of your address</label> - <input type="text" name="address_1" id="address1"> - </p> - <p> - <label for="address2">Please enter second line of your address (optional)</label> - <input type="text" name="address_2" id="address2"> - </p> - <p> - <label for="city">Please enter the City/Town</label> - <input type="text" name="city" id="city"> - </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> - <p> - <label for="website">Please enter your website address</label> - <input type="url" name="web_site" id="website"> - </p> + <form action="/local-auth-data1" id="data" name="data" method="post"> + <br> + <label for="localAuthorityName">Enter your local authority + <input type="text" field="localAuthorityName" name="authority_name" id="localAuthorityName"> + </label><br><br> + <label for="address1">Please enter first line of your address + <input type="text" name="address_1" id="address1"> + </label><br><br> + <label for="address2">Please enter second line of your address (optional) + <input type="text" name="address_2" id="address2"> + </label><br><br> + <label for="city">Please enter the City/Town + <input type="text" name="city" id="city"> + </label><br><br> + <label for="county">Please enter you county (optional) + <input type="text" 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> + <label for="website">Please enter your website address + <input type="url" name="web_site" id="website"> + </label><br><br> <input type="submit" value="Submit"> </form> </div> diff --git a/src/main/resources/templates/local-authorities.html b/src/main/resources/templates/local-authorities.html index 577f8fdc..ecf80b64 100644 --- a/src/main/resources/templates/local-authorities.html +++ b/src/main/resources/templates/local-authorities.html @@ -14,7 +14,7 @@ <li th:text="${localauthorities}"></li> </ul> </div> -<button><a href="local-auth-data.html" id="authority">Local Authorities please enter here</a></button> -<footer th:insert=/towns/Templating.html::footer></footer> +<a href="/localForm" id="authority"><button>Local Authorities please enter here</a></button> +<footer th:insert="~{/towns/Templating.html::footer}"></footer> </body> </html> \ No newline at end of file -- GitLab