Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team 5 - Smart Towns
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rhys Evans
Team 5 - Smart Towns
Commits
e9962cae
Commit
e9962cae
authored
1 year ago
by
Rhys Evans
Browse files
Options
Downloads
Patches
Plain Diff
Further work on verification, adn lcoation sleection changed to a drop down menu
parent
fc165012
No related branches found
Branches containing commit
No related tags found
1 merge request
!13
Resolve "As a user I want to be able submit a form about a specific landmark to add to the trail"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/resources/templates/Landmarks/LandmarkForm.css
+10
-0
10 additions, 0 deletions
src/main/resources/templates/Landmarks/LandmarkForm.css
src/main/resources/templates/Landmarks/LandmarkFormTh.html
+64
-16
64 additions, 16 deletions
src/main/resources/templates/Landmarks/LandmarkFormTh.html
with
74 additions
and
16 deletions
src/main/resources/templates/Landmarks/LandmarkForm.css
0 → 100644
+
10
−
0
View file @
e9962cae
main
{
background
:
black
;
color
:
wheat
;
}
#landmarkSubmission
{
color
:
white
;
border-color
:
white
;
align-content
:
center
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/resources/templates/Landmarks/LandmarkFormTh.html
+
64
−
16
View file @
e9962cae
...
...
@@ -3,42 +3,72 @@
<head>
<meta
charset=
"UTF-8"
>
<title>
Landmark Sign Up
</title>
<link
rel=
"stylesheet"
href=
"LandmarkForm.css"
>
<style>
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
:
600px
;
margin
:
0
auto
}
</style>
</head>
<body>
<header
th:insert=
"~{/towns/Templating.html :: header}"
></header>
<main>
<form
action=
"/landmarkSub"
id=
"landmarkSubmission"
name=
"landmarkSubmission"
method=
"post"
th:object=
"${landmarkData}"
onsubmit=
"return landmarkFormValidation()"
>
<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}"
>
</label><br>
</label><br>
<br>
<div
th:errors=
"*{landmarkName}"
th:if=
"${#fields.hasErrors('landmarkName')}"
>
ErrorLandmarkName
</div>
<label>
Contact Address:
<input
type=
"text"
th:field=
"*{landmarkEmail}"
>
</label><br>
</label><br>
<br>
<div
th:errors=
"*{landmarkEmail}"
th:if=
"${#fields.hasErrors('landmarkEmail')}"
>
ErrorEmail
</div>
<label>
Please Describe Your Business:
<br>
<textarea
th:field=
"*{landmarkDescription}"
rows=
"8"
cols=
"60"
></textarea>
</label><br>
<label>
Your town/city:
<input
type=
"text"
th:field=
"*{landmarkLocation}"
>
</label><br>
</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>
<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=
1
>
Trail 1
</option>
<option
value=
2
>
Trail 2
</option>
<option
value=
3
>
Trail 3
</option>
<option
value=
1
>
(Caerphilly) Castle Trail
</option>
<option
value=
2
>
(Caerphilly) Pub Trail
</option>
<option
value=
3
>
(Caerphilly) Heritage Trail
</option>
<option
value=
4
>
(Caerphilly) Heritage Trail
</option>
<option
value=
5
>
(Caerphilly) Heritage Trail
</option>
</select>
</div>
</label><br>
</label><br><br>
<input
type=
"submit"
>
<hr
style=
"height:0px; visibility:hidden;"
/>
</form>
</main>
...
...
@@ -50,18 +80,36 @@
function
landmarkFormValidation
(){
// let element=document.getElementById("landmarkSubmission");
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
>
3
00
){
alert
(
'
Please keep your
review
to a maximum of
3
00 words.
'
);
if
(
descriptionWrdCount
>
2
00
){
alert
(
'
Please keep your
description
to a maximum of
2
00 words.
'
);
pass
=
false
;
}
if
(
trail
==
0
){
alert
(
'
Invalid trail selected.
\n
Please select the trail you wish to join.
'
);
pass
=
false
;
}
else
{
trail
.
innerHTML
=
option
.
text
;
alert
(
trail
.
innerHTML
)
alert
(
'
a
'
)
}
if
(
location
==
0
){
alert
(
'
Invalid location selected.
\n
Please select the location you wish to join.
'
);
pass
=
false
;
}
if
(
trail
==
5
){
trail
.
value
=
29
;
}
return
pass
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment