cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r404867 - in /cocoon: branches/BRANCH_2_1_X/ trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/
Date Sun, 07 May 2006 23:11:10 GMT
Author: simoneg
Date: Sun May  7 16:11:08 2006
New Revision: 404867

URL: http://svn.apache.org/viewcvs?rev=404867&view=rev
Log:
CSS classes added to key places of cocoon forms default XSL, see COCOON-1782. Should preserve
any modification applied after my first modifications.

Modified:
    cocoon/branches/BRANCH_2_1_X/status.xml
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-page-styling.xsl

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=404867&r1=404866&r2=404867&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Sun May  7 16:11:08 2006
@@ -182,6 +182,9 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.10" date="TBD">
+    <action dev="SG" type="add" fixes-bug="COCOON-1782">
+      Added CSS classes in cocoon forms default XSLs.
+    </action>
     <action dev="AG" type="update">
       Updated ehcache to 1.2.
     </action>

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl?rev=404867&r1=404866&r2=404867&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
Sun May  7 16:11:08 2006
@@ -68,7 +68,7 @@
       +-->
   <xsl:template match="fi:help">
     <xsl:variable name="id" select="concat(../@id, ':help')"/>
-    <div class="forms-help" id="{$id}" style="visibility:hidden; position:absolute;">
+    <div class="forms-help forms help" id="{$id}" style="visibility:hidden; position:absolute;">
     	<span style="float:right"><a href="#" onClick="document.getElementById('{$id}').style.visibility
= 'hidden';return false;"><img align="top" alt="close" src="{$resources-uri}/forms/img/close.gif"
height="6" width="6"/></a></span>
       <xsl:apply-templates select="node()"/>
     </div>
@@ -87,7 +87,7 @@
     <xsl:variable name="browser-variable"><xsl:value-of select="translate($id, '.',
'_')"/>_jsWidget</xsl:variable>
 
     <script type="text/javascript">var <xsl:value-of select="$browser-variable"/>;</script>
-    <div id="{@id}" class="forms-doubleList" title="{fi:hint}">
+    <div id="{@id}" class="forms-doubleList forms doubleList" title="{fi:hint}">
       <table>
         <xsl:if test="fi:styling/fi:available-label|fi:styling/fi:selected-label">
           <tr>
@@ -279,4 +279,5 @@
       <xsl:apply-templates select="." mode="common"/>
     </span>
   </xsl:template>
+
 </xsl:stylesheet>

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl?rev=404867&r1=404866&r2=404867&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
Sun May  7 16:11:08 2006
@@ -54,7 +54,7 @@
   <xsl:template match="fi:field">
     <span id="{@id}">
       <xsl:if test="fi:captcha-image">
-        <img src="captcha-{fi:captcha-image/@id}.jpg" style="vertical-align:middle"/>
+        <img src="captcha-{fi:captcha-image/@id}.jpg" style="vertical-align:middle" class="forms
captcha"/>
         <xsl:text> </xsl:text>
       </xsl:if>
       <!--  @id:input is what labels point to -->
@@ -69,7 +69,7 @@
       | Field in "output" state: display its value
       +-->
   <xsl:template match="fi:field[@state='output']" priority="3">
-    <span id="{@id}"><xsl:value-of select="fi:value/node()"/></span>
+    <span id="{@id}"><xsl:apply-templates select="." mode="css"/><xsl:value-of
select="fi:value/node()"/></span>
   </xsl:template>
 
   <!--+
@@ -80,7 +80,7 @@
     <xsl:apply-templates select="fi:validation-message"/>
     <!-- required mark -->
     <xsl:if test="@required='true'">
-      <span class="forms-field-required"> * </span>
+      <span class="forms-field-required forms {local-name()} required-mark"> * </span>
     </xsl:if>
   </xsl:template>
 
@@ -90,11 +90,20 @@
       | example @checked or @selected
       +-->
   <xsl:template match="fi:*" mode="styling">
+    <xsl:apply-templates select="." mode="css"/>
     <xsl:apply-templates select="fi:styling/@*" mode="styling"/>
 
     <!--  Auto submit on fields which are listening -->
