Skip to content

Commit de5611a

Browse files
authored
Merge pull request #151 from aperdec/develop
Version 1.0 merge
2 parents a38bf79 + 4f2d882 commit de5611a

46 files changed

Lines changed: 10483 additions & 1097 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 277 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,258 @@
11
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2-
pageEncoding="ISO-8859-1"%>
3-
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
4-
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
5-
6-
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
7-
<!DOCTYPE html>
8-
<html>
9-
<head>
10-
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
11-
<script
12-
src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
13-
<!-- Latest compiled and minified CSS -->
14-
<link rel="stylesheet"
15-
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
16-
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
17-
crossorigin="anonymous">
18-
19-
<!-- Optional theme -->
20-
<link rel="stylesheet"
21-
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
22-
integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r"
23-
crossorigin="anonymous">
24-
25-
<!-- Latest compiled and minified JavaScript -->
26-
<script
27-
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
28-
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
29-
crossorigin="anonymous"></script>
2+
pageEncoding="ISO-8859-1"%>
3+
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
4+
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
5+
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
6+
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
7+
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
8+
9+
<style>
10+
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700');
11+
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
12+
13+
*{
14+
box-sizing: border-box;
15+
margin: 0;
16+
padding: 0;
17+
}
18+
19+
html{
20+
background-color: #fff;
21+
font:normal 16px/1.5 sans-serif;
22+
color: #333;
23+
}
24+
25+
h3{
26+
font: normal 32px/1.5 'Open Sans', sans-serif;
27+
color: #2c3e50;
28+
margin: 50px 0;
29+
text-align: center;
30+
}
31+
32+
33+
.container2{
34+
max-width: 1000px;
35+
margin: 50px auto;
36+
padding: 20px;
37+
background-color: #efefef;
38+
}
39+
40+
.app2{
41+
width: 100%;
42+
position: relative;
43+
}
44+
45+
.app2 #start-camera{
46+
display: none;
47+
border-radius: 3px;
48+
max-width: 400px;
49+
color: #fff;
50+
background-color: #448AFF;
51+
text-decoration: none;
52+
padding: 15px;
53+
opacity: 0.8;
54+
margin: 50px auto;
55+
text-align: center;
56+
}
57+
58+
.app2 video#camera-stream{
59+
display: none;
60+
width: 100%;
61+
}
62+
63+
.app2 img#snap{
64+
position: absolute;
65+
top: 0;
66+
left: 0;
67+
width: 100%;
68+
z-index: 10;
69+
display: none;
70+
}
71+
72+
.app2 #error-message{
73+
width: 100%;
74+
background-color: #ccc;
75+
color: #9b9b9b;
76+
font-size: 28px;
77+
padding: 200px 100px;
78+
text-align: center;
79+
display: none;
80+
}
81+
82+
.app2 .controls{
83+
position: absolute;
84+
top: 0;
85+
left: 0;
86+
width: 100%;
87+
height: 100%;
88+
z-index: 20;
89+
90+
display: flex;
91+
align-items: flex-end;
92+
justify-content: space-between;
93+
padding: 30px;
94+
display: none;
95+
}
96+
97+
.app2 .controls a{
98+
border-radius: 50%;
99+
color: #fff;
100+
background-color: #111;
101+
text-decoration: none;
102+
padding: 15px;
103+
line-height: 0;
104+
opacity: 0.7;
105+
outline: none;
106+
-webkit-tap-highlight-color: transparent;
107+
}
108+
109+
.app2 .controls a:hover{
110+
opacity: 1;
111+
}
112+
113+
.app2 .controls a.disabled{
114+
background-color: #555;
115+
opacity: 0.5;
116+
cursor: default;
117+
pointer-events: none;
118+
}
119+
120+
.app2 .controls a.disabled:hover{
121+
opacity: 0.5;
122+
}
123+
124+
.app2 .controls a i{
125+
font-size: 18px;
126+
}
127+
128+
.app2 .controls #take-photo i{
129+
font-size: 32px;
130+
}
131+
132+
.app2 canvas{
133+
display: none;
134+
}
135+
136+
137+
138+
.app2 video#camera-stream.visible,
139+
.app2 img#snap.visible,
140+
.app2 #error-message.visible
141+
{
142+
display: block;
143+
}
144+
145+
.app2 .controls.visible{
146+
display: flex;
147+
}
148+
149+
150+
151+
@media(max-width: 1000px){
152+
.container2{
153+
margin: 40px;
154+
}
155+
156+
.app2 #start-camera.visible{
157+
display: block;
158+
}
159+
160+
.app2 .controls a i{
161+
font-size: 16px;
162+
}
163+
164+
.app2 .controls #take-photo i{
165+
font-size: 24px;
166+
}
167+
}
168+
169+
170+
@media(max-width: 600px){
171+
.container2{
172+
margin: 10px;
173+
}
174+
175+
.app2 #error-message{
176+
padding: 80px 50px;
177+
font-size: 18px;
178+
}
179+
180+
.app2 .controls a i{
181+
font-size: 12px;
182+
}
183+
184+
.app2 .controls #take-photo i{
185+
font-size: 18px;
186+
}
187+
}
188+
189+
#con {
190+
background-color: #EDEEFF;
191+
border-radius: 15px;
192+
}
193+
#btnXlg2 {
194+
padding: 24px 34px;
195+
font-size: 16px;
196+
line-height: normal;
197+
border-radius: 8px;
198+
}
199+
</style>
200+
30201
<title>Add Deficiency: ${unit.homeEnrollmentNumber}</title>
31-
</head>
32-
<body>
202+
203+
<script>
204+
function Validate() {
205+
if (ValidateCategories() && ValidateLocation()) {
206+
return true;
207+
} else if (ValidateCategories()) {
208+
$('#selectCategory').hide();
209+
return false;
210+
} else if (ValidateLocation()) {
211+
$('#selectLocation').hide();
212+
return false;
213+
} else {
214+
return false;
215+
}
216+
}
217+
218+
function ValidateLocation() {
219+
var e = document.getElementById("location");
220+
//if you need text to be compared then use
221+
var strUser1 = e.options[e.selectedIndex].text;
222+
if(strUser1=="Select A Location") {
223+
$('#alert').show();
224+
$('#selectLocation').show();
225+
return false;
226+
} else {
227+
return true;
228+
}
229+
}
230+
231+
function ValidateCategories() {
232+
var e = document.getElementById("category");
233+
//if you need text to be compared then use
234+
var strUser1 = e.options[e.selectedIndex].text;
235+
if(strUser1=="Select A Category") {
236+
$('#alert').show();
237+
$('#selectCategory').show();
238+
return false;
239+
} else {
240+
return true;
241+
}
242+
}
243+
</script>
33244

