Permalink
Browse files

Initial support for cdf:override / waivers in HTML report

  • Loading branch information...
mpreisler committed Nov 6, 2014
1 parent da35c7b commit 30f9a224bc25f2127462d30ec1e4c0d499a23511
Showing with 36 additions and 14 deletions.
  1. +29 −7 xsl/xccdf-report-impl.xsl
  2. +1 −1 xsl/xccdf-resources.xsl
  3. +6 −6 xsl/xccdf-resources/openscap.css
View
@@ -285,13 +285,18 @@ Authors:
<xsl:attribute name="class">rule-overview-leaf rule-overview-leaf-<xsl:value-of select="$result"/> rule-overview-needs-attention</xsl:attribute>
</xsl:if>
- <td style="padding-left: {$indent * 19}px"><a href="#rule-detail-{generate-id($ruleresult)}" onclick="return openRuleDetailsDialog('{generate-id($ruleresult)}')">
- <xsl:call-template name="item-title">
- <xsl:with-param name="item" select="$item"/>
- <xsl:with-param name="testresult" select="$testresult"/>
- <xsl:with-param name="profile" select="$profile"/>
- </xsl:call-template>
- </a></td>
+ <td style="padding-left: {$indent * 19}px">
+ <a href="#rule-detail-{generate-id($ruleresult)}" onclick="return openRuleDetailsDialog('{generate-id($ruleresult)}')">
+ <xsl:call-template name="item-title">
+ <xsl:with-param name="item" select="$item"/>
+ <xsl:with-param name="testresult" select="$testresult"/>
+ <xsl:with-param name="profile" select="$profile"/>
+ </xsl:call-template>
+ </a>
+ <xsl:if test="$ruleresult/cdf:override">
+ &#160;<span class="label label-warning">waived</span>
+ </xsl:if>
+ </td>
<td style="text-align: center"><xsl:value-of select="$ruleresult/@severity"/></td>
<td class="rule-result rule-result-{$result}">
<xsl:variable name="result_tooltip">
@@ -623,6 +628,23 @@ Authors:
<xsl:with-param name="item" select="$item"/>
</xsl:call-template>
</td></tr>
+ <xsl:if test="$ruleresult/cdf:override">
+ <tr><td colspan="2">
+ <xsl:for-each select="$ruleresult/cdf:override">
+ <xsl:variable name="old-result" select="cdf:old-result/text()"/>
+
+ <div class="alert alert-warning waiver">
+ This rule has been waived by <strong><xsl:value-of select="@authority"/></strong> at <strong><xsl:value-of select="@date"/></strong>.
+ <blockquote>
+ <xsl:value-of select="cdf:remark/text()"/>
+ </blockquote>
+ <small>
+ The previous result was <span class="rule-result rule-result-{$old-result}">&#160;<xsl:value-of select="$old-result"/>&#160;</span>.
+ </small>
+ </div>
+ </xsl:for-each>
+ </td></tr>
+ </xsl:if>
<tr><td colspan="2"><div class="description">
<p>
<xsl:apply-templates mode="sub-testresult" select="$item/cdf:description">
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,11 +1,11 @@
tr.rule-overview-needs-attention td a { color: #d9534f }
-td.rule-result div { text-align: center; font-weight: bold; color: #fff; background: #808080 }
-td.rule-result-fail div { background: #d9534f }
-td.rule-result-error div { background: #d9534f }
-td.rule-result-unknown div { background: #f0ad4e }
-td.rule-result-pass div { background: #5cb85c }
-td.rule-result-fixed div { background: #5cb85c }
+td.rule-result div, span.rule-result { text-align: center; font-weight: bold; color: #fff; background: #808080 }
+td.rule-result-fail div, span.rule-result-fail { background: #d9534f }
+td.rule-result-error div, span.rule-result-error { background: #d9534f }
+td.rule-result-unknown div, span.rule-result-unknown { background: #f0ad4e }
+td.rule-result-pass div, span.rule-result-pass { background: #5cb85c }
+td.rule-result-fixed div, span.rule-result-fixed { background: #5cb85c }
.js-only { display: none }

0 comments on commit 30f9a22

Please sign in to comment.