Merge pull request #104 from danieldupriest/ViewReportUpdate

Update on view report
This commit is contained in:
ppdom 2019-02-26 14:31:55 -08:00 committed by GitHub
commit e8bf239ae0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -469,14 +469,6 @@ function displayReport(parsedData){
const cardBody = document.createElement("div"); const cardBody = document.createElement("div");
cardBody.classList.add("card-body"); cardBody.classList.add("card-body");
/*
const displayTable = document.createElement("table");
displayTable.classList.add("table table-striped table-responsive-sm");
displayTable.style.visibility = "visible";
cardBody.appendChild(displayTable);
*/
const sections = parsedData.sections; const sections = parsedData.sections;
for (let key in sections) { for (let key in sections) {
let section = sections[key]; let section = sections[key];
@ -490,10 +482,35 @@ function displayReport(parsedData){
for (let key in fields) { for (let key in fields) {
let field = fields[key]; let field = fields[key];
const p1 = document.createElement("p"); const p1 = document.createElement("p");
const p1Value = document.createTextNode(field.label + ": " + field.value); let p1Value = "";
if(field.field_type == "boolean")
{
if(field.value == "true")
{
p1Value = document.createTextNode(field.label + ": " + "Yes");
p1.appendChild(p1Value); p1.appendChild(p1Value);
cardBody.appendChild(p1); cardBody.appendChild(p1);
} }
else
{
p1Value = document.createTextNode(field.label + ": " + "No");
p1.appendChild(p1Value);
cardBody.appendChild(p1);
}
}
else if(field.value == "")
{
p1Value = document.createTextNode(field.label + ": " + "None");
p1.appendChild(p1Value);
cardBody.appendChild(p1);
}
else
{
p1Value = document.createTextNode(field.label + ": " + field.value);
p1.appendChild(p1Value);
cardBody.appendChild(p1);
}
}
cardHeader.appendChild(cardBody); cardHeader.appendChild(cardBody);
card.appendChild(cardHeader); card.appendChild(cardHeader);
} }