Skip to content
Snippets Groups Projects
Commit 6cfc5519 authored by Connor Brock's avatar Connor Brock
Browse files

Added header and footers.

parents 97a1c7ad a56c2213
No related branches found
No related tags found
1 merge request!18Resolve "As a child, I want an interesting and exciting story based trail with obvious landmarks, so I can follow the trail with ease."
......@@ -20,7 +20,7 @@ public class Landmarks {
//Predefined Landmark for Dragons Tale.
public static List<Landmarks> landmarksDragonstrail = List.of(
new Landmarks( 1, "A scent of...Dragon", "The Dragon has been spotted near by, find the QR code to continue" , "location test"),
new Landmarks( 1, "A scent of...Dragon", "The Dragon has been spotted near by, find the QR code to continue" , "Start your discovery, at the sweet shop."),
new Landmarks( 2, "They've been found!", "Don't let them escape, find the next QR code to continue!", "location test")
);
......
package Team5.SmartTowns.Landmarks;
import Team5.SmartTowns.trails.Trail;
import jakarta.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
......@@ -8,7 +7,6 @@ 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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
//import jakarta.validation.Valid;
......@@ -23,33 +21,33 @@ public class LandmarksController {
return modelAndView1;
}
@PostMapping("/landmarkSub")
public ModelAndView landmarkSent(@Valid @ModelAttribute("landmarkData") Landmarks landmarks, BindingResult bindingResult, Model model ) {
if (bindingResult.hasErrors()) {
ModelAndView modelAndView = new ModelAndView("Landmarks/LandmarkFormTh.html", model.asMap());
return modelAndView;
} else{
System.out.println(landmarks);
// current functionality only prints successful Landmarks, (todo )database integration is necessary here
ModelAndView modelAndView = new ModelAndView("redirect:/test.html");
return modelAndView;
}
}
// @GetMapping("/dragonstale/{")
// public ModelAndView getAllTrails(){
// ModelAndView mav = new ModelAndView("allTrails/allTrails");
// mav.addObject("landmarks", Landmarks.landmarks); //Mock data for trails
// return mav;
// }
}
}
......@@ -7,15 +7,12 @@ import java.util.List;
@Data
public class Trail {
//List not existing upon creation of database.
public static List<Trail> trails = List.of(
new Trail(1,"Caerphilly Castle Trail", "Take a stroll through the grounds of one of Europe's finest historic buildings and you will see stunning views of the castle and the lakes. The route of the trail is marked with eight special circular markers, which depict various fascinating historical facts relating to the castle. Pupils from Ysgol Gynradd Gymraeg Caerffili, Plasyfelin Junior School, Ysgol Y Castell and Twyn Primary worked with the artist to come up with the different designs. You do not need to pay to go in the castle to complete this trail. This Trail is fairly short at 1.5 miles and very suitable for wheelchairs and pushchairs as the route stays mostly on well-marked and ramped paths with just a couple of short diversions onto grassed areas."),
new Trail(2,"Trail2", "This is trail two"),
new Trail(3,"Trail3", "This is trail three"),
new Trail(4,"Trail4", "This is trail four"),
new Trail(5,"Trail5", "EDITING THIS"),
new Trail(6, "A Dragon's Tale", "Adventurers... embark through mystical historical landmarks to ultimately discover the lair of the dragon. Legend has it that within this ominous lair, mighty dragons, guardians of ancient wisdom and treasures untold lay....")
new Trail(5,"Trail5", "EDITING THIS")
);
int id;
String name;
......@@ -31,10 +28,6 @@ public class Trail {
imgPath = findImagePath();
}
public Trail() {
this.id = id;
}
private String findImagePath(){
/* Finds the image in the Path folder, if image is not found assigns default image */
String imgPath = "images/trails/trail" + id + ".jpg";
......
......@@ -4,40 +4,44 @@
<meta charset="UTF-8">
<title>A Dragon's Tale</title>
<link rel="stylesheet" th:href="@{/css/dragonstaless.css}">
<link rel="stylesheet" th:href="@{/css/templatingstyle.css}">
</head>
<body>
<div class="centre">
<h1> Welcome, to a dragon's tale! </h1>
<img th:src="@{/images/trails/dragonstalehome.png}" alt="Image of a dragon">
<h2> Discover the mystery of the dragon, track its location and follow it throughout the town of (thymeleaf element) to discover a prize! </h2>
</div>
<div class="centre">
<p>
Adventurers... embark through mystical historical landmarks to ultimately discover the lair of the dragon.
Legend has it that within this ominous lair, mighty dragons, guardians of ancient wisdom and treasures untold lay....
</p>
</div>
<div class="centre">
<ul th:each="item : ${landmarksList}">
<p th:text="${item.landmarkName}"></p>
<p th:text="${item.landmarkDescription}"></p>
</ul>
</div>
<div class="centre">
<h3>Begin your hunt!</h3>
<button type="button" id="begin">Click here!</button>
</div>
<script>
document.getElementById("begin").addEventListener("click", function (){
window.location.href = ("/dragonstale/landmarkone");
})
</script>
</body>
<body>
<header th:insert="towns/Templating.html :: header"></header>
<div class="centre">
<h1> Welcome, to a dragon's tale! </h1>
<img th:src="@{/images/trails/dragonstalehome.png}" alt="Image of a dragon">
<h2> Discover the mystery of the dragon, track its location and follow it throughout the town of (thymeleaf element) to discover a prize! </h2>
</div>
<div class="centre">
<p>
Adventurers... embark through mystical historical landmarks to ultimately discover the lair of the dragon.
Legend has it that within this ominous lair, mighty dragons, guardians of ancient wisdom and treasures untold lay....
</p>
</div>
<div class="centre">
<ul th:each="item : ${landmarksList}">
<p th:text="${item.landmarkName}"></p>
<p th:text="${item.landmarkDescription}"></p>
</ul>
</div>
<div class="centre">
<h3>Begin your hunt!</h3>
<button type="button" id="begin">Click here!</button>
</div>
<div th:insert="towns/Templating.html :: footer"></div>
<script>
document.getElementById("begin").addEventListener("click", function (){
window.location.href = ("/dragonstale/landmarkone");
})
</script>
</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