diff --git a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java index 7851f2dc982a5e410ee53324d00929ad729da41c..451d1e3f6240a4349a074799c12ed7e61cb7b71c 100644 --- a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java +++ b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java @@ -17,7 +17,7 @@ import java.util.List; @Controller public class organisationControllers { - @GetMapping("/localauthorities") + @GetMapping("/local-authorities") public ModelAndView getLocalAuthoritiesPage(){ ModelAndView mav = new ModelAndView("local-authorities"); List<localAuthority> localAuthority = localAuthorityRepository.getAllLocalAuthority(); @@ -26,8 +26,8 @@ public class organisationControllers { } @Autowired private localAuthorityRepository localAuthorityRepository; - @PostMapping("/localauthsub") - public ModelAndView localAuthSent(@Valid @ModelAttribute("local-auth-data")localAuthority localAuthority, BindingResult bindingResult, Model model ) { + @PostMapping("/local-auth-data") + public ModelAndView localAuthSent(@Valid @ModelAttribute("localAuthority")localAuthority localAuthority, BindingResult bindingResult, Model model ) { if (bindingResult.hasErrors()){ ModelAndView modelAndView = new ModelAndView("local-auth-data", model.asMap()); return modelAndView; diff --git a/src/main/resources/local-authorities.html b/src/main/resources/local-authorities.html deleted file mode 100644 index 567e0ae5326192585426c64c3b55629bee98847c..0000000000000000000000000000000000000000 --- a/src/main/resources/local-authorities.html +++ /dev/null @@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>Local Authorities</title> - <link rel="stylesheet" href="static/css/templatingstyle.css"> -</head> -<header th:insert="~{/towns/Templating.html::header}"></header> -<body> -<h1>Local Authorities</h1> -<div id="councils"> - <ul th:each="localauthority:${localauthorities}"> - <li th:text="${localauthority}"></li> - </ul> -</div> -<p>Local Autorities please enter here</p><button><a href="local-auth-data.html" id="authority">Login</a></button> -<footer th:insert="~{/towns/Templating.html::footer}"></footer> -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/local-auth-data.html b/src/main/resources/templates/local-auth-data.html similarity index 77% rename from src/main/resources/local-auth-data.html rename to src/main/resources/templates/local-auth-data.html index 5bcc9883cfd7a548c7c75615579b038439961b12..ec9f30bb4fe8b82370e50a699ede59ad91cf8033 100644 --- a/src/main/resources/local-auth-data.html +++ b/src/main/resources/templates/local-auth-data.html @@ -3,16 +3,17 @@ <head> <meta charset="UTF-8"> <title>Local Authority</title> - <link rel="stylesheet" th:href="@{css/landmarkFormStyle.css}"> - <link rel="stylesheet" th:href="@{css/templatingstyle.css}"> - <script src="scripts/landmarkFormThScript.js"></script></head> + <link rel="stylesheet" href=css\landmarkFormStyle.css> + <link rel="stylesheet" href=css\templatingstyle.css> +</head> +<header class="headerBar" th:fragment="header"> <body> <div id="container1"> <h2>Enter your Local authority</h2> - <form action="/localauthsub" method="post" id="data"> + <form action="/localauthsub" method="post" id="data" object="localauthsub"> <p> - <label for="localAthorityName">Enter your local authority</label> - <input type="text" name="authority_name" id="localAthorityName"> + <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> @@ -42,5 +43,5 @@ </form> </div> </body> -<footer th:insert="~{/towns/Templating.html::footer}"></footer> +<footer th:insert=/towns/Templating.html></footer> </html> \ No newline at end of file diff --git a/src/main/resources/templates/local-authorities.html b/src/main/resources/templates/local-authorities.html new file mode 100644 index 0000000000000000000000000000000000000000..b67e7b42c60e25d0c084dc1bb41a92b1f3e4f60e --- /dev/null +++ b/src/main/resources/templates/local-authorities.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Local Authorities</title> + <link rel="stylesheet" href="../static/css/templatingstyle.css"> +</head> +<body> +<h1>Local Authorities</h1> +<div id="councils"> + <ul th:each="localauthority:${localauthorities}"> + <li th:text="${localAuthority}"></li> + </ul> +</div> +<p>Local Authorities please enter here</p><button><a href="local-auth-data" id="authority">Login</a></button> +<footer insert=towns/Templating.html::footer></footer> +</body> +</html> \ No newline at end of file