tim 2003/12/31 13:45:20
Modified: src/blocks/woody/samples/resources woody-page-styling.xsl Log: Got tired of hand-coding tables, so expanded group layout count to four: columns - columns with label left and input right column - column with label above and input below (new) rows - rows with label above and input below (new) row - row with label left and input right (new) Revision Changes Path 1.10 +73 -2 cocoon-2.1/src/blocks/woody/samples/resources/woody-page-styling.xsl Index: woody-page-styling.xsl =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-page-styling.xsl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- woody-page-styling.xsl 9 Dec 2003 21:18:04 -0000 1.9 +++ woody-page-styling.xsl 31 Dec 2003 21:45:20 -0000 1.10 @@ -171,7 +171,30 @@ </xsl:template> <!-- - Columnized group items layout + Column group items layout + --> + <xsl:template match="wi:group[wi:styling/@layout='column']" mode="group-layout"> + <table border="0"> + <tbody> + <xsl:apply-templates select="wi:items/*" mode="group-column-content"/> + </tbody> + </table> + </xsl:template> + + <!-- + Default column layout : label above and input below + --> + <xsl:template match="wi:*" mode="group-column-content"> + <tr> + <td valign="top"><label for="[EMAIL PROTECTED]" title="{wi:hint}"><xsl:copy-of select="wi:label/node()"/></label></td> + </tr> + <tr> + <td><xsl:apply-templates select="."/></td> + </tr> + </xsl:template> + + <!-- + Columns group items layout --> <xsl:template match="wi:group[wi:styling/@layout='columns']" mode="group-layout"> <table border="0"> @@ -182,13 +205,61 @@ </xsl:template> <!-- - Default column layout : label left and input right + Default columns layout : label left and input right --> <xsl:template match="wi:*" mode="group-columns-content"> <tr> <td valign="top"><label for="[EMAIL PROTECTED]" title="{wi:hint}"><xsl:copy-of select="wi:label/node()"/></label></td> <td><xsl:apply-templates select="."/></td> </tr> + </xsl:template> + + <!-- + Row group items layout + --> + <xsl:template match="wi:group[wi:styling/@layout='row']" mode="group-layout"> + <table border="0"> + <tbody> + <tr> + <xsl:apply-templates select="wi:items/*" mode="group-row-content"/> + </tr> + </tbody> + </table> + </xsl:template> + + <!-- + Default row layout : label left and input right + --> + <xsl:template match="wi:*" mode="group-row-content"> + <td valign="top"><label for="[EMAIL PROTECTED]" title="{wi:hint}"><xsl:copy-of select="wi:label/node()"/></label></td> + <td><xsl:apply-templates select="."/></td> + </xsl:template> + + <!-- + Rows group items layout + --> + <xsl:template match="wi:group[wi:styling/@layout='rows']" mode="group-layout"> + <table border="0"> + <tbody> + <tr> + <xsl:apply-templates select="wi:items/*" mode="group-rows-labels"/> + </tr> + <tr> + <xsl:apply-templates select="wi:items/*" mode="group-rows-content"/> + </tr> + </tbody> + </table> + </xsl:template> + + <!-- + Default rows layout : label above and input below + --> + <xsl:template match="wi:*" mode="group-rows-labels"> + <td valign="top"><label for="[EMAIL PROTECTED]" title="{wi:hint}"><xsl:copy-of select="wi:label/node()"/></label></td> + </xsl:template> + + <xsl:template match="wi:*" mode="group-rows-content"> + <td><xsl:apply-templates select="."/></td> </xsl:template> <!-- boolean field : checkbox and label on a single line -->