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;
@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;
......
......@@ -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
......@@ -3,17 +3,16 @@
<head>
<meta charset="UTF-8">
<title>Local Authorities</title>
<link rel="stylesheet" href="static/css/templatingstyle.css">
<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>
<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>
<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
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