cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/woody/samples/resources woody-samples-layout.xsl woody-field-layout.xsl woody-page-layout.xsl
Date Thu, 04 Sep 2003 16:07:45 GMT
sylvain     2003/09/04 09:07:45

  Modified:    src/blocks/woody/samples sitemap.xmap
               src/blocks/woody/samples/forms form1.xml
                        form1_template_action.xml form1_template_flow.xml
               src/blocks/woody/samples/resources woody-field-layout.xsl
                        woody-page-layout.xsl
  Added:       src/blocks/woody/samples/resources woody-samples-layout.xsl
  Log:
  Advanced form layout : tabs !
  
  Revision  Changes    Path
  1.16      +2 -2      cocoon-2.1/src/blocks/woody/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/sitemap.xmap,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- sitemap.xmap	3 Sep 2003 17:12:45 -0000	1.15
  +++ sitemap.xmap	4 Sep 2003 16:07:45 -0000	1.16
  @@ -125,7 +125,7 @@
          <map:transform type="i18n">
            <map:parameter name="locale" value="en-US"/>
          </map:transform>
  -       <map:transform src="resources/woody-page-layout.xsl"/>
  +       <map:transform src="resources/woody-samples-layout.xsl"/>
          <map:serialize/>
        </map:match>
           
  @@ -160,7 +160,7 @@
            <map:parameter name="file" value="forms/form1_template_flow.xml"/>
            <map:parameter name="remove" value="{0}"/>
          </map:transform> 
  -       <map:transform src="resources/woody-page-layout.xsl"/>
  +       <map:transform src="resources/woody-samples-layout.xsl"/>
          <map:serialize/>
        </map:match>
   
  
  
  
  1.11      +8 -4      cocoon-2.1/src/blocks/woody/samples/forms/form1.xml
  
  Index: form1.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/forms/form1.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- form1.xml	3 Sep 2003 08:21:52 -0000	1.10
  +++ form1.xml	4 Sep 2003 16:07:45 -0000	1.11
  @@ -2,6 +2,10 @@
   <wd:form
     xmlns:wd="http://apache.org/cocoon/woody/definition/1.0"
     xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
  +  
  +  <wd:field id="tab-state">
  +    <wd:datatype base="string"/>
  +  </wd:field>
   
     <wd:field id="email" required="true">
       <wd:datatype base="string">
  @@ -204,12 +208,12 @@
       </wd:booleanfield>
     </wd:repeater>
   
  -  <wd:action id="addcontact" action-command="add-contact">
  +  <wd:button id="addcontact" action-command="add-contact">
       <wd:label>Add contact</wd:label>
  -  </wd:action>
  +  </wd:button>
   
  -  <wd:action id="removecontacts" action-command="remove-selected-contacts">
  +  <wd:button id="removecontacts" action-command="remove-selected-contacts">
       <wd:label>Remove selected contacts</wd:label>
  -  </wd:action>
  +  </wd:button>
   
   </wd:form>
  
  
  
  1.4       +118 -79   cocoon-2.1/src/blocks/woody/samples/forms/form1_template_action.xml
  
  Index: form1_template_action.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/forms/form1_template_action.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- form1_template_action.xml	3 Sep 2003 17:12:45 -0000	1.3
  +++ form1_template_action.xml	4 Sep 2003 16:07:45 -0000	1.4
  @@ -5,90 +5,129 @@
     <title>Sample form</title>
     <content>
       <wt:form-template action="form1" method="POST">
  -    <table align="center">
  -     <tr><td>
  -     
  -      <!-- a wi:group produces a columnized layout of fields, along with a <fieldset>
  -           frame if there is a <wi:label> -->
  -      <wi:group>
  -        <wi:label>String fields</wi:label>
  -        <wi:items>
  -          <wt:widget id="email"/>
  -          <wt:widget id="fourchars">
  -            <!-- particular styling for the enumeration -->
  -            <wi:styling list-type="listbox" listbox-size="4"/>
  -          </wt:widget>
  -        </wi:items>
  -      </wi:group>
  -      
  -      <wi:group>
  -        <wi:label>Number fields</wi:label>
  -        <wi:items>
  -          <wt:widget id="number1"/>
  -          <wt:widget id="number2"/>
  -          <wt:widget id="account"/>
  -          <wt:widget id="cowheight">
  -            <wi:styling list-type="radio"/>
  -          </wt:widget>
  -        </wi:items>
  -      </wi:group>
  -      
  -      <!-- wi:group with no label : columnized layout without a surrounding frame -->
  -      <wi:group>
  -        <wi:label>Boolean fields</wi:label>
  -        <wi:items>
  -          <wt:widget id="somebool"/>
  -          <wt:widget id="drinks"/>
  -        </wi:items>
  -      </wi:group>
  -
  -
  -      <wi:group>
  -        <wi:items>
  -          <wt:widget id="visa"/>
  -          <wt:widget id="ipaddress"/>
  -          <wt:widget id="birthdate"><wi:styling type="date" format="dd/MM/yyyy"/></wt:widget>
  -          <wt:widget id="altbirthdate"/>
  -          <wt:widget id="dieselprice"/>
  -        </wi:items>
  -      </wi:group>
  -
  -
  -      <!-- manual layout of fieldw, without use of a wi:group -->
  -      <wt:widget-label id="contacts"/><br/>
  -      <wt:repeater-size id="contacts"/>
  -      <table border="1">
  +      <table align="center">
           <tr>
  -          <th><wt:repeater-widget-label id="contacts" widget-id="firstname"/></th>
  -          <th><wt:repeater-widget-label id="contacts" widget-id="lastname"/></th>
  -          <th><wt:repeater-widget-label id="contacts" widget-id="phone"/></th>
  -          <th><wt:repeater-widget-label id="contacts" widget-id="email"/></th>
  -          <th><wt:repeater-widget-label id="contacts" widget-id="select"/></th>
  -        </tr>
  -
  -        <!-- The contents of the repeater-widget element is a template that will
  +          <td>
  +          
  +            <!-- artificial widget needed to keep tab state. Work still needed on that
