Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • d1656298/client-project
  • d1634883/client-project
2 results
Show changes
Commits on Source (16)
Showing
with 374 additions and 17 deletions
......@@ -28,6 +28,9 @@ dependencies {
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// implementation 'org.springframework.boot:spring-boot-starter-jdbc'
// implementation 'org.mariadb.jdbc:mariadb-java-client:2.1.2'
}
tasks.named('bootBuildImage') {
......
package Team5.SmartTowns.Landmarks;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class Landmarks {
@NotEmpty(message = "You must type in a username.")
private String landmarkName;
@Email(message = "You must attach a contact address.")
private String landmarkEmail;
private String landmarkDescription;
private String landmarkLocation;
private Integer trailID;
public Landmarks(){
this.landmarkName ="";
this.landmarkEmail="";
this.landmarkDescription ="";
this.landmarkLocation ="";
this.trailID =0;
}
}
package Team5.SmartTowns.Landmarks;
import jakarta.validation.Valid;
import org.springframework.stereotype.Controller;
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.PostMapping;
import org.springframework.web.servlet.ModelAndView;
//import jakarta.validation.Valid;
@Controller
public class LandmarksController {
// Controllers for LandmarkFormTh.html landmark submission form
@GetMapping("/landmarkSubmission")
public ModelAndView landmarkSubmission(){
ModelAndView modelAndView1 = new ModelAndView("Landmarks/LandmarkFormTh.html");
modelAndView1.addObject("landmarkData", new Landmarks());
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;
}
}
}
/*LandmarkFormTh stylesheet*/
body{
background: rgb(41, 41, 41);
color: wheat;
}
#landmarkSubmission {
background-color: rgb(206, 153, 253);
color: black;
border-color: white;
align-content: center;
text-align: center;
border-radius: 25px;
max-width: 620px;
margin: 0 auto
}
#landmarkFormTitle{
color:white;
text-align: center;
}
\ No newline at end of file
/* Header */
.headerBar {
border-bottom: 2px rgb(230, 230, 230) solid;
margin-bottom: 20px;
display: flex;
background: blueviolet;
}
/* Navbar Links */
.navBar {
margin-top: 50px;
margin-left: auto;
margin-right:20px;
text-align: right;
}
.work{
color: rgb(255, 255, 255);
}
.navBar ul {
list-style: none;
display: flex;
margin-left: 100px;
}
.navBar a {
border-left: 2px rgb(185, 185, 185) solid;
padding: 10px 40px;
text-decoration: none;
color:rgb(87, 86, 86);
white-space: nowrap;
overflow: hidden;
float: right;
}
.navBar a:hover {
background-color: rgb(209, 209, 209);
}
.navBar li{
margin-left: 10px;
margin-right: 10px;
color: rgb(255, 255, 255);
}
.navListLast {
border-right: 2px rgb(185, 185, 185) solid;
margin-right:40px;
}
/* Navbar Logo */
.Logo {
margin-left:10px;
padding: 20px;
width: fit-content;
}
.Logo img {
width: 120px;
margin-left:15px;
}
/* Footer */
footer {
margin-top:20px;
display: flex;
justify-content: center;
}
.footerBar{
border-top: 2px rgb(230, 230, 230) solid;
text-align: left;
display: flex;
background: blueviolet;
color: rgb(255, 255, 255);
padding-left: 30px;
}
.footerBar ul {
list-style: none;
display: flex;
}
.copyright{
text-align: left;
display: flex;
}
.containerFooter{
display: flex;
flex-direction: row;
}
.leftFooter{
flex:1;
color: rgb(255, 255,255);
}
.centerFooter{
flex: 1;
color: rgb(255, 255,255);
}
.rightFooter{
flex:1;
color: rgb(255, 255, 255);
}
\ No newline at end of file
src/main/resources/static/images/Facebook.png

5.53 KiB

src/main/resources/static/images/Instagram.jpg