-      <xsl:if test="@listening = 'true' and not(fi:styling/@submit-on-change = 'false')
and not(fi:styling/@onchange) and not(fi:styling/@list-type = 'double-listbox')">
-      <xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
+    <xsl:if test="@listening = 'true' and not(fi:styling/@submit-on-change = 'false')
and not(fi:styling/@onchange) and not(fi:styling/@list-type = 'double-listbox')">
+      <xsl:choose>
+          <!-- IE does not react to a click with an onchange, as firefox does, so for
radio and checkbox put an onclick handler instead -->
+	      <xsl:when test="local-name() = 'booleanfield' or fi:styling/@list-type = 'radio'
or fi:styling/@list-type = 'checkbox'">
+	        <xsl:attribute name="onclick">forms_submitForm(this)</xsl:attribute>
 
+	      </xsl:when>
+          <xsl:otherwise>
+	      	<xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
+          </xsl:otherwise>
+      </xsl:choose>
     </xsl:if>
 
     <xsl:if test="@state = 'disabled'">
@@ -128,7 +137,7 @@
   </xsl:template>
 
   <xsl:template match="fi:styling/@list-type | fi:styling/@list-orientation |
-                       fi:styling/@listbox-size | fi:styling/@format | fi:styling/@layout"
+                       fi:styling/@listbox-size | fi:styling/@format | fi:styling/@layout
| fi:styling/@class"
                 mode="styling">
     <!--+
         | Ignore marker attributes so they don't go into the resuling HTML.
@@ -171,7 +180,7 @@
       |
       +-->
   <xsl:template match="fi:validation-message">
-    <a href="#" class="forms-validation-message" id="forms-validation-message-{../@id}">
+    <a href="#" class="forms-validation-message forms validation-message" id="forms-validation-message-{../@id}">
       <xsl:attribute name="onclick">
         <xsl:text>alert('</xsl:text>
         <xsl:call-template name="apos-replace">
@@ -203,7 +212,7 @@
     <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
     <xsl:choose>
       <xsl:when test="$vertical">
-        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
+        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}"
class="forms vertical-list">
           <xsl:for-each select="fi:selection-list/fi:item">
             <xsl:variable name="item-id" select="concat($id, ':', position())"/>
             <tr>
@@ -230,7 +239,7 @@
         </table>
       </xsl:when>
       <xsl:otherwise>
-        <span id="{$id}" title="{fi:hint}">
+        <span id="{$id}" title="{fi:hint}" class="forms horizontal-list">
           <xsl:for-each select="fi:selection-list/fi:item">
             <xsl:variable name="item-id" select="concat($id, ':', position())"/>
             <input type="radio" id="{$item-id}" name="{$id}" value="{@value}">
@@ -295,14 +304,14 @@
       +-->
   <xsl:template match="fi:field[@state='output' and fi:selection-list]" priority="3">
     <xsl:variable name="value" select="fi:value/node()"/>
-    <span id="{@id}"><xsl:copy-of select="fi:selection-list/fi:item[@value=$value]/fi:label/node()"/></span>
+    <span id="{@id}"><xsl:apply-templates select="." mode="css"/><xsl:copy-of
select="fi:selection-list/fi:item[@value=$value]/fi:label/node()"/></span>
   </xsl:template>
 
   <!--+
       | fi:output is rendered as text
       +-->
   <xsl:template match="fi:output">
-    <span id="{@id}"><xsl:copy-of select="fi:value/node()"/></span>
+    <span id="{@id}"><xsl:apply-templates select="." mode="css"/><xsl:copy-of
select="fi:value/node()"/></span>
   </xsl:template>
 
   <!--+
@@ -329,6 +338,7 @@
     </xsl:variable>
 
     <label for="{$resolvedId}" title="{fi:hint}">
+      <xsl:apply-templates select="." mode="css"/>
       <xsl:copy-of select="fi:label/node()"/>
     </label>
   </xsl:template>
@@ -337,7 +347,7 @@
       | Labels for pure outputs must not contain <label/> as there is no element to