-->
  +            <wt:widget id="tab-state">
  +              <wi:styling type="hidden"/>
  +            </wt:widget>
  +            
  +            <!-- group with tabs. Each of the children of <items> will constitute
a tab -->
  +            <wi:group state-widget="tab-state">
  +              <wi:styling type="tabs"/>
  +              
  +              <wi:items>
  +                <!-- group with automatic two-column layout -->
  +                <wi:group>
  +                  <wi:label>String fields</wi:label>
  +                  <wi:styling layout="columns"/>
  +                  <wi:items>
  +                    <wt:widget id="email"/>
  +                    <wt:widget id="fourchars">
  +                      <!-- particular styling for the enumeration -->
  +                      <wi:styling list-type="listbox" listbox-size="4"/>
  +                    </wt:widget>
  +                  </wi:items>
  +                </wi:group>
  +                
  +                <wi:group>
  +                  <wi:label>Number fields</wi:label>
  +                  <wi:styling layout="columns"/>
  +                  <wi:items>
  +                    <wt:widget id="number1"/>
  +                    <wt:widget id="number2"/>
  +                    <wt:widget id="account"/>
  +                    <wt:widget id="cowheight">
  +                      <wi:styling list-type="radio"/>
  +                    </wt:widget>
  +                  </wi:items>
  +                </wi:group>
  +                
  +                <wi:group>
  +                  <wi:styling layout="columns"/>
  +                  <wi:label>Boolean fields</wi:label>
  +                  <wi:items>
  +                    <wt:widget id="somebool"/>
  +                    <wt:widget id="drinks"/>
  +                  </wi:items>
  +                </wi:group>
  +              </wi:items>
  +            </wi:group>
  +            
  +            <br/>
  +            
  +            <!-- Group of type 'fieldset' will have a surrounding frame -->
  +            <wi:group>
  +              <wi:styling type="fieldset" layout="columns"/>
  +              <wi:label>Misc controls</wi:label>
  +              <wi:items>
  +                <wt:widget id="visa"/>
  +                <wt:widget id="ipaddress"/>
  +                <wt:widget id="birthdate">
  +                  <wi:styling type="date" format="dd/MM/yyyy"/>
  +                </wt:widget>
  +                <wt:widget id="altbirthdate"/>
  +                <wt:widget id="dieselprice"/>
  +              </wi:items>
  +            </wi:group>
  +            
  +            
  +            <!-- manual layout of fields, without use of a wi:group -->
  +            <wt:widget-label id="contacts"/>
  +            <br/>
  +            <wt:repeater-size id="contacts"/>
  +            <table border="1">
  +              <tr>
  +                <th>
  +                  <wt:repeater-widget-label id="contacts" widget-id="firstname"/>
  +                </th>
  +                <th>
  +                  <wt:repeater-widget-label id="contacts" widget-id="lastname"/>
  +                </th>
  +                <th>
  +                  <wt:repeater-widget-label id="contacts" widget-id="phone"/>
  +                </th>
  +                <th>
  +                  <wt:repeater-widget-label id="contacts" widget-id="email"/>
  +                </th>
  +                <th>
  +                  <wt:repeater-widget-label id="contacts" widget-id="select"/>
  +                </th>
  +              </tr>
  +              <!-- The contents of the repeater-widget element is a template that will
           be applied to each row in the repeater. -->
  -        <wt:repeater-widget id="contacts">
  -          <tr>
  -            <td><wt:widget id="firstname"/></td>
  -            <td><wt:widget id="lastname"/></td>
  -            <td><wt:widget id="phone"/></td>
  -            <td><wt:widget id="email"/></td>
  -            <td><wt:widget id="select"/></td>
  -          </tr>
  -        </wt:repeater-widget>
  -
  -        <tr>
  -          <td colspan="4" align="right">
  -            <wt:widget id="addcontact"/>
  -            <wt:widget id="removecontacts"/>
  +              <wt:repeater-widget id="contacts">
  +                <tr>
  +                  <td>
  +                    <wt:widget id="firstname"/>
  +                  </td>
  +                  <td>
  +                    <wt:widget id="lastname"/>
  +                  </td>
  +                  <td>
  +                    <wt:widget id="phone"/>
  +                  </td>
  +                  <td>
  +                    <wt:widget id="email"/>
  +                  </td>
  +                  <td>
  +                    <wt:widget id="select"/>
  +                  </td>
  +                </tr>
  +              </wt:repeater-widget>
  +              <tr>
  +                <td colspan="4" align="right">
  +                  <wt:widget id="addcontact"/>
  +                  <wt:widget id="removecontacts"/>
  +                </td>
  +              </tr>
  +            </table>
  +            <input type="submit"/>
             </td>
           </tr>
         </table>
  -
  -      <input type="submit"/>
  -     </td></tr>
  -    </table>
       </wt:form-template>
     </content>
   </page>
  
  
  
  1.4       +4 -0      cocoon-2.1/src/blocks/woody/samples/forms/form1_template_flow.xml
  
  Index: form1_template_flow.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/forms/form1_template_flow.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- form1_template_flow.xml	3 Sep 2003 17:12:45 -0000	1.3
  +++ form1_template_flow.xml	4 Sep 2003 16:07:45 -0000	1.4
  @@ -12,6 +12,7 @@
              frame if there is a <wi:label> -->
         <wi:group>
           <wi:label>String fields</wi:label>
  +        <wi:styling type="fieldset" layout="columns"/>
           <wi:items>
             <wt:widget id="email"/>
             <wt:widget id="fourchars">
  @@ -23,6 +24,7 @@
         
         <wi:group>
           <wi:label>Number fields</wi:label>
  +        <wi:styling type="fieldset" layout="columns"/>
           <wi:items>
             <wt:widget id="number1"/>
             <wt:widget id="number2"/>
  @@ -36,6 +38,7 @@
         <!-- wi:group with no label : columnized layout without a surrounding frame -->
         <wi:group>
           <wi:label>Boolean fields</wi:label>
  +        <wi:styling type="fieldset" layout="columns"/>
           <wi:items>
             <wt:widget id="somebool"/>
             <wt:widget id="drinks"/>
  @@ -44,6 +47,7 @@
   
   
         <wi:group>
  +        <wi:styling layout="columns"/>
           <wi:items>
             <wt:widget id="visa"/>
             <wt:widget id="ipaddress"/>
  
  
  
  1.3       +13 -12    cocoon-2.1/src/blocks/woody/samples/resources/woody-field-layout.xsl
  
  Index: woody-field-layout.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-field-layout.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- woody-field-layout.xsl	3 Sep 2003 18:35:17 -0000	1.2
  +++ woody-field-layout.xsl	4 Sep 2003 16:07:45 -0000	1.3
  @@ -13,10 +13,10 @@
           <xsl:copy-of select="wi:styling/@*"/>
         </xsl:if>
       </input>
  -    <xsl:call-template name="field-common"/>
  +    <xsl:call-template name="woody-field-common"/>
     </xsl:template>
     
  -  <xsl:template name="field-common">
  +  <xsl:template name="woody-field-common">
       <xsl:apply-templates select="wi:validation-message"/>
       <xsl:if test="@required='true'">
         <b>*</b>
  @@ -43,9 +43,10 @@
         <xsl:when test="$liststyle='radio'">
           <span title="{wi:help}">
           <xsl:variable name="vertical" select="string(wi:styling/@list-orientation) !=
