Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions WebContent/WEB-INF/jsps/pdiReport.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<style>
#con {
background-color: #EDEEFF;
Expand All @@ -25,7 +26,28 @@ label {
}

</style>

<body>
<c:choose>
<c:when test="${displayPage}">
<script>

window.onload = function (){
document.getElementById("mainReportDiv").style.display = 'visible';
}
</script>

</c:when>
<c:otherwise>
<script>
window.onload = function (){
document.getElementById("mainReportDiv").style.display = 'none';

}
</script>

</c:otherwise>
</c:choose>

<title>Tarion PDI Form: ${unit.homeEnrollmentNumber}</title>

<div id="divCon">
Expand All @@ -43,7 +65,7 @@ label {

<div class="form-group" style="margin: 2%">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
<input type="submit" value="Go!" id="btnXlg" class="pull-right btn btn-primary" />
<input type="submit" value="Load Report" id="btnXlg" class="pull-right btn btn-primary" onclick="showPdiReport" />

</div>

Expand All @@ -64,11 +86,12 @@ label {


</div>
<div id="mainReportDiv">

<c:url value="/pdiReport" var="url" />
<form name="form" class="form-horizontal" method="post" action="${url}">
<fieldset>
<legend>TARION Pre-Delivery Inspection Form</legend>
<legend>List of Deficiencies</legend>
<div>
<table class="table table-striped table-hover">
<thead>
Expand All @@ -94,6 +117,8 @@ label {

</div>

<legend>Review of PDI</legend>

<div class="jumbotron" id="legendCon" style="background-color:#EDEEFF">

<div class="form-group" style="margin: 2%">
Expand Down Expand Up @@ -247,7 +272,7 @@ label {
<input type="hidden" name="homeEnrollmentNumber" value="" />
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
</div>

</div>
<div class="jumbotron" id="legendCon" style="background-color:#EDEEFF; ">
<div style="padding:1%;" class="col-lg-12">

Expand All @@ -264,4 +289,5 @@ label {
</div>

</div>
</div>
</div>
</body>
8 changes: 7 additions & 1 deletion WebContent/scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ function hide(){
used = document.getElementById("repName").value;
//disable save on load
$( "#saveBtn" ).prop( "disabled", true );

document.getElementById("mainReportDiv").style.visibility = 'hidden';
//test not hidden

$( "#nextBtn" ).prop( "disabled", false );
$( "#nextBtn" ).prop( "disabled", true );



if (used === ""){
//alert(used);
document.getElementById("nextBtn").style.visibility = 'visible';
Expand All @@ -25,6 +27,10 @@ function showSave(){
document.getElementById("saveBtn").style.visibility = 'visible';
}

function showPdiReport(){
document.getElementById("saveBtn").style.visibility = "visible";
}

function enableNextBtn(){
$('a').disable(false);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ca/sheridancollege/services/ControllerServices.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public Model displayUnitData(Model model, long homeEnrollmentNumber, long num) {

//String img = form.get(0).getRepSig().toString();
model.addAttribute("errorHomeEnrollmentNumber", false);

model.addAttribute("displayPage", true);
return model;
} else {

Expand Down Expand Up @@ -490,7 +490,7 @@ public Model displayPdiReport(Model model, long homeEnrollmentNumber) {
}
model.addAttribute("unit", unit.get(0));
model.addAttribute("builder", builder.get(0));

model.addAttribute("displayPage", true);
return model;
} else {

Expand Down