Skip to content
Snippets Groups Projects
Commit 9a03ae39 authored by Rhys Evans's avatar Rhys Evans
Browse files

added commenting and cleaned up commented out code

parent 6bc9f112
No related branches found
No related tags found
1 merge request!13Resolve "As a user I want to be able submit a form about a specific landmark to add to the trail"
......@@ -25,11 +25,5 @@ public class Landmarks {
this.trailID =0;
}
// public Landmarks(String landmarkName, String landmarkEmail, String landmarkDescription, String landmarkLocation, Integer trailID) {
// this.landmarkName = landmarkName;
// this.landmarkEmail = landmarkEmail;
// this.landmarkDescription = landmarkDescription;
// this.landmarkLocation = landmarkLocation;
// this.trailID = trailID;
// }
}
package Team5.SmartTowns.Landmarks;
import java.util.ArrayList;
import java.util.List;
public class LandmarksArray {
private List<Landmarks> landmarksList;
private static LandmarksArray singelton;
LandmarksArray() {
landmarksList = new ArrayList<>(); //ArrayList is mutable
landmarksList.addAll(
List.of(
new Landmarks("park","asd","desc","loc",9)
)
);
}
// public static UserArray getInstance() {
// if (singleton == null) {
// singleton = new UserArray();
//
// }
// return singleton;
// }
}
......@@ -13,7 +13,7 @@ import org.springframework.web.servlet.ModelAndView;
@Controller
public class LandmarksController {
// Controllers for LandmarkFormTh.html landmark submission form
@GetMapping("/landmarkSubmission")
public ModelAndView landmarkSubmission(){
ModelAndView modelAndView1 = new ModelAndView("Landmarks/LandmarkFormTh.html");
......@@ -33,19 +33,15 @@ public class LandmarksController {
} else{
System.out.println(landmarks);
// current functionality only prints successful Landmarks, (todo )database integration is necessary here
// LandmarksArray userArray = LandmarksArray.getInstance();
// Landmarks newUserSubmission = new Landmarks(landmarkData.getFormUsername(),userSubmission.getFormEmail(),
// userSubmission.getFormPark(), userSubmission.getFormDescription(),userSubmission.getFormCafe(), userSubmission.getFormToilets());
// userArray.addUserSubmission(newUserSubmission);
// System.out.println(userArray.getFormItems());
//
ModelAndView modelAndView = new ModelAndView("redirect:/test.html");
return modelAndView;
}
// return modelAndView;
......@@ -53,13 +49,5 @@ public class LandmarksController {
}
// @PostMapping("/landmarkSubmission")
// public ModelAndView landmarkSubmission( Landmarks landmarks){
// System.out.println(landmarks);
// ModelAndView modelAndView = new ModelAndView("redirect:/thankyou.html");
//
// return modelAndView;
//
// }
}
/*LandmarkFormTh stylesheet*/
body{
background: rgb(41, 41, 41);
color: wheat;
......
......@@ -7,36 +7,13 @@
<link rel="stylesheet" th:href="@{css/templatingstyle.css}">
<style>
/*main{*/
/* 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: 600px;*/
/* margin: 0 auto*/
/*}*/
</style>
</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>
......@@ -52,7 +29,6 @@
<textarea th:field="*{landmarkDescription}" rows="8" cols="60" placeholder="Max 200 words please..."></textarea>
</label><br><br>
<label>Your Location:
<!-- <input type="text" th:field="*{landmarkLocation}">-->
<select th:field="*{landmarkLocation}">
<option value="" disabled selected>Select Location</option>
<option value="Caerphilly">Caerphilly</option>
......@@ -85,7 +61,7 @@
// verification function of the above form
function landmarkFormValidation(){
var pass=true;
var trail = document.forms["landmarkSubmission"]["trailID"].value
......@@ -97,7 +73,7 @@
pass = false;
}
if (trail==0){
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;
}
......@@ -105,7 +81,7 @@
if (location==""){
alert('Invalid location selected. \nPlease select the location you wish to join.');
pass = false;
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)) ||
......
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