point to.
       +-->
   <xsl:template match="fi:output | fi:messages | fi:field[fi:selection-list][fi:styling/@list-type='radio']"
mode="label">
-    <xsl:copy-of select="fi:label/node()"/>
+    <span><xsl:apply-templates select="." mode="css"/><xsl:copy-of select="fi:label/node()"/></span>
   </xsl:template>
 
   <!--+
@@ -372,6 +382,7 @@
       +-->
   <xsl:template match="fi:booleanfield[@state='output']" priority="3">
     <input id="{@id}" type="checkbox" title="{fi:hint}" disabled="disabled" value="{@true-value}">
+        <xsl:apply-templates select="." mode="css"/>
     	  <xsl:if test="fi:value != 'false'">
     	    <xsl:attribute name="checked">checked</xsl:attribute>
     	  </xsl:if>
@@ -424,6 +435,7 @@
         <xsl:variable name="value" select="@value"/>
         <xsl:variable name="item-id" select="concat($id, ':', position())"/>
         <input id="{$item-id}" type="checkbox" value="{@value}" name="{$id}">
+          <xsl:apply-templates select="." mode="css"/>
           <xsl:if test="$state = 'disabled'">
             <xsl:attribute name="disabled">disabled</xsl:attribute>
           </xsl:if>
@@ -470,11 +482,12 @@
   <xsl:template match="fi:multivaluefield[@state='output']" priority="3">
     <xsl:variable name="values" select="fi:values/fi:value/text()"/>
     <span id="{@id}">
+      <xsl:apply-templates select="." mode="css"/>
       <xsl:for-each select="fi:selection-list/fi:item">
         <xsl:variable name="value" select="@value"/>
         <xsl:if test="$values[. = $value]">
           <xsl:value-of select="fi:label/node()"/>
-    	    </xsl:if>
+    	</xsl:if>
       </xsl:for-each>
     </span>
   </xsl:template>
@@ -486,11 +499,12 @@
     <span id="{@id}" title="{fi:hint}">
       <xsl:choose>
         <xsl:when test="fi:value">
+            <xsl:apply-templates select="." mode="css"/>
           <!-- Has a value (filename): display it with a change button -->
             <xsl:text>[</xsl:text>
             <xsl:value-of select="fi:value"/>
             <xsl:text>] </xsl:text>
-            <input type="button" id="{@id}:input" name="{@id}" value="..." onclick="forms_submitForm(this)"/>
+            <input type="button" id="{@id}:input" name="{@id}" value="..." onclick="forms_submitForm(this)"
class="forms upload-change-button"/>
         </xsl:when>
         <xsl:otherwise>
           <input type="file" id="{@id}:input" name="{@id}" title="{fi:hint}" accept="{@mime-types}">
@@ -506,7 +520,7 @@
       | fi:upload, output state
       +-->
   <xsl:template match="fi:upload[@state='output']" priority="3">
-      <span id="{@id}"><xsl:copy-of select="fi:value/node()"/></span>
+      <span id="{@id}"><xsl:apply-templates select="." mode="css"/><xsl:copy-of
select="fi:value/node()"/></span>
   </xsl:template>
 
   <!--+
@@ -523,6 +537,7 @@
   <xsl:template match="fi:repeater">
     <input type="hidden" name="{@id}.size" value="{@size}"/>
     <table id="{@id}" border="1">
+      <xsl:apply-templates select="." mode="css"/>
       <tr>
         <xsl:for-each select="fi:headings/fi:heading">
           <th><xsl:value-of select="."/></th>
@@ -585,27 +600,28 @@
       +-->
   <xsl:template match="fi:form">
     <table border="1">
+      <xsl:apply-templates select="." mode="css"/>
       <xsl:for-each select="fi:widgets/*">
         <tr>
           <xsl:choose>
             <xsl:when test="self::fi:repeater">
-              <td colspan="2">
+              <td colspan="2" class="forms repeater-cell">
                 <xsl:apply-templates select="."/>
               </td>
             </xsl:when>
             <xsl:when test="self::fi:booleanfield">
