assets/index.xsl in cobench-0.0.27 vs assets/index.xsl in cobench-0.0.28
- old
+ new
@@ -21,13 +21,12 @@
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
- <xsl:output encoding="UTF-8" method="html"/>
+ <xsl:output encoding="UTF-8" method="xml"/>
<xsl:param name="version"/>
- <xsl:key name="titles" match="/cobench/titles/title" use="."/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>cobench</title>
@@ -45,13 +44,14 @@
</script>
<style>
td, th { font-family: monospace; font-size: 18px; }
.num { text-align: right; }
.left { border-bottom: 0; }
+ section { width: 100%; }
header { text-align: center; }
footer { text-align: center; font-size: 0.8em; line-height: 1.2em; color: gray; }
- article { width: 60em; border: 0; }
+ article { border: 0; }
td.avatar { vertical-align: middle; text-align: center; }
td.avatar img { width: 1.5em; height: 1.5em; vertical-align: middle; }
.subtitle { font-size: 0.8em; line-height: 1em; color: gray; }
.sorter { cursor: pointer; }
</style>
@@ -65,10 +65,18 @@
</a>
</p>
</header>
<article>
<table id="metrics">
+ <colgroup>
+ <col/>
+ <col/>
+ <xsl:for-each select="cobench/titles/title">
+ <xsl:sort select="."/>
+ <col/>
+ </xsl:for-each>
+ </colgroup>
<thead>
<xsl:apply-templates select="cobench/titles"/>
</thead>
<xsl:apply-templates select="cobench/coders"/>
<tfoot>
@@ -172,11 +180,11 @@
</html>
</xsl:template>
<xsl:template match="cobench/titles">
<tr>
<th colspan="2"/>
- <xsl:for-each select="title[generate-id() = generate-id(key('titles', .)[1])]">
+ <xsl:for-each select="title">
<xsl:sort select="."/>
<th class="sorter num">
<xsl:value-of select="."/>
</th>
</xsl:for-each>
@@ -184,11 +192,11 @@
</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:for-each select="/cobench/titles/title">
<xsl:sort select="."/>
<xsl:variable name="t" select="."/>
<td class="num">
<xsl:value-of select="$totals/w[@id=$t]"/>
</td>
@@ -197,10 +205,10 @@
</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:for-each select="/cobench/titles/title">
<xsl:sort select="."/>
<xsl:variable name="t" select="."/>
<td class="num">
<xsl:value-of select="$averages/w[@id=$t]"/>
</td>