assets/index.xsl in cobench-0.0.23 vs assets/index.xsl in cobench-0.0.24
- old
+ new
@@ -65,12 +65,18 @@
</a>
</p>
</header>
<article>
<table id="metrics">
- <xsl:apply-templates select="cobench/titles"/>
+ <thead>
+ <xsl:apply-templates select="cobench/titles"/>
+ </thead>
<xsl:apply-templates select="cobench/coders"/>
+ <tfoot>
+ <xsl:apply-templates select="cobench/totals"/>
+ <xsl:apply-templates select="cobench/averages"/>
+ </tfoot>
</table>
</article>
<footer>
<p>
<xsl:text>The page was generated by </xsl:text>
@@ -132,10 +138,23 @@
</xsl:if>
</xsl:for-each>
<xsl:text>.</xsl:text>
</p>
<p>
+ <xsl:for-each select="cobench/titles/title[@subtitle]">
+ <xsl:if test="position() > 1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:text>"</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>"</xsl:text>
+ <xsl:text> stands for </xsl:text>
+ <xsl:value-of select="@subtitle"/>
+ </xsl:for-each>
+ <xsl:text>.</xsl:text>
+ </p>
+ <p>
<xsl:text>The numbers you see reflect the activity of the last </xsl:text>
<b>
<xsl:value-of select="cobench/@days"/>
<xsl:text> days</xsl:text>
</b>
@@ -151,21 +170,45 @@
</section>
</body>
</html>
</xsl:template>
<xsl:template match="cobench/titles">
- <thead>
- <tr>
- <th/>
- <th/>
- <xsl:for-each select="title[generate-id() = generate-id(key('titles', .)[1])]">
- <xsl:sort select="."/>
- <th class="sorter num">
- <xsl:value-of select="."/>
- </th>
- </xsl:for-each>
- </tr>
- </thead>
+ <tr>
+ <th/>
+ <th/>
+ <xsl:for-each select="title[generate-id() = generate-id(key('titles', .)[1])]">
+ <xsl:sort select="."/>
+ <th class="sorter num">
+ <xsl:value-of select="."/>
+ </th>
+ </xsl:for-each>
+ </tr>
+ </xsl:template>
+ <xsl:template match="cobench/totals">
+ <xsl:variable name="totals" select="."/>
+ <tr>
+ <td colspan="2" style="text-align:right">Total:</td>
+ <xsl:for-each select="/cobench/titles/title[generate-id() = generate-id(key('titles', .)[1])]">
+ <xsl:sort select="."/>
+ <xsl:variable name="t" select="."/>
+ <td class="num">
+ <xsl:value-of select="$totals/w[@id=$t]"/>
+ </td>
+ </xsl:for-each>
+ </tr>
+ </xsl:template>
+ <xsl:template match="cobench/averages">
+ <xsl:variable name="averages" select="."/>
+ <tr>
+ <td colspan="2" style="text-align:right">Average:</td>
+ <xsl:for-each select="/cobench/titles/title[generate-id() = generate-id(key('titles', .)[1])]">
+ <xsl:sort select="."/>
+ <xsl:variable name="t" select="."/>
+ <td class="num">
+ <xsl:value-of select="$averages/w[@id=$t]"/>
+ </td>
+ </xsl:for-each>
+ </tr>
</xsl:template>
<xsl:template match="cobench/coders">
<tbody>
<xsl:apply-templates select="coder"/>
</tbody>