Skip to content
Snippets Groups Projects
Commit 023977e5 authored by Rhys Nute's avatar Rhys Nute
Browse files

Database fixes

parent fa1a0cab
No related branches found
No related tags found
2 merge requests!38Draft: Businesses,!31Resolve "As a user, I want to see a page of local authorities so that I can easily source contact details for a variety of different local authorities."
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
@Controller @Controller
public class organisationControllers { public class organisationControllers {
@GetMapping("/localauthorities") @GetMapping("/local-authorities")
public ModelAndView getLocalAuthoritiesPage(){ public ModelAndView getLocalAuthoritiesPage(){
ModelAndView mav = new ModelAndView("local-authorities"); ModelAndView mav = new ModelAndView("local-authorities");
List<localAuthority> localAuthority = localAuthorityRepository.getAllLocalAuthority(); List<localAuthority> localAuthority = localAuthorityRepository.getAllLocalAuthority();
...@@ -26,8 +26,8 @@ public class organisationControllers { ...@@ -26,8 +26,8 @@ public class organisationControllers {
} }
@Autowired @Autowired
private localAuthorityRepository localAuthorityRepository; private localAuthorityRepository localAuthorityRepository;
@PostMapping("/localauthsub") @PostMapping("/local-auth-data")
public ModelAndView localAuthSent(@Valid @ModelAttribute("local-auth-data")localAuthority localAuthority, BindingResult bindingResult, Model model ) { public ModelAndView localAuthSent(@Valid @ModelAttribute("localAuthority")localAuthority localAuthority, BindingResult bindingResult, Model model ) {
if (bindingResult.hasErrors()){ if (bindingResult.hasErrors()){
ModelAndView modelAndView = new ModelAndView("local-auth-data", model.asMap()); ModelAndView modelAndView = new ModelAndView("local-auth-data", model.asMap());
return modelAndView; return modelAndView;
......
...@@ -3,16 +3,17 @@ ...@@ -3,16 +3,17 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Local Authority</title> <title>Local Authority</title>
<link rel="stylesheet" th:href="@{css/landmarkFormStyle.css}"> <link rel="stylesheet" href=css\landmarkFormStyle.css>
<link rel="stylesheet" th:href="@{css/templatingstyle.css}"> <link rel="stylesheet" href=css\templatingstyle.css>
<script src="scripts/landmarkFormThScript.js"></script></head> </head>
<header class="headerBar" th:fragment="header">
<body> <body>
<div id="container1"> <div id="container1">
<h2>Enter your Local authority</h2> <h2>Enter your Local authority</h2>
<form action="/localauthsub" method="post" id="data"> <form action="/localauthsub" method="post" id="data" object="localauthsub">
<p> <p>
<label for="localAthorityName">Enter your local authority</label> <label for="localAuthorityName">Enter your local authority</label>
<input type="text" name="authority_name" id="localAthorityName"> <input type="text" name="authority_name" id="localAuthorityName">
</p> </p>
<p> <p>
<label for="address1">Please enter first line of your address</label> <label for="address1">Please enter first line of your address</label>
...@@ -42,5 +43,5 @@ ...@@ -42,5 +43,5 @@
</form> </form>
</div> </div>
</body> </body>
<footer th:insert="~{/towns/Templating.html::footer}"></footer> <footer th:insert=/towns/Templating.html></footer>
</html> </html>
\ No newline at end of file
...@@ -3,17 +3,16 @@ ...@@ -3,17 +3,16 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Local Authorities</title> <title>Local Authorities</title>
<link rel="stylesheet" href="static/css/templatingstyle.css"> <link rel="stylesheet" href="../static/css/templatingstyle.css">
</head> </head>
<header th:insert="~{/towns/Templating.html::header}"></header>
<body> <body>
<h1>Local Authorities</h1> <h1>Local Authorities</h1>
<div id="councils"> <div id="councils">
<ul th:each="localauthority:${localauthorities}"> <ul th:each="localauthority:${localauthorities}">
<li th:text="${localauthority}"></li> <li th:text="${localAuthority}"></li>
</ul> </ul>
</div> </div>
<p>Local Autorities please enter here</p><button><a href="local-auth-data.html" id="authority">Login</a></button> <p>Local Authorities please enter here</p><button><a href="local-auth-data" id="authority">Login</a></button>
<footer th:insert="~{/towns/Templating.html::footer}"></footer> <footer insert=towns/Templating.html::footer></footer>
</body> </body>
</html> </html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment