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

updated

parent f6149996
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."
......@@ -21,6 +21,7 @@ public class organisationControllers {
public ModelAndView getLocalAuthoritiesPage(){
ModelAndView mav = new ModelAndView("local-authorities");
List<localAuthority> localAuthority = localAuthorityRepository.getAllLocalAuthority();
mav.addObject("localAuth", localAuthority);
return mav;
}
@GetMapping("/localForm")
......@@ -33,6 +34,7 @@ public class organisationControllers {
private localAuthorityRepository localAuthorityRepository;
@PostMapping("/local-auth-data")
public ModelAndView localAuthSent(@Valid @ModelAttribute("localAuthority")localAuthority localAuthority, BindingResult bindingResult, Model model ) {
List<localAuthority> localAuthorityList = localAuthorityRepository.getAllLocalAuthority();
if (bindingResult.hasErrors()){
ModelAndView modelAndView = new ModelAndView("local-auth-data", model.asMap());
return modelAndView;
......
......@@ -19,15 +19,15 @@ public class localAuthority {
private URL website;
@Override
public String toString() {
return "localAuthority" +
localAuthorityName + '\'' +
address1 + '\'' +
address2 + '\'' +
city + '\'' +
county + '\'' +
postcode + '\'' +
return "Local Authority:" + " " +
localAuthorityName + '\'' + " " +
address1 + '\'' + " " +
address2 + '\'' + " " +
city + '\'' + " " +
county + '\'' + " " +
postcode + '\'' + " " +
website +
'.';
" ";
}
public String getLocalAuthorityName() {
......
......@@ -10,11 +10,11 @@
<body>
<h1>Local Authorities</h1>
<div id="councils">
<ul th:each="localAuthority:${localAuthority}">
<li th:text="${localAuthority}"></li>
<ul th:each="local:${localAuth}">
<li th:text="${local}"></li>
</ul>
</div>
<a href="/localForm" id="authority"><button>Local Authorities please enter here</a></button>
<button><a href="/localForm" id="authority">Local Authorities please enter here</a></button>
<footer th: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