From 87c4901b1f5c12f8fde1dc904177aee1e47f487d Mon Sep 17 00:00:00 2001 From: Rhys Nute <nuterd@cardiff.ac.uk> Date: Mon, 11 Dec 2023 20:25:07 +0000 Subject: [PATCH] added css --- .../Organisation/organisationControllers.java | 5 +++-- .../static/css/localAuthorityPageStyle.css | 16 ++++++++++++++++ .../resources/templates/local-auth-data.html | 7 ++++--- .../resources/templates/local-authorities.html | 3 ++- 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/static/css/localAuthorityPageStyle.css diff --git a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java index 451d1e3f..e91419a9 100644 --- a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java +++ b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java @@ -8,6 +8,7 @@ import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.bind.annotation.PostMapping; @@ -26,10 +27,10 @@ public class organisationControllers { } @Autowired private localAuthorityRepository localAuthorityRepository; - @PostMapping("/local-auth-data") + @GetMapping("/local-auth-data.html") public ModelAndView localAuthSent(@Valid @ModelAttribute("localAuthority")localAuthority localAuthority, BindingResult bindingResult, Model model ) { if (bindingResult.hasErrors()){ - ModelAndView modelAndView = new ModelAndView("local-auth-data", model.asMap()); + ModelAndView modelAndView = new ModelAndView("local-auth-data.html", model.asMap()); return modelAndView; }else{// converts user input using the organisation constructor into a submittable format to the sql table diff --git a/src/main/resources/static/css/localAuthorityPageStyle.css b/src/main/resources/static/css/localAuthorityPageStyle.css new file mode 100644 index 00000000..61c59d35 --- /dev/null +++ b/src/main/resources/static/css/localAuthorityPageStyle.css @@ -0,0 +1,16 @@ +body{ + background-color: rgb(41, 41, 41) +} +h1{ + color: wheat; +} +h3{ + color: wheat; +} +ul{ + list-style: none; +} +ul li{ + color: wheat; + list-style: none; +} \ No newline at end of file diff --git a/src/main/resources/templates/local-auth-data.html b/src/main/resources/templates/local-auth-data.html index 46994635..abacfb46 100644 --- a/src/main/resources/templates/local-auth-data.html +++ b/src/main/resources/templates/local-auth-data.html @@ -3,14 +3,15 @@ <head> <meta charset="UTF-8"> <title>Local Authority</title> - <link rel="stylesheet" th:href="@{css\allTrails.css}"> - <link rel="stylesheet" th:href="@{css\templatingstyle.css}"> + + <link rel="stylesheet" th:href="@{css/localAuthortyPageStyle.css}"> + <link rel="stylesheet" th:href="@{css/templatingstyle.css}"> </head> <header th:insert="~{/towns/Templating.html::header}"></header> <body> <div id="container1"> <h2>Enter your Local authority</h2> - <form action="/local-auth-data" method="post" id="data" object="localauthsub"> + <form action="/local-auth-data" method="post" id="data" object="local-auth-data"> <p> <label for="localAuthorityName">Enter your local authority</label> <input type="text" name="authority_name" id="localAuthorityName"> diff --git a/src/main/resources/templates/local-authorities.html b/src/main/resources/templates/local-authorities.html index f7f93853..a0dab7fa 100644 --- a/src/main/resources/templates/local-authorities.html +++ b/src/main/resources/templates/local-authorities.html @@ -3,7 +3,8 @@ <head> <meta charset="UTF-8"> <title>Local Authorities</title> - <link rel="stylesheet" th:href="@{css\templatingstyle.css}"> + <link rel="stylesheet" th:href="@{css/localAuthorityPageStyle.css}"> + <link rel="stylesheet" th:href="@{css/templatingstyle.css}"> </head> <header th:insert="~{/towns/Templating.html::header}"></header> <body> -- GitLab