34245
<div style="margin: 2%">
35246
<c:url value="/saveDeficiency" var="url" />
36-
<form name="form" class="form-horizontal" method="post" action="${url}">
37-
247+
<form name="form" class="form-horizontal" method="post" onsubmit="return Validate()" action="${url}">
248+
<div class="jumbotron" id="con">
38249
<fieldset>
39-
<legend>Enter or Edit Information</legend>
250+
<legend>Enter or Edit Deficiency Information</legend>
251+
<br>
252+
<div class="alert alert-danger collapse" id="alert" >
253+
<div id="selectCategory" class="collapse">Please select a category.</div>
254+
<div id="selectLocation" class="collapse">Please select a location.</div>
255+
</div>
40256

41257
<div class="form-group">
42258
<label for="id" class="col-lg-1 control-label">Deficiency Number</label>
@@ -56,6 +272,7 @@
56272
<label for="location" class="col-lg-1 control-label">Location</label>
57273
<div class="col-lg-10">
58274
<select name="location" class="form-control" id="location">
275+
<option>Select A Location</option>
59276
<option>Kitchen</option>
60277
<option>Master Bedroom</option>
61278
<option>Bedroom</option>
@@ -81,7 +298,7 @@
81298
<div class="col-lg-10">
82299
<select class="form-control" id="constructionPersonnel" name="constructionPersonnel">
83300
<c:forEach var="constructionPersonnel" items="${constructionPersonnelList}">
84-
<option>${constructionPersonnel.name}</option>
301+
<option>${constructionPersonnel.trade} - ${constructionPersonnel.name}</option>
85302
</c:forEach>
86303
</select>
87304
</div>
@@ -98,22 +315,39 @@
98315
</div>
99316
</div>
100317

101-
102-
103318
<input type="hidden" name="homeEnrollmentNumber" value="${unit.homeEnrollmentNumber}"/>
104319
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
105320

106-
<input type="submit" value="Save Deficiency" class="btn btn-primary" style="margin-left: 8.33333333333%" />
321+
<input type="submit" value="Save Deficiency" class="btn btn-primary" id="btnXlg2" style="margin-left: 8.33333333333%" />
107322

108323

109324
<c:url value="/displayUnitDeficiencies/${unit.homeEnrollmentNumber}" var="displayUnitDeficiencies" />
110-
<a href="${displayUnitDeficiencies}" class="pull-right btn btn-default">Back</a>
111-
112-
325+
<a href="${displayUnitDeficiencies}" class="pull-right btn btn-default" id="btnXlg" style="margin-right: 8.33333333333%">Back</a>
113326

114327
</fieldset>
328+
<!--
329+
<div class="container2">
330+
331+
<div class="app2">
332+
333+
<a href="#" id="start-camera" class="visible">Touch here to start the app.</a>
334+
<video id="camera-stream"></video>
335+
<img id="snap">
336+
337+
<p id="error-message"></p>
338+
339+
<div class="controls">
340+
<a href="#" id="delete-photo" title="Delete Photo" class="disabled"><i class="material-icons">delete</i></a>
341+
<a href="#" id="take-photo" title="Take Photo"><i class="material-icons">camera_alt</i></a>
342+
<a href="#" id="download-photo" download="def${deficiency.id}hen${unit.homeEnrollmentNumber}.png" title="Save Photo" class="disabled"><i class="material-icons">file_download</i></a>
343+
</div>
344+
345+
346+
<canvas></canvas>
347+
</div>
348+
</div> This code works but is not for prototype release will be in the final prog. version-->
349+
350+
</div>
115351
</form>
116352

117-
</div>
118-
</body>
119-
</html>
353+
</div>

0 commit comments

Comments
 (0)