Merge pull request #104 from danieldupriest/ViewReportUpdate
Update on view report
This commit is contained in:
		
						commit
						e8bf239ae0
					
				
					 1 changed files with 28 additions and 11 deletions
				
			
		|  | @ -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,9 +482,34 @@ 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 = ""; | ||||||
|                 p1.appendChild(p1Value); |                 if(field.field_type == "boolean") | ||||||
|                 cardBody.appendChild(p1); |                 { | ||||||
|  |                     if(field.value == "true") | ||||||
|  |                     { | ||||||
|  |                         p1Value = document.createTextNode(field.label + ": " + "Yes"); | ||||||
|  |                         p1.appendChild(p1Value); | ||||||
|  |                         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); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 ppdom
						ppdom