Summary Page: Render template expansion points

This renders template expansions as part of the calculation breakdown, which
goes a long way to understanding what the system is doing.

This further updates the hover over the breakdown to color-code based on
depth, making it easier to observe the nesting of
expressions.  Sub-expressions that are toplevel results of template
expansions (nodes marked with templates) have a thicker border.

* src/current/summary.css: Add template id styling, breakdown colors, and
    misc. styling.
* src/current/summary.xsl (ultra-breakdown-set): Enclose label in
    span.  Output template id, if applicable.  Mark fieldset if templated.
master
Mike Gerwitz 2017-12-08 13:55:45 -05:00
parent 2f8ce0f234
commit 75aa0fab7e
2 changed files with 79 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/**
* Rater XML summary stylesheet
*
* Copyright (C) 2016 LoVullo Associates, Inc.
* Copyright (C) 2016, 2017 LoVullo Associates, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -741,6 +741,17 @@ body:not(.prior) .entry-value-prior
.ultra-breakdown legend > .uid
{
font-size: 0.8em;
color: gray;
}
.ultra-breakdown legend > .tplid
{
font-family: monospace;
background-color: lightgoldenrodyellow;
border: 1px solid palegoldenrod;
border-radius: 0.25em;
padding: 0.15em;
margin: 0.15em;
}
.ultra-breakdown fieldset
@ -751,11 +762,54 @@ body:not(.prior) .entry-value-prior
border-radius: 0.5em;
}
.ultra-breakdown fieldset.templated
{
border-width: 2px;
}
.ultra-breakdown fieldset:hover
{
border-color: black;
}
.ultra-breakdown > fieldset > fieldset:hover
{
border-color: #009688;
}
.ultra-breakdown > fieldset > fieldset > fieldset:hover
{
border-color: #8bc34a;
}
.ultra-breakdown > fieldset > fieldset > fieldset > fieldset:hover
{
border-color: #ffeb3b;
}
.ultra-breakdown > fieldset > fieldset > fieldset > fieldset > fieldset:hover
{
border-color: #ffc107;
}
.ultra-breakdown > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset:hover
{
border-color: #ff5722;
}
.ultra-breakdown > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset:hover
{
border-color: #9C27B0;
}
.ultra-breakdown > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset:hover
{
border-color: #2196f3;
}
.ultra-breakdown > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset > fieldset:hover
{
border-color: #009688;
}
.ultra-breakdown fieldset:hover
{
border-style: solid;
}
.test-summary
{

View File

@ -1732,7 +1732,14 @@
<xsl:param name="label" select="@label" />
<xsl:param name="c" select="." />
<xsl:variable name="from-tpl"
select="preproc:from-template" />
<fieldset>
<xsl:if test="$from-tpl">
<xsl:attribute name="class" select="'templated'" />
</xsl:if>
<legend class="debugid">
<xsl:attribute name="id">
<xsl:text>ubd-</xsl:text>
@ -1740,8 +1747,10 @@
</xsl:attribute>
<xsl:if test="$label">
<xsl:value-of select="$label" />
<xsl:text> </xsl:text>
<span class="label">
<xsl:value-of select="$label" />
<xsl:text> </xsl:text>
</span>
</xsl:if>
<span class="uid">
@ -1749,6 +1758,19 @@
<xsl:value-of select="$c/@_id" />
<xsl:text>)</xsl:text>
</span>
<xsl:if test="$from-tpl">
<xsl:for-each select="$from-tpl">
<xsl:if test="position() gt 1">
<xsl:text>, </xsl:text>
</xsl:if>
<span class="tplid">
<xsl:text>@</xsl:text>
<xsl:value-of select="@name" />
</span>
</xsl:for-each>
</xsl:if>
</legend>
<xsl:apply-templates select="$c" mode="ultra-breakdown-equ" />