'horizontal'"/>
  +        <xsl:variable name="id" select="@id"/>
           <xsl:for-each select="wi:selection-list/wi:item">
             <xsl:if test="$vertical and position() != 1"><br/></xsl:if>
  -          <input type="radio" name="{@id}" value="{@value}">
  +          <input type="radio" name="{$id}" value="{@value}">
               <xsl:if test="@value = $value">
                 <xsl:attribute name="checked">true</xsl:attribute>
               </xsl:if>
  @@ -80,7 +81,7 @@
           </select>
         </xsl:otherwise>
       </xsl:choose>
  -    <xsl:call-template name="field-common"/>
  +    <xsl:call-template name="woody-field-common"/>
     </xsl:template>
     
     <!--
  @@ -91,7 +92,7 @@
         <xsl:copy-of select="wi:styling/@*[not(name() = 'type')]"/>
         <xsl:copy-of select="wi:value/node()"/>
       </textarea>
  -    <xsl:call-template name="field-common"/>
  +    <xsl:call-template name="woody-field-common"/>
     </xsl:template>
   
     <!--
  @@ -117,11 +118,11 @@
       </input>
       <!-- note: we use forms[0]['{@id}'] and not forms[0].{@id} since @id may not be
a valid JS property name -->
       <a href="#" onClick="woody_calendar.select(document.forms[0]['{@id}'],'{generate-id()}','{$format}');
