diff --git a/src/report/resources/report.html b/src/report/resources/report.html index 7821c05e..a16f009c 100644 --- a/src/report/resources/report.html +++ b/src/report/resources/report.html @@ -16,6 +16,15 @@ function updateTableContents(data) { $('#report-table').dataTable().fnDestroy(); + + if (data.length == 0) { + var div = $("#violations"); + div.append("
No violations found in this publication.
"); + $("#report-table").remove(); + $("#filters").remove(); + return; + } + var tablebody = $("#report-table > tbody"); tablebody.empty(); @@ -71,6 +80,7 @@ }); $('#report-table').DataTable(); + } function filterSelected() { @@ -129,6 +139,14 @@ $('#image-table').dataTable().fnDestroy(); var tablebody = $("#image-table > tbody"); tablebody.empty(); + + if (images == null || images == undefined) { + $("#image-table").remove(); + var div = $("#images"); + div.append("No images found in this publication.
"); + return; + } + images.forEach(function(image) { var tr = $("No images found in this publication.
"); + $("#image-table").remove(); + } $('#report-table').DataTable(); } @@ -178,8 +200,8 @@ } function populateA11yMetadataSummary(a11ymetadata, pubmetadata) { - var tbody = $("#a11y-meta-present tbody"); - var list = $("#a11y-meta-missing"); + var tbody = $("#a11y-metadata-present tbody"); + var list = $("#a11y-metadata-missing"); a11ymetadata["present"].forEach(function(item) { var metastr = pubmetadata[item]; @@ -189,6 +211,11 @@ var tr = $("" + item + "
No accessibility metadata present in the package document.
"); + $("#a11y-metadata-present").remove(); + } a11ymetadata["missing"].forEach(function(item) { var li = $("" + item + "
No missing or empty accessibility metadata in the package document.
"); + $("#a11y-metadata-missing").remove(); } } @@ -356,7 +384,7 @@This is a summary of the accessibility metadata in the package document.
-Property | -Value | - - - -
---|
Property | +Value | + + + +
---|