Ignore:
Timestamp:
2006-11-15T11:03:38+13:00 (17 years ago)
Author:
shaoqun
Message:

now replace table tags with div tages to make changing styles easier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/web/interfaces/default/transform/document.xsl

    r12152 r13267  
    5757    </xsl:call-template>
    5858   </xsl:if>
     59
    5960  <!-- display the document -->
     61  <div class="document">
    6062    <xsl:apply-templates select="document">
    6163      <xsl:with-param name="collName" select="$collName"/>
    6264    </xsl:apply-templates>
    63     <xsl:call-template name="dividerBar"/>
     65    </div>
    6466  </xsl:template>
    6567   
    6668  <xsl:template match="document">
    67     <xsl:param name="collName"/>
     69   <xsl:param name="collName"/>
     70 
    6871    <xsl:call-template name="documentHeading">
    6972      <xsl:with-param name="collName" select="$collName"/>
    7073    </xsl:call-template>
     74 
    7175    <xsl:call-template name="documentArrows">
    7276      <xsl:with-param name="collName" select="$collName"/>
     77    </xsl:call-template>         
     78    <xsl:call-template name="documentContent">
     79      <xsl:with-param name="collName" select="$collName"/>
     80    </xsl:call-template>
     81    <xsl:call-template name="documentArrows">
     82      <xsl:with-param name="collName" select="$collName"/>
    7383    </xsl:call-template>     
    74     <xsl:call-template name="documentContent">
    75       <xsl:with-param name="collName" select="$collName"/>
    76     </xsl:call-template>
    77     <xsl:call-template name="documentArrows">
    78       <xsl:with-param name="collName" select="$collName"/>
    79     </xsl:call-template>     
    80   </xsl:template>
     84 </xsl:template>
    8185
    8286  <xsl:template name="documentHeading">
     
    8892    <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
    8993    <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
    90     <table><tr><td>
     94   <div class="documentheading">
    9195      <a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$p.c}&amp;rt=rd"><xsl:call-template name="openbookimg"><xsl:with-param name="title">Close this book and return to search/browse</xsl:with-param>
    92       </xsl:call-template></a></td>
    93     <td valign='top'><b><font size="+1">&#160;
    94           <xsl:choose><xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>
    95         </font></b></td>
    96       </tr></table>
    97 
    98     <table cellpadding="10" cellspacing="0">
    99       <tr>
    100     <td valign="top" align="left">
    101       <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">
    102         <xsl:call-template name="coverImage"/>
    103         <p/>
    104       </xsl:if>
    105      
    106       <xsl:call-template name="documentButtons">
    107         <xsl:with-param name="collName" select="$collName"/>
    108       </xsl:call-template>
    109       <!--<xsl:call-template name="enrichServices">
    110         <xsl:with-param name="collName" select="$collName"/>
    111       </xsl:call-template>-->
    112     </td>
    113     <xsl:if test="string($doTOC) != 'false'">
    114       <td valign="top" align="left">
    115         <xsl:call-template name="TOC">
    116           <xsl:with-param name="collName" select="$collName"/>
    117         </xsl:call-template>
    118       </td>
    119     </xsl:if>
    120       </tr>
    121     </table>
    122   </xsl:template>
     96      </xsl:call-template></a>
     97         <xsl:choose><xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>
     98  </div>
     99 
     100  <div class="documentinfo">
     101       <div class="headingimage">
     102          <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">
     103       <xsl:call-template name="coverImage"/>
     104         </xsl:if>
     105      </div>
     106     
     107     <div class="docbuttons" >
     108       <xsl:call-template name="documentButtons">
     109      <xsl:with-param name="collName" select="$collName"/>
     110       </xsl:call-template>
     111     </div>
     112    </div>
     113    <!--<div><xsl:call-template name="enrichServices">
     114       <xsl:with-param name="collName" select="$collName"/>
     115      </xsl:call-template></div>-->
     116     <xsl:if test="string($doTOC) != 'false'">
     117       <div class="toc">
     118     <xsl:call-template name="TOC">
     119       <xsl:with-param name="collName" select="$collName"/>
     120     </xsl:call-template>
     121       </div>
     122      </xsl:if>
     123     
     124    </xsl:template>
    123125
    124126  <xsl:template name="coverImage">
     
    133135    <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>
    134136   
    135     <table>
     137   
    136138      <!-- expand document -->
    137139      <!-- this doesn't work with MG so comment it out for now -->
    138140     
    139       <xsl:if test="@docType = 'hierarchy' or @docType = 'paged'">
    140       <tr><td class="gsbutton">
     141   <xsl:if test="@docType = 'hierarchy' or @docType = 'paged'">
     142     <div class="docbutton">
     143      <span class="docbutton">
    141144      <xsl:choose><xsl:when test="string($ed)='1'">
    142           <a class="gsbutton" href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_tip')"/></xsl:attribute>
    143           <font size='-2'><xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_b')"/></font>
     145          <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_tip')"/></xsl:attribute>
     146          <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_b')"/>
    144147          </a>
    145148        </xsl:when>
    146149        <xsl:otherwise>
    147       <a class="gsbutton" href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_tip')"/></xsl:attribute>
    148         <font size='-2'><xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_b')"/></font>
     150      <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_tip')"/></xsl:attribute>
     151         <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_b')"/>
    149152      </a>
    150153        </xsl:otherwise>
    151154      </xsl:choose>
    152     </td></tr>
     155          </span>
     156    </div>
    153157      </xsl:if>
    154158     
    155159      <!-- expand contents -->
    156160      <xsl:if test="@docType = 'hierarchy' and string(/page/pageResponse/format/gsf:option[@name='documentTOC']/@value) != 'false'">
    157       <tr><td class="gsbutton">
     161      <div class="docbutton">
     162         <span class="docbutton">
    158163      <xsl:choose><xsl:when test="string($ec)='1'">
    159           <a class="gsbutton" href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_tip')"/></xsl:attribute>
    160           <font size='-2'><xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_b')"/></font>
    161           </a>
     164          <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_tip')"/></xsl:attribute>
     165        <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_b')"/>         </a>
    162166        </xsl:when>
    163167        <xsl:otherwise>
    164           <a class="gsbutton" href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_tip')"/></xsl:attribute>
    165         <font size='-2'><xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_b')"/></font>
     168          <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_tip')"/></xsl:attribute>
     169         <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_b')"/>
    166170          </a>
    167171        </xsl:otherwise>
    168172      </xsl:choose>
    169     </td></tr>
     173      </span>
     174    </div>
    170175      </xsl:if>
     176
    171177      <!-- detach page -->
    172178      <xsl:variable name="paramList" select="/page/pageRequest/paramList"/>
    173       <tr><td class="gsbutton">
    174       <a class="gsbutton" target="_blank"><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;d=<xsl:value-of select="$docID"/>&amp;c=<xsl:value-of select="$collName"/>&amp;sib=<xsl:value-of select="$sib"/>&amp;dt=<xsl:value-of select="$paramList/param[@name='dt']/@value"/>&amp;ec=<xsl:value-of select="$paramList/param[@name='ec']/@value"/>&amp;et=<xsl:value-of select="$paramList/param[@name='et']/@value"/>&amp;p.a=<xsl:value-of select="$paramList/param[@name='p.a']/@value"/>&amp;p.s=<xsl:value-of select="$paramList/param[@name='p.s']/@value"/>&amp;p.sa=<xsl:value-of select="$paramList/param[@name='p.sa']/@value"/></xsl:attribute><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_tip')"/></xsl:attribute>
    175         <font size='-2'><xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_b')"/></font>
    176       </a></td></tr>
    177     </table>
    178   </xsl:template>
     179      <div class="docbutton">
     180         <span class="docbutton">
     181      <a target="_blank"><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;d=<xsl:value-of select="$docID"/>&amp;c=<xsl:value-of select="$collName"/>&amp;sib=<xsl:value-of select="$sib"/>&amp;dt=<xsl:value-of select="$paramList/param[@name='dt']/@value"/>&amp;ec=<xsl:value-of select="$paramList/param[@name='ec']/@value"/>&amp;et=<xsl:value-of select="$paramList/param[@name='et']/@value"/>&amp;p.a=<xsl:value-of select="$paramList/param[@name='p.a']/@value"/>&amp;p.s=<xsl:value-of select="$paramList/param[@name='p.s']/@value"/>&amp;p.sa=<xsl:value-of select="$paramList/param[@name='p.sa']/@value"/></xsl:attribute><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_tip')"/></xsl:attribute>
     182        <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_b')"/>
     183      </a></span></div>
     184      </xsl:template>
    179185
    180186  <xsl:template name="TOC">
     
    205211    <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
    206212    <xsl:if test="documentNode[@nodeID]">
    207       <table>
    208     <tr valign='top'><td>
     213      <div class="tocnodes">
     214    <div class="tocnode">
    209215        <xsl:choose><xsl:when test="string($oc)='0'">
    210216        <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=1"><xsl:call-template name="closedfolderimg"><xsl:with-param name="title">open the table of contents</xsl:with-param></xsl:call-template></a>
    211217          </xsl:when>
    212218          <xsl:otherwise><a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=0"><xsl:call-template name="openfolderimg"><xsl:with-param name="title">close the table of contents</xsl:with-param></xsl:call-template></a></xsl:otherwise></xsl:choose>
    213       </td><td>Table of Contents</td></tr>
     219      <span>Table of Contents</span>
    214220    <xsl:if test="string($oc)!='0'">
    215       <tr><td>&#160;</td><td>
    216           <table>
    217         <xsl:for-each select="documentNode/documentNode[@nodeID]">
     221        <xsl:for-each select="documentNode/documentNode[@nodeID]">
    218222          <xsl:apply-templates select='.'><xsl:with-param name="collName" select="$collName"/><xsl:with-param name="ec" select="$ec"/><xsl:with-param name="p.a" select="$p.a"/><xsl:with-param name="p.s" select="$p.s"/><xsl:with-param name="p.sa" select="$p.sa"/><xsl:with-param name="p.c" select="$p.c"/></xsl:apply-templates>
    219223        </xsl:for-each>
    220           </table>
    221         </td></tr>
    222     </xsl:if>
    223       </table>
     224       </xsl:if>
     225        </div>
     226      </div>
    224227    </xsl:if>
    225228  </xsl:template>
     
    234237    <xsl:param name="p.c"/>
    235238    <!-- Display the appropriate image, depending on the node type -->
    236     <tr><td valign="top">
     239     <div class="tocnode">
    237240    <a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&amp;sib=1<xsl:if test="string($ec) = '1'">&amp;ec=1</xsl:if>&amp;p.a=<xsl:value-of select="$p.a"/>&amp;p.sa=<xsl:value-of select="$p.sa"/>&amp;p.s=<xsl:value-of select="$p.s"/>&amp;p.c=<xsl:value-of select="$p.c"/></xsl:attribute>
    238241      <xsl:apply-templates select="." mode="displayNodeIcon"/>
    239242    </a>
    240       </td>
    241243     
    242244      <!-- Display associated title, bolded if the node has content -->
    243       <td valign="top">
     245      <span>
    244246    <xsl:choose>
    245247      <xsl:when test="nodeContent">
    246         <b><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></b>
     248        <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
    247249      </xsl:when>
    248250      <xsl:otherwise>
     
    250252      </xsl:otherwise>
    251253    </xsl:choose>
    252       </td>
    253     </tr>
     254      </span>
    254255    <!-- Apply recursively to the children of this node -->
    255256    <xsl:if test="documentNode[@nodeID]">
    256       <tr><td>&#160;</td><td><table>
    257         <xsl:apply-templates select="documentNode[@nodeID]">
     257       <xsl:apply-templates select="documentNode[@nodeID]">
    258258          <xsl:with-param name="collName" select="$collName"/>
    259259          <xsl:with-param name="ec" select="$ec"/>
     
    261261          <!--<xsl:with-param name="depth" select="$depth + 1"/>-->
    262262        </xsl:apply-templates>
    263       </table>
    264     </td></tr>
    265     </xsl:if>
     263     </xsl:if>
     264    </div>
    266265  </xsl:template>
    267266 
    268267  <!-- default content is to print the title and content of any documentNodes that have nodeContent -->
    269268  <xsl:template name="documentContent">
     269   <div class="documenttext">
    270270    <xsl:choose>
    271271      <xsl:when test="@docType='simple'">
     
    276276      </xsl:otherwise>
    277277    </xsl:choose>
     278  </div>
    278279  </xsl:template>
    279280 
     
    423424  <xsl:template name="documentArrows">
    424425    <xsl:param name="collName"/>
    425     <p>
     426    <div class="documentarrows">
     427       <xsl:call-template name="documentArrow">
     428        <xsl:with-param name="collName" select="$collName"/>
     429       <xsl:with-param name="direction">back</xsl:with-param>
     430     </xsl:call-template>
    426431    <xsl:call-template name="documentArrow">
    427432      <xsl:with-param name="collName" select="$collName"/>
    428       <xsl:with-param name="direction">back</xsl:with-param>
    429     </xsl:call-template>
    430     <xsl:call-template name="documentArrow">
    431       <xsl:with-param name="collName" select="$collName"/>
    432433      <xsl:with-param name="direction">forward</xsl:with-param>
    433434    </xsl:call-template>
    434     </p>
     435    </div>
     436   
    435437  </xsl:template>
    436438 
     
    439441    <xsl:param name="direction"/>
    440442    <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
    441     <a><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="$collName"/>&amp;d=<xsl:value-of select="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;sib=1&amp;p.s=<xsl:value-of select='$request-params/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='$request-params/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='$request-params/param[@name="p.a"]/@value'/></xsl:attribute><xsl:choose><xsl:when test="$direction='back'"><img src="interfaces/default/images/less.gif" border="0"/></xsl:when><xsl:otherwise><img src="interfaces/default/images/more.gif" border="0" align="right"/></xsl:otherwise></xsl:choose></a>
     443    <a><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="$collName"/>&amp;d=<xsl:value-of select="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;sib=1&amp;p.s=<xsl:value-of select='$request-params/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='$request-params/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='$request-params/param[@name="p.a"]/@value'/></xsl:attribute><xsl:choose><xsl:when test="$direction='back'"><img class="lessarrow" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow" src="interfaces/default/images/more.gif"  /></xsl:otherwise></xsl:choose></a>
    442444  </xsl:template>
    443445</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.