return false;" NAME="{generate-id()}" ID="{generate-id()}"><img src="resources/cal.gif"
border="0" alt="Calendar"/></a>
  -    <xsl:call-template name="field-common"/>
  +    <xsl:call-template name="woody-field-common"/>
     </xsl:template>
   
     <!-- must be called in <head> to load calendar script and setup the CSS -->
  -  <xsl:template name="calendar-head">
  +  <xsl:template name="woody-calendar-head">
       <xsl:param name="uri" select="'resources'"/>
       <xsl:param name="div"/>
       <script src="{$uri}/CalendarPopup.js" language="JavaScript"></script>
  @@ -157,13 +158,13 @@
           <xsl:attribute name="checked">true</xsl:attribute>
         </xsl:if>
       </input>
  -    <xsl:call-template name="field-common"/>
  +    <xsl:call-template name="woody-field-common"/>
     </xsl:template>
   
     <!--
  -    wi:action
  +    wi:button
     -->
  -  <xsl:template match="wi:action">
  +  <xsl:template match="wi:button">
       <input type="submit" name="{@id}" title="{wi:help}">
         <xsl:attribute name="value"><xsl:value-of select="wi:label/node()"/></xsl:attribute>
       </input>
  @@ -202,7 +203,7 @@
         <br/>
       </xsl:for-each>
       </span>
  -    <xsl:call-template name="field-common"/>
  +    <xsl:call-template name="woody-field-common"/>
     </xsl:template>
   
     <!--
  @@ -286,7 +287,7 @@
   
     <xsl:template match="wi:aggregatefield">
       <input name="{@id}" value="{wi:value}" title="{wi:help}"/>
  -    <xsl:call-template name="field-common"/>
  +    <xsl:call-template name="woody-field-common"/>
     </xsl:template>
   
     <xsl:template match="@*|node()" priority="-1">
  
  
  
  1.2       +114 -32   cocoon-2.1/src/blocks/woody/samples/resources/woody-page-layout.xsl
  
  Index: woody-page-layout.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/resources/woody-page-layout.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- woody-page-layout.xsl	3 Sep 2003 17:12:45 -0000	1.1
  +++ woody-page-layout.xsl	4 Sep 2003 16:07:45 -0000	1.2
  @@ -3,55 +3,137 @@
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:wi="http://apache.org/cocoon/woody/instance/1.0">
  - 
  +  
     <xsl:include href="woody-field-layout.xsl"/>
     
  -  <!-- head and body stuff required to use the calendar popup -->
  -  <xsl:template match="head">
  -    <xsl:copy>
  -      <xsl:apply-templates/>
  -      <xsl:call-template name="calendar-head">
  -        <xsl:with-param name="div">WoodyCalendarDiv</xsl:with-param>
  -      </xsl:call-template>
  -    </xsl:copy>
  +  <xsl:template name="woody-layout-head">
  +    <xsl:call-template name="woody-calendar-head">
  +      <xsl:with-param name="div">WoodyCalendarDiv</xsl:with-param>
  +    </xsl:call-template>
  +      
  +    <script language="JavaScript">
  +      function showWoodyTab(tabgroup, idx, length, state) {
  +        for (var i = 0; i &lt; length; i++) {
  +          var tab = document.getElementById(tabgroup + "_tab_" + i);
  +          tab.className = (i == idx) ? 'woody-tab woody-activeTab': 'woody-tab';
  +           
  +          var tabitems = document.getElementById(tabgroup + "_items_" + i);
  +          tabitems.style.display = (i == idx) ? '' : 'none';
  +        }
  +        if (state.length > 0) {
  +          document.forms[0][state].value = idx;
  +        }
  +      }
  +      </script>
     </xsl:template>
     
  -  <xsl:template match="body">
  -    <xsl:copy>
  -      <xsl:apply-templates/>
  -       <div id="WoodyCalendarDiv" style="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"/>
  -    </xsl:copy>
  +  <xsl:template name="woody-layout-body">
  +     <div id="WoodyCalendarDiv" style="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"/>
     </xsl:template>
     
     <!--
  -    wi:group : columnized layout of fields, with a surrounding frame if the group has a
