]> git.draconx.ca Git - homepage.git/blobdiff - layouts/clickytable.xsl
Consolidate some clicky table label styles.
[homepage.git] / layouts / clickytable.xsl
index f442fa46c387379c9a4db225e6c02743307add08..cf0fcb2a580738d0e493d8ca719144fcdda3628d 100644 (file)
   </div>
 </xsl:template>
 
+<xsl:template match='xhtml:table[@clicky]/xhtml:thead[*/xhtml:th/@clicky]'>
+  <xsl:copy>
+    <xsl:attribute name='class'>
+      <xsl:if test='@class'>
+        <xsl:value-of select='concat(@class, " ")' />
+      </xsl:if>
+      <xsl:text>clicky</xsl:text>
+    </xsl:attribute>
+    <xsl:apply-templates select='node()|@*[local-name() != "class"]' />
+  </xsl:copy>
+</xsl:template>
+
 <xsl:template match='xhtml:table[@clicky]/xhtml:thead/*/xhtml:th[@clicky]'>
   <xsl:copy>
     <xsl:attribute name='class'>
@@ -86,8 +98,8 @@
     <label for='rev-{generate-id(@clicky)}' style='display: none'>
       <xsl:text>&#x2060;</xsl:text>
       <span><xsl:apply-templates select='node()' /></span>
-      <img alt='FWD' width='16' height='16' src='/images/down.svg' />
-      <img alt='REV' width='16' height='16' src='/images/up.svg' style='display: none' />
+      <img alt='FWD' width='16' height='16' src='/icons/down.svg' />
+      <img alt='REV' width='16' height='16' src='/icons/up.svg' style='display: none' />
     </label>
     <script type='x'>--></script>
   </xsl:copy>
       </xsl:if>
       <xsl:text>display: none</xsl:text>
     </xsl:attribute>
-    <xsl:apply-templates select='node()|@*[local-name() != "style"]' />
+    <xsl:apply-templates select='@*[local-name() != "style"]' />
+    <tr>
+      <td>
+        <xsl:for-each select='../*/xhtml:tr'>
+          <xsl:sort select='count(*)' data-type='number' order='descending' />
+          <xsl:if test='position()=1'>
+            <xsl:attribute name='colspan'>
+              <xsl:value-of select='count(*)' />
+            </xsl:attribute>
+          </xsl:if>
+        </xsl:for-each>
+        <hr/>
+      </td>
+    </tr>
+    <tr>
+      <xsl:for-each select='../xhtml:thead[1]/xhtml:tr[1]/*'>
+        <xsl:copy>
+          <xsl:value-of select='.' />
+        </xsl:copy>
+      </xsl:for-each>
+    </tr>
+    <xsl:apply-templates select='node()' />
   </xsl:copy>
 </xsl:template>