diff --git a/src/main/java/Team5/SmartTowns/localauthority/localAuthority.java b/src/main/java/Team5/SmartTowns/localauthority/localAuthority.java index 4733c5ddb3a34f6389da9eab28e4f9c6ee31ad03..0915dcddbe126e26fce6b1a35b5e41bce24a0f60 100644 --- a/src/main/java/Team5/SmartTowns/localauthority/localAuthority.java +++ b/src/main/java/Team5/SmartTowns/localauthority/localAuthority.java @@ -3,6 +3,8 @@ package Team5.SmartTowns.localauthority; import lombok.AllArgsConstructor; import lombok.Data; +import java.net.URL; + @AllArgsConstructor @Data public class localAuthority { @@ -12,7 +14,7 @@ public class localAuthority { private String city; private String county; private String postcode; - private String website; + private URL website; @Override public String toString() { return "localAuthority{" + @@ -50,9 +52,7 @@ public class localAuthority { return postcode; } - public String getWebsite() { + public URL getWebsite() { return website; } - - } diff --git a/src/main/java/Team5/SmartTowns/localauthority/localAuthorityRepositoryJDBC.java b/src/main/java/Team5/SmartTowns/localauthority/localAuthorityRepositoryJDBC.java index bdaa4fec44b1936ee45bd464f656e0c4c0a8393e..e2039617c8a8d1f8891ed869efb2c5f6588be215 100644 --- a/src/main/java/Team5/SmartTowns/localauthority/localAuthorityRepositoryJDBC.java +++ b/src/main/java/Team5/SmartTowns/localauthority/localAuthorityRepositoryJDBC.java @@ -24,7 +24,7 @@ public class localAuthorityRepositoryJDBC implements localAuthorityRepository { rs.getString("city"), rs.getString("county"), rs.getString("postcode"), - rs.getString("website") + rs.getURL("website") ); } public List<localAuthority> getAllLocalAuthority(){ diff --git a/src/main/resources/templates/local-auth-data.html b/src/main/resources/templates/local-auth-data.html index ec9f30bb4fe8b82370e50a699ede59ad91cf8033..46994635dbc62744503aecadc1ea4874d18303b5 100644 --- a/src/main/resources/templates/local-auth-data.html +++ b/src/main/resources/templates/local-auth-data.html @@ -3,14 +3,14 @@ <head> <meta charset="UTF-8"> <title>Local Authority</title> - <link rel="stylesheet" href=css\landmarkFormStyle.css> - <link rel="stylesheet" href=css\templatingstyle.css> + <link rel="stylesheet" th:href="@{css\allTrails.css}"> + <link rel="stylesheet" th:href="@{css\templatingstyle.css}"> </head> -<header class="headerBar" th:fragment="header"> +<header th:insert="~{/towns/Templating.html::header}"></header> <body> <div id="container1"> <h2>Enter your Local authority</h2> - <form action="/localauthsub" method="post" id="data" object="localauthsub"> + <form action="/local-auth-data" method="post" id="data" object="localauthsub"> <p> <label for="localAuthorityName">Enter your local authority</label> <input type="text" name="authority_name" id="localAuthorityName"> @@ -39,9 +39,9 @@ <label for="website">Please enter your website address</label> <input type="url" name="web_site" id="website"> </p> - <input type="submit" value="Submit Data"> + <input type="submit" value="Submit"> </form> </div> </body> -<footer th:insert=/towns/Templating.html></footer> +<footer th:insert="~{/towns/Templating.html::footer}"></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 index b67e7b42c60e25d0c084dc1bb41a92b1f3e4f60e..f7f93853a4c9dd6b32f494143135b4307a873a10 100644 --- a/src/main/resources/templates/local-authorities.html +++ b/src/main/resources/templates/local-authorities.html @@ -3,16 +3,17 @@ <head> <meta charset="UTF-8"> <title>Local Authorities</title> - <link rel="stylesheet" href="../static/css/templatingstyle.css"> + <link rel="stylesheet" th:href="@{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 th:each="localauthorities:${localAuthority}"> + <li th:text="${localauthorities}"></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> +<button><a href="local-auth-data" 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