wi:label
  +    wi:group : default is to enclose items in a div
     -->
     <xsl:template match="wi:group">
  -    <xsl:choose>
  -      <xsl:when test="wi:label">
  -        <fieldset>
  -          <legend><xsl:copy-of select="wi:label/node()"/></legend>
  -          <xsl:call-template name="group-content"/>
  -        </fieldset>
  -      </xsl:when>
  -      <xsl:otherwise>
  -        <xsl:call-template name="group-content"/>
  -      </xsl:otherwise>
  -    </xsl:choose>
  +    <div title="{wi:help}">
  +      <xsl:copy-of select="@*"/>
  +      <xsl:apply-templates mode="group-layout" select="."/>
  +    </div>
  +  </xsl:template>
  +  
  +  <!--
  +    wi:group of type tabs
  +  -->
  +  <xsl:template match="wi:group[wi:styling/@type='tabs']">
  +    <!-- find the currently selected tab.
  +         Thoughts still needed here, such as autogenerating a field in the woodytransformer
  +         to hold this state.
  +    -->
  +    <xsl:variable name="active">
  +      <xsl:choose>
  +        <xsl:when test="@state-widget">
  +          <xsl:variable name="value" select="string(//wi:field[@id = current()/@state-widget]/wi:value)"/>
  +          <xsl:choose>
  +            <xsl:when test="string-length($value) > 0"><xsl:value-of select="$value"/></xsl:when>
  +            <xsl:otherwise>0</xsl:otherwise>
  +          </xsl:choose>
  +        </xsl:when>
  +        <xsl:otherwise>0</xsl:otherwise>
  +      </xsl:choose>
  +    </xsl:variable>
  +    
  +    <!-- copy the "state-widget" attribute for use in for-each -->
  +    <xsl:variable name="state-widget" select="@state-widget"/>
  +    
  +    <xsl:variable name="id" select="generate-id()"/>
  +    <div id="{$id}">
  +    
  +      <!-- div containing the tabs -->
  +      <div class="woody-tabArea">
  +        <xsl:for-each select="wi:items/wi:*">
  +          <span id="{$id}_tab_{position() - 1}" onclick="showWoodyTab('{$id}', {position()