7.69 KiB

src/main/resources/static/images/Linkedin.png

24.9 KiB

src/main/resources/static/images/Twitter.jpg

47.5 KiB

src/main/resources/static/images/VZTA.png

11.2 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Landmark Sign Up</title>
<link rel="stylesheet" th:href="@{css/landmarkFormStyle.css}">
<link rel="stylesheet" th:href="@{css/templatingstyle.css}">
</head>
<body>
<header th:insert="~{/towns/Templating.html :: header}"></header>
<hr style="height:20px; visibility:hidden;" />
<H2 id="landmarkFormTitle"> Interested in joining our trails? Sign up Here! </H2>
<main>
<!-- Form used to submit potential landmarks for trails-->
<form action="/landmarkSub" id="landmarkSubmission" name="landmarkSubmission" method="post" th:object="${landmarkData}" onsubmit="return landmarkFormValidation()">
<br>
<label>Business Name:
<input type="text" th:field="*{landmarkName}" placeholder="Business name here...">
</label><br>
<div th:errors="*{landmarkName}" th:if="${#fields.hasErrors('landmarkName')}">ErrorLandmarkName</div>
<br><label>Contact Address:
<input type="text" th:field="*{landmarkEmail}" placeholder="E-mail here...">
</label><br>
<div th:errors="*{landmarkEmail}" th:if="${#fields.hasErrors('landmarkEmail')}">ErrorEmail</div>
<br><label>Please Describe Your Business:<br>
<textarea th:field="*{landmarkDescription}" rows="18" cols="70" placeholder="Max 200 words please..."></textarea>
</label><br><br>
<label>Your Location:
<select th:field="*{landmarkLocation}">
<option value="" disabled selected>Select Location</option>
<option value="Caerphilly">Caerphilly</option>
<option value="Risca">Risca</option>
<option value="Penarth">Penarth</option>
</select>
</label><br><br>
<label>Trail:
<select th:field="*{trailID}">
<option value=0 disabled selected>Select Trail</option>
<option value=0101>(Caerphilly) Castle Trail</option>
<option value=0102>(Caerphilly) Pub Trail</option>
<option value=0103>(Caerphilly) Heritage Trail</option>
<option value=0201>(Risca) Heritage and Culture Trail</option>
<option value=0301>(Penarth) Esplanade Trail</option>
</select>
</label><br><br>
<input type="submit">
<hr style="height:0px; visibility:hidden;" />
</form>
<hr style="height:40px; visibility:hidden;" />
</main>
<script>
// verification function of the above form
function landmarkFormValidation(){
var pass=true;
var trail = document.forms["landmarkSubmission"]["trailID"].value
var location = document.forms["landmarkSubmission"]["landmarkLocation"].value
var description = document.forms["landmarkSubmission"]["landmarkDescription"].value;
var descriptionWrdCount=description.split(" ").length
if (descriptionWrdCount>200){
alert('Please keep your description to a maximum of 200 words.');
pass = false;
}
if (trail==0){ // values of 0 and "" used to ensure default drop down option isn't submittable
alert('Invalid trail selected. \nPlease select the trail you wish to join.');
pass = false;
}
if (location==""){
alert('Invalid location selected. \nPlease select the location you wish to join.');
pass = false; // ensure correct trail is selected in accordance to the town it takes place in
} if ( (location=="Caerphilly" & (parseInt(trail/100)!==1)) ||
(location=="Risca" & (parseInt(trail/100)!==2)) ||
(location=="Penarth" & (parseInt(trail/100)!==3)) ){
alert('Trail unavailable in your current location. \nPlease choose an available trail');
pass = false;
}
return pass;
}
</script>
<footer th:insert="~{/towns/Templating.html :: footer}"></footer>
</body>
</html>
\ No newline at end of file
......@@ -9,7 +9,6 @@
<body>
<header th:replace="fragments/temp_frags.html :: header"></header>
<main>
<div class="trailList">
<ul class="ulHeader">
......
<!--<<<<<<< HEAD-->
<!--<header th:fragment="headerBlock">-->
<!-- <br>Header Block<br>-->
<!--</header>-->
<!--<footer th:fragment="footerBlock">-->
<!-- <br><b>VZTA</b><br>-->
<!-- <br>Near Me Now LTD<br>-->
<!-- <br>Britania House<br>-->
<!-- <br>Caerphilly Business Park<br>-->
<!-- <br>Caerphilly<br>-->
<!-- <br>CF83 3GG<br>-->
<!-- <br>(C) VZTA 2022<br>-->
<!-- <br><b>Follow Us</b><br>-->
<!-- <br>Facebook Twitter Instagram LinkedIn<br>-->
<!-- <br>Privacy Policy Terms and Conditions<br>-->
<!--</footer>-->
<!--=======-->
<link rel="stylesheet" href="../../static/css/templatingstyle.css">
<header class="headerBar" th:fragment="header">
<div class="Logo">
<img src="../../static/images/VZTA.png" height="97" width="400" alt="VZTA Logo"/>
</div>
<nav class="navBar">
<ul>
<li>Home</li>
<li>FAQs</li>
<li>Contact us</li>
</ul>
<label class="work">Who we Work with:</label>
<select>
<ul>
<option value="localauthorities">Local Authorities</option>
<option value="towns">Towns</option>
<option value="businesses">Businesses</option>
<option value="consumers">Consumers</option>
</ul>
</select>
</nav>
</header>
<div class="footerBar" th:fragment="footer">
<div class="containerFooter">
<div class="leftFooter">
<h3>VZTA</h3>
Near Me Now LTD
<br>Britania House
<br>Caerphilly Business Park
<br>Caerphilly
<br>CF83 3GG
</div>
<div class="rightFooter">
<h3>Connect with us</h3>
<p>Be the first to know about updates by joining out Community page</p>
(C) VZTA 2022<br>
Policy Terms and Conditions
</div>
<div class="centerFooter">
<span class="footerText">
<h3>Follow Us</h3>
<a href="https://www.facebook.com/VZTAsmarttowns/" class="icon"><img src="../../static/images/Facebook.png" height="25" width="25" alt="Facebook Logo" class="icon"/></a>
<a href="https://www.twitter.com/VZTAsmarttowns/" class="icon"><img src="../../static/images/Twitter.jpg" height="25" width="25" alt="X (formally Twitter) Logo" class="icon"/></a>
<a href="https://www.instagram.com/vztasmarttowns/" class="icon"><img src="../../static/images/Instagram.jpg" height="25" width="25" alt="Instagram Logo" class="icon"/></a>
<a href="https://www.linkin.com/company/vztasmarttowns/" class="icon"><img src="../../static/images/Linkedin.png" height="25" width="25" alt="Linkedin Logo" class="icon"/></a><br>
</span>
</div>
<div class="copyright" style="text-align: left">
</div>
</div>
</div>
</div>
<!--&gt;>>>>>> main-->
......@@ -110,6 +110,7 @@
grid-template-columns: 50% 50%;
grid-template-rows: auto;
grid-template-areas:
"title1 title1"
"title2 title2"
"BadgeStickerProgress ."
......
<header th:fragment="headerBlock">
<br>Header Block<br>
</header>
<footer th:fragment="footerBlock">
<br><b>VZTA</b><br>
<br>Near Me Now LTD<br>
<br>Britania House<br>
<br>Caerphilly Business Park<br>
<br>Caerphilly<br>
<br>CF83 3GG<br>
<br>(C) VZTA 2022<br>
<br><b>Follow Us</b><br>
<br>Facebook Twitter Instagram LinkedIn<br>
<br>Privacy Policy Terms and Conditions<br>
</footer>
\ No newline at end of file