-              <td>&#160;</td>
-              <td>
+              <td class="forms empty-cell">&#160;</td>
+              <td class="forms booleanfield-cell">
                 <xsl:apply-templates select="."/>
                 <xsl:text> </xsl:text>
                 <xsl:apply-templates select="." mode="label"/>
               </td>
             </xsl:when>
             <xsl:otherwise>
-              <td>
+              <td class="forms label-cell">
                 <xsl:apply-templates select="." mode="label"/>
               </td>
-              <td>
+              <td class="forms input-cell">
                 <xsl:apply-templates select="."/>
               </td>
             </xsl:otherwise>
@@ -629,6 +645,7 @@
       <xsl:if test="fi:message">
         <xsl:apply-templates select="." mode="label"/>:
         <ul>
+		  <xsl:apply-templates select="." mode="css"/>            
           <xsl:for-each select="fi:message">
             <li><xsl:apply-templates/></li>
           </xsl:for-each>
@@ -644,7 +661,7 @@
           <xsl:copy-of select="header"/>
         </xsl:when>
         <xsl:otherwise>
-          <p class="forms-validation-errors">The following errors have been detected
(marked with !):</p>
+          <p class="forms-validation-errors forms validation-errors-header">The following
errors have been detected (marked with !):</p>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:variable>
@@ -654,17 +671,17 @@
           <xsl:copy-of select="footer"/>
         </xsl:when>
         <xsl:otherwise>
-          <p class="forms-validation-errors">Please, correct them and re-submit the
form.</p>
+          <p class="forms-validation-errors forms validation-errors-footer">Please,
correct them and re-submit the form.</p>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:variable>
     <xsl:variable name="messages" select="ancestor::fi:form-template//fi:validation-message"/>
     <xsl:if test="$messages">
-      <div class="forms-validation-errors">
+      <div class="forms-validation-errors forms validation-errors">
         <xsl:copy-of select="$header"/>
         <ul>
           <xsl:for-each select="$messages">
-            <li class="forms-validation-error">
+            <li class="forms-validation-error forms validation-errors-content">
               <xsl:variable name="label">
                 <xsl:apply-templates select=".." mode="label"/>
               </xsl:variable>
@@ -718,6 +735,17 @@
     <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>
+  </xsl:template>
+    
+  <xsl:template match="*" mode="css">
+      <xsl:variable name="class"><xsl:text>forms </xsl:text>
+          <xsl:value-of select="local-name()"/><xsl:text> </xsl:text>
+          <xsl:value-of select="@state"/><xsl:text> </xsl:text>
+          <xsl:value-of select="fi:styling/@class"/><xsl:text> </xsl:text>
+          <xsl:if test="@required = 'true'"><xsl:text>required </xsl:text></xsl:if>

+          <xsl:if test="count(fi:validation-error) != 0">with-errors</xsl:if>
+      </xsl:variable>
+      <xsl:attribute name="class"><xsl:value-of select="normalize-space($class)"/></xsl:attribute>
   </xsl:template>
 
 </xsl:stylesheet>

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-page-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-page-styling.xsl?rev=404867&r1=404866&r2=404867&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-page-styling.xsl
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-page-styling.xsl
Sun May  7 16:11:08 2006
@@ -35,6 +35,7 @@
   -->
   <xsl:template match="fi:group[fi:styling/@layout and not(fi:styling/@type)]">
     <div title="{fi:hint}">
+      <xsl:apply-templates select="." mode="css"/>
       <xsl:copy-of select="@*"/>
       <xsl:apply-templates mode="group-layout" select="."/>
     </div>
@@ -73,17 +74,17 @@
         <input type="hidden" id="{$state-widget}" name="{$state-widget}" value="{$active}"/>
       </xsl:if>
       <!-- div containing the tabs -->
-      <div class="forms-tabArea">
+      <div class="forms-tabArea forms tabArea">
         <xsl:for-each select="fi:items/fi:*">
           <xsl:variable name="pos" select="position() - 1"/>
           <span id="{$id}_tab_{$pos}" onclick="forms_showTab('{$id}', {$pos}, {last()},
'{$state-widget}')">
             <xsl:attribute name="class">