- 1}, {last()}, '{$state-widget}')">
  +            <xsl:choose>
  +              <xsl:when test="$active = (position() - 1)">
  +                <xsl:attribute name="class">woody-tab woody-activeTab</xsl:attribute>
  +              </xsl:when>
  +              <xsl:otherwise>
  +                <xsl:attribute name="class">woody-tab</xsl:attribute>
  +              </xsl:otherwise>
  +            </xsl:choose>
  +
  +            <xsl:copy-of select="wi:label/node()"/>
  +            <xsl:if test=".//wi:validation-message">
  +              <span style="color:red; font-weight: bold">&#160;!&#160;</span>
  +            </xsl:if>
  +          </span>
  +        </xsl:for-each>
  +      </div>
  +      
  +      <!-- a div for each of the items -->
  +      <xsl:for-each select="wi:items/wi:*">
  +        <div class="woody-tabContent" id="{$id}_items_{position() - 1}">
  +          <xsl:if test="$active != position() - 1">
  +            <xsl:attribute name="style">display:none</xsl:attribute>
  +          </xsl:if>
  +          <xsl:apply-templates select="."/>
  +        </div>
  +      </xsl:for-each>
  +    </div>
  +  </xsl:template>
  +  
  +  <!--
  +    wi:group of type fieldset : enclose items in a fieldset frame
  +  -->
  +  <xsl:template match="wi:group[wi:styling/@type='fieldset']">
  +    <fieldset>
  +      <xsl:copy-of select="wi:styling/@*[name() != 'type']"/>
  +      <legend title="{wi:help}"><xsl:copy-of select="wi:label/node()"/></legend>
  +      <xsl:apply-templates mode="group-layout" select="."/>
  +    </fieldset>
  +  </xsl:template>
  +  
  +  <!--
  +    Group items layout : default is no layout
  +  -->
  +  <xsl:template match="wi:group" mode="group-layout">
  +    <xsl:apply-templates select="wi:items/node()"/>
     </xsl:template>
     
  -  <xsl:template name="group-content">
  +  <!--
  +    Columnized group items layout
  +  -->
  +  <xsl:template match="wi:group[wi:styling/@layout='columns']" mode="group-layout">
       <table border="0">
         <tbody>
  -        <xsl:apply-templates select="wi:items/*" mode="group-content"/>
  +        <xsl:apply-templates select="wi:items/*" mode="group-columns-content"/>
         </tbody>
       </table>
     </xsl:template>
     
     <!--
  -    Default layout : label left and input right
  +    Default column layout : label left and input right
     -->
  -  <xsl:template match="wi:*" mode="group-content">
  +  <xsl:template match="wi:*" mode="group-columns-content">
       <tr>
         <td valign="top"><xsl:copy-of select="wi:label/node()"/></td>
         <td><xsl:apply-templates select="."/></td>
  @@ -59,14 +141,14 @@
     </xsl:template>
   
     <!-- boolean field : checkbox and label on a single line -->
  -  <xsl:template match="wi:booleanfield" mode="group-content">
  +  <xsl:template match="wi:booleanfield" mode="group-columns-content">
       <tr>
         <td colspan="2"><xsl:apply-templates select="."/> <xsl:copy-of select="wi:label/node()"/></td>
       </tr>
     </xsl:template>
   
     <!-- nested group -->
  -  <xsl:template match="wi:group" mode="group-content">
  +  <xsl:template match="wi:group" mode="group-columns-content">
       <tr>
         <td colspan="2"><xsl:apply-templates select="."/></td>
       </tr>
  
  
  
  1.1                  cocoon-2.1/src/blocks/woody/samples/resources/woody-samples-layout.xsl
  
  Index: woody-samples-layout.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <xsl:include href="woody-page-layout.xsl"/>
    
    <!-- head and body stuff required to use the calendar popup -->
    <xsl:template match="head">
      <xsl:copy>
        <xsl:apply-templates/>
        <xsl:call-template name="woody-layout-head"/>
        <style type="text/css">
          .woody-tab {
              background-color: #ffffff;
              border: 1px solid #000000;
              border-bottom-width: 0px;
              padding: 2px 1em 2px 1em;
              margin-right: 5px;
              position: relative;
              text-decoration: none;
              top: -1px;
              z-index: 100;
              cursor: pointer;
          }
                
          .woody-tab.woody-activeTab {
              z-index: 102;
              font-weight: bold;
              padding-top: 5px;
              cursor: default;
          }
          
          .woody-tabContent {
              background-color: #ffffff;
              border: 1px solid #000000;
              padding: 1em;
              position: relative;
              z-index: 101;
          }
        </style>
      </xsl:copy>
    </xsl:template>
    
    <xsl:template match="body">
      <xsl:copy>
        <xsl:apply-templates/>
        <xsl:call-template name="woody-layout-body"/>
      </xsl:copy>
    </xsl:template>
    
  
  </xsl:stylesheet>
  
  
  

Mime
View raw message