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 = $(""); @@ -164,7 +182,11 @@ tablebody.append(tr); }); - + if (images.length == 0) { + var div = $("#images"); + div.append("

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 + "" + metastr + ""); tbody.append(tr); }); + if (a11ymetadata["present"].length == 0) { + var div = $("#a11y-metadata-present-container"); + div.append("

No accessibility metadata present in the package document.

"); + $("#a11y-metadata-present").remove(); + } a11ymetadata["missing"].forEach(function(item) { var li = $("
  • " + item + "
  • ") @@ -201,8 +228,9 @@ }); if (a11ymetadata["missing"].length == 0 && a11ymetadata["empty"] == 0) { - var div = $("#a11y-metadata"); + var div = $("#a11y-metadata-missing-container"); div.append("

    No missing or empty accessibility metadata in the package document.

    "); + $("#a11y-metadata-missing").remove(); } } @@ -356,7 +384,7 @@

    EPUB Accessibility Report

    -
    +

    Violations

    @@ -386,19 +414,23 @@

    Outlines

    Accessibility Metadata Summary

    This is a summary of the accessibility metadata in the package document.

    -

    Present

    - - - - - - - -
    PropertyValue
    +
    +

    Present

    + + + + + + + +
    PropertyValue
    +
    -

    Missing or empty

    -
      -
    +
    +

    Missing or empty

    +
      +
    +