-              <xsl:text>forms-tab</xsl:text>
-              <xsl:if test="$active = $pos"> forms-activeTab</xsl:if>
+              <xsl:text>forms-tab forms tab</xsl:text>
+              <xsl:if test="$active = $pos"> forms-activeTab active</xsl:if>
             </xsl:attribute>
             <xsl:copy-of select="fi:label/node()"/>
             <xsl:if test="fi:items/*//fi:validation-message">
-              <span class="forms-validation-message">&#160;!&#160;</span>
+              <span class="forms-validation-message forms validation-message">&#160;!&#160;</span>
             </xsl:if>
           </span>
         </xsl:for-each>
@@ -91,7 +92,7 @@
       <!-- a div for each of the items -->
       <xsl:for-each select="fi:items/fi:*">
         <xsl:variable name="pos" select="position() - 1"/>
-        <div class="forms-tabContent" id="{$id}_items_{$pos}">
+        <div class="forms-tabContent forms tabContent" id="{$id}_items_{$pos}">
           <xsl:if test="$active != $pos">
             <xsl:attribute name="style">display:none</xsl:attribute>
           </xsl:if>
@@ -159,7 +160,7 @@
           </xsl:for-each>
         </select>
         <xsl:if test="fi:items/*//fi:validation-message">
-          <span class="forms-validation-message">&#160;!&#160;</span>
+          <span class="forms-validation-message forms validation-message">&#160;!&#160;</span>
         </xsl:if>
       </legend>
       <!-- a div for each of the items -->
@@ -230,6 +231,7 @@
   -->
   <xsl:template match="fi:group[fi:styling/@layout='column']" mode="group-layout">
     <table border="0" summary="{fi:hint}">
+      <xsl:apply-templates select="." mode="css"/>
       <tbody>
         <xsl:apply-templates select="fi:items/*" mode="group-column-content"/>
       </tbody>
@@ -241,16 +243,16 @@
   -->
   <xsl:template match="fi:*" mode="group-column-content">
     <tr>
-      <td><xsl:apply-templates select="." mode="label"/></td>
+      <td class="forms label"><xsl:apply-templates select="." mode="label"/></td>
     </tr>
     <tr>
-      <td><xsl:apply-templates select="."/></td>
+      <td class="forms content"><xsl:apply-templates select="."/></td>
     </tr>
   </xsl:template>
 
   <xsl:template match="fi:action" mode="group-column-content">
     <tr>
-      <td><xsl:apply-templates select="."/></td>
+      <td class="forms action"><xsl:apply-templates select="."/></td>
     </tr>
   </xsl:template>
 
@@ -259,6 +261,7 @@
   -->
   <xsl:template match="fi:group[fi:styling/@layout='columns']" mode="group-layout">
     <table border="0" summary="{fi:hint}">
+      <xsl:apply-templates select="." mode="css"/>
       <tbody>
         <xsl:apply-templates select="fi:items/*" mode="group-columns-content"/>
       </tbody>
@@ -270,8 +273,8 @@
   -->
   <xsl:template match="fi:*" mode="group-columns-content">
     <tr>
-      <td><xsl:apply-templates select="." mode="label"/></td>
-      <td><xsl:apply-templates select="."/></td>
+      <td class="forms label"><xsl:apply-templates select="." mode="label"/></td>
+      <td class="forms content"><xsl:apply-templates select="."/></td>
     </tr>
   </xsl:template>
 
@@ -280,6 +283,7 @@
   -->
   <xsl:template match="fi:group[fi:styling/@layout='row']" mode="group-layout">
     <table border="0" summary="{fi:hint}">
+      <xsl:apply-templates select="." mode="css"/>
       <tbody>
         <tr>
           <xsl:apply-templates select="fi:items/*" mode="group-row-content"/>
@@ -292,18 +296,19 @@
     Default row layout : label left and input right
   -->
   <xsl:template match="fi:*" mode="group-row-content">
-    <td><xsl:apply-templates select="." mode="label"/></td>
-    <td><xsl:apply-templates select="."/></td>
+    <td class="forms label"><xsl:apply-templates select="." mode="label"/></td>
+    <td class="forms content"><xsl:apply-templates select="."/></td>
   </xsl:template>
 
   <xsl:template match="fi:action" mode="group-row-content">
