55<%@ taglib prefix =" form" uri =" http://www.springframework.org/tags/form" %>
66<%@ taglib prefix =" security" uri =" http://www.springframework.org/security/tags" %>
77<%@ taglib prefix =" fn" uri =" http://java.sun.com/jsp/jstl/functions" %>
8-
8+ < script src = " ../scripts/photo.js " ></ script >
99<style >
1010@import url (' https://fonts.googleapis.com/css?family=Open+Sans:400,700' );
1111@import url (' https://fonts.googleapis.com/icon?family=Material+Icons' );
201201<title >Add Deficiency: ${ unit. homeEnrollmentNumber } </title >
202202
203203<script >
204+ var save = false ;
204205 function Validate () {
205206 if (ValidateCategories () && ValidateLocation ()) {
206207 return true ;
@@ -240,14 +241,19 @@ h3{
240241 return true ;
241242 }
242243 }
244+
245+ function reallyClose () {
246+ confirm (" You have not saved a photo. Are you sure you want to leave?" );
247+ }
243248 </script >
244249
245250 <div style =" margin : 2% " >
251+ <legend ><h2 >Enter or Edit Deficiency Information</h2 ></legend >
246252 <c:url value =" /saveDeficiency" var =" url" />
247253 <form name =" form" class =" form-horizontal" method =" post" onsubmit =" return Validate()" action =" ${ url } " >
248254 <div class =" jumbotron" id =" con" >
249255 <fieldset >
250- < legend >Enter or Edit Deficiency Information</ legend >
256+
251257 <br >
252258 <div class =" alert alert-danger collapse" id =" alert" >
253259 <div id =" selectCategory" class =" collapse" >Please select a category.</div >
293299 </div >
294300 </div >
295301
302+ <div class =" form-group" >
303+ <label for =" defPhoto" class =" col-lg-1 control-label" >Deficiency Photo</label >
304+ <div class =" col-lg-8" >
305+ <input path =" defPhoto" name =" defPhoto" class =" form-control" id =" defPhoto" readonly />
306+ </div >
307+ <div class =" col-lg-2" >
308+ <button type =" button" class =" btn btn-primary" data-toggle =" modal" data-target =" #myModal" >
309+ Add Photo
310+ </button >
311+ </div >
312+ </div >
313+
296314 <div class =" form-group" >
297315 <label for =" constructionPersonnel" class =" col-lg-1 control-label" >Assign To</label >
298316 <div class =" col-lg-10" >
@@ -315,39 +333,65 @@ h3{
315333 </div >
316334 </div >
317335
318- <input type =" hidden" name =" homeEnrollmentNumber" value =" ${ unit. homeEnrollmentNumber } " />
336+ <input type =" hidden" id = " homeEnrollmentNumber " name =" homeEnrollmentNumber" value =" ${ unit. homeEnrollmentNumber } " />
319337 <input type =" hidden" name =" ${ _csrf. parameterName } " value =" ${ _csrf. token } " />
320338
321- <input type =" submit" value =" Save Deficiency" class =" btn btn-primary" id =" btnXlg2" style =" margin-left : 8.33333333333% " />
339+
340+ </fieldset >
341+
342+
343+
344+ </div >
345+ <input type =" submit" value =" Save Deficiency" class =" btn btn-primary" id =" btnXlg2" style =" margin-left : 8.33333333333% " />
322346
323347
324348 <c:url value =" /displayUnitDeficiencies/${ unit. homeEnrollmentNumber } " var =" displayUnitDeficiencies" />
325349 <a href =" ${ displayUnitDeficiencies } " class =" pull-right btn btn-default" id =" btnXlg" style =" margin-right : 8.33333333333% " >Back</a >
326-
327- </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 >
350+
351351 </form >
352+ <br />
353+ <br />
354+
355+ <legend > </legend >
356+ </div >
357+
358+ <div class =" modal fade" id =" myModal" >
359+ <div class =" modal-dialog" role =" document" >
360+ <div class =" modal-content" >
361+ <div class =" modal-header" >
362+ <button type =" button" class =" close" data-dismiss =" modal" aria-label =" Close" >
363+ <span aria-hidden =" true" >× ; </span >
364+ </button >
365+ <h4 class =" modal-title" >Deficiency Photo</h4 >
366+ </div >
367+ <div class =" modal-body" >
368+ <div class =" container2" >
369+
370+ <div class =" app2" >
371+
372+ <a href =" #" id =" start-camera" class =" visible" >Touch here to start the app.</a >
373+ <video id =" camera-stream" ></video >
374+ <img id =" snap" >
375+
376+ <p id =" error-message" ></p >
377+
378+ <div class =" controls" >
379+ <a href =" #" id =" delete-photo" title =" Redo Photo" class =" disabled" >
380+ <i class =" material-icons" >replay</i ></a >
381+ <a href =" #" id =" take-photo" title =" Take Photo" ><i class =" material-icons" >camera_alt</i ></a >
382+ <a href =" #" id =" download-photo" download =" def${ deficiency. id } hen${ unit. homeEnrollmentNumber } .png"
383+ title =" Save Photo" class =" disabled" onclick =" saveDone()" >
384+ <i class =" material-icons" >done</i ></a >
385+ </div >
352386
353- </div >
387+ <canvas ></canvas >
388+ </div >
389+ </div >
390+
391+ </div >
392+ <div class =" modal-footer" >
393+ <button type =" button" class =" btn btn-secondary" data-dismiss =" modal" >Close</button >
394+
395+ </div >
396+ </div ><!-- /.modal-content -->
397+ </div ><!-- /.modal-dialog -->
0 commit comments