-    <td><xsl:apply-templates select="."/></td>
+    <td class="forms action"><xsl:apply-templates select="."/></td>
   </xsl:template>
   <!--
     Rows group items layout
   -->
   <xsl:template match="fi:group[fi:styling/@layout='rows']" mode="group-layout">
     <table border="0" summary="{fi:hint}">
+      <xsl:apply-templates select="." mode="css"/>
       <tbody>
         <tr>
           <xsl:apply-templates select="fi:items/*" mode="group-rows-labels"/>
@@ -319,21 +324,21 @@
     Default rows layout : label above and input below
   -->
   <xsl:template match="fi:*" mode="group-rows-labels">
-    <td><xsl:apply-templates select="." mode="label"/></td>
+    <td class="forms label"><xsl:apply-templates select="." mode="label"/></td>
   </xsl:template>
 
   <xsl:template match="fi:action" mode="group-rows-labels">
-    <td>&#160;</td>
+    <td class="forms action">&#160;</td>
   </xsl:template>
 
   <xsl:template match="fi:*" mode="group-rows-content">
-    <td><xsl:apply-templates select="."/></td>
+    <td class="forms content"><xsl:apply-templates select="."/></td>
   </xsl:template>
 
   <!-- boolean field : checkbox and label on a single line -->
   <xsl:template match="fi:booleanfield" mode="group-columns-content">
     <tr>
-      <td colspan="2">
+      <td colspan="2" class="forms booleanfield">
         <xsl:apply-templates select="."/>
         <xsl:apply-templates select="." mode="label"/>
       </td>
@@ -343,14 +348,14 @@
   <!-- action : on a single line -->
   <xsl:template match="fi:action" mode="group-columns-content">
     <tr>
-      <td colspan="2"><xsl:apply-templates select="."/></td>
+      <td colspan="2" class="forms action"><xsl:apply-templates select="."/></td>
     </tr>
   </xsl:template>
 
   <!-- any other element : on a single line -->
   <xsl:template match="*" mode="group-columns-content">
     <tr>
-      <td colspan="2"><xsl:apply-templates select="."/></td>
+      <td colspan="2" class="forms other"><xsl:apply-templates select="."/></td>
     </tr>
   </xsl:template>
 
@@ -358,17 +363,17 @@
   <xsl:template match="fi:multivaluefield[fi:styling/@list-type='double-listbox' or not(fi:selection-list)]"
                 mode="group-columns-content">
     <tr>
-      <td colspan="2"><xsl:apply-templates select="." mode="label"/></td>
+      <td colspan="2" class="forms other label"><xsl:apply-templates select="."
mode="label"/></td>
     </tr>
     <tr>
-      <td colspan="2"><xsl:apply-templates select="."/></td>
+      <td colspan="2" class="forms other"><xsl:apply-templates select="."/></td>
     </tr>
   </xsl:template>
 
   <!-- nested group -->
   <xsl:template match="fi:group" mode="group-columns-content">
     <tr>
-      <td colspan="2"><xsl:apply-templates select="."/></td>
+      <td colspan="2" class="forms other"><xsl:apply-templates select="."/></td>
     </tr>
   </xsl:template>
 
@@ -377,5 +382,16 @@
       <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>
   </xsl:template>
+    
+  <xsl:template match="fi:group" mode="css">
+      <xsl:variable name="class"><xsl:text>forms </xsl:text> 
+          <xsl:value-of select="local-name()"/><xsl:text> </xsl:text> 
+          <xsl:value-of select="fi:styling/@layout"/><xsl:text> </xsl:text>

+          <xsl:value-of select="fi:styling/@type"/><xsl:text> </xsl:text>

+          <xsl:value-of select="fi:styling/@class"/>
+      </xsl:variable>
+      <xsl:attribute name="class"><xsl:value-of select="normalize-space($class)"/></xsl:attribute>
+  </xsl:template>
+    
 
 </xsl:stylesheet>



Mime
View raw message