Changeset 24791


Ignore:
Timestamp:
2011-10-25T10:31:59+13:00 (12 years ago)
Author:
sjm84
Message:

Better handling of paged-images, still needs more work though. Also added the db flag (rename) that will show all the metadata of the current document

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/oran/transform/pages/document.xsl

    r24650 r24791  
    100100           
    101101            <div id="doc{@nodeID}" class="sectionContainer" style="display:block;"><!-- *** -->
     102                <xsl:if test="/page/pageRequest/paramList/param[@name = 'db']/@value = 'true'">
     103                    <table id="meta{@nodeID}">
     104                        <xsl:for-each select="metadataList/metadata">
     105                            <tr>
     106                                <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
     107                                <td class="metaTableCellValue editable"><xsl:value-of select="."/></td>
     108                            </tr>
     109                        </xsl:for-each>
     110                    </table>
     111                </xsl:if>
    102112                <div id="text{@nodeID}" class="sectionText"><!-- *** -->
    103113                    <!-- Get the section content from the document template -->
     
    113123    <!-- the page content -->
    114124    <xsl:template match="/page/pageResponse/document">
     125        <xsl:if test="/page/pageRequest/paramList/param[@name = 'db']/@value = 'true'">
     126            <gsf:metadata name="all"/>
     127        </xsl:if>
     128
    115129        <xsl:if test="$bookswitch = 'off'">
    116130            <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
     
    131145            <!-- show the little berries for this document -->
    132146            <xsl:call-template name="documentBerryForDocumentPage"/>
    133 
    134             <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']) or /page/pageResponse/format[@type='display']/gsf:option[@name='sideBar']/@value='true'">
     147           
     148            <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='sideBar']) or /page/pageResponse/format[@type='display']/gsf:option[@name='sideBar']/@value='true'">
    135149                <table id="rightSidebar">
    136150                    <tr><td>
     
    139153                    <tr><td>
    140154                        <div id="contentsArea">
    141 
    142155                            <!-- show the berry basket if it's turned on -->
    143156                            <gslib:berryBasket/>
    144157
    145158                            <!-- the book's cover image -->
    146                             <xsl:choose>
    147                                 <xsl:when test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']) or /page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true'">
    148                                     <div id="coverImage" class="visible"><gslib:coverImage/></div>
    149                                 </xsl:when>
    150                                 <xsl:otherwise>
    151                                     <div id="coverImage" class="hidden"><gslib:coverImage/></div>
    152                                 </xsl:otherwise>   
    153                             </xsl:choose>
     159                            <div id="coverImage">
     160                                <xsl:attribute name="class">
     161                                    <xsl:choose>
     162                                        <xsl:when test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']) or /page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true'">visible</xsl:when>
     163                                        <xsl:otherwise>hidden</xsl:otherwise>   
     164                                    </xsl:choose>
     165                                </xsl:attribute>
     166                                <gslib:coverImage/><xsl:text> </xsl:text>
     167                            </div>
    154168
    155169                            <!-- the contents (if enabled) -->
    156                             <xsl:choose>
    157                                 <xsl:when test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">
    158                                     <div id="tableOfContents" class="visible">
    159                                         <xsl:apply-templates select="documentNode" mode="TOC"/>
    160                                     </div>
    161                                 </xsl:when>   
    162                                 <xsl:otherwise>
    163                                     <div id="tableOfContents" class="hidden">
    164                                         <xsl:apply-templates select="documentNode" mode="TOC"/>
    165                                     </div>
    166                                 </xsl:otherwise>   
    167                             </xsl:choose>
     170                            <div id="tableOfContents">
     171                                <xsl:attribute name="class">
     172                                    <xsl:choose>
     173                                        <xsl:when test="count(//documentNode) > 1 and not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">visible</xsl:when>
     174                                        <xsl:otherwise>hidden</xsl:otherwise>
     175                                    </xsl:choose>
     176                                </xsl:attribute>
     177                                <xsl:apply-templates select="documentNode" mode="TOC"/>
     178                            </div>
    168179                        </div>
    169180                    </td></tr>
     
    183194            </xsl:when>
    184195            <xsl:when test="$bookswitch = 'on'">
    185                 <!-- *** in document-scripts.xsl *** -->
    186196                <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
     197                <!-- *** in document-scripts.js *** -->
    187198                <script type="text/javascript">
    188199                    <xsl:text disable-output-escaping="yes">
     
    195206            </xsl:when>
    196207            <xsl:otherwise>
    197                 <div id="gs-document-text" class="documenttext">
    198                     <xsl:call-template name="wrapDocumentNodes"/>
    199                 </div> 
     208                <table><tbody><tr><td>
     209                    <div id="gs-document-image" class="sectionImage">
     210                        <!-- Get the section content from the document template -->
     211                        <xsl:call-template name="documentImage"/>
     212                    </div>
     213                </td>
     214                <td>
     215                    <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
     216                        <xsl:call-template name="wrapDocumentNodes"/>
     217                    </div>
     218                </td></tr></tbody></table>
     219
    200220            </xsl:otherwise>
    201221        </xsl:choose>
    202 
     222       
    203223        <div class="clear"><xsl:text> </xsl:text></div>
    204224    </xsl:template>
     
    251271            </xsl:for-each>
    252272        </xsl:for-each><xsl:text> </xsl:text>
     273    </xsl:template>
     274   
     275    <!-- The default template for displaying the document image -->
     276    <xsl:template name="documentImage">
     277        <xsl:variable name="imageTest"><gsf:metadata name="ScreenWidth"/></xsl:variable>
     278        <xsl:if test="$imageTest != ''">
     279            <h3>   
     280                <gsf:choose-metadata>
     281                    <gsf:metadata name="dc.Title"/>
     282                    <gsf:metadata name="ex.Title"/>
     283                    <gsf:default>Untitled</gsf:default>
     284                </gsf:choose-metadata>
     285            </h3>
     286            <gsf:metadata name="screenicon"/>
     287        </xsl:if>
    253288    </xsl:template>
    254289
     
    402437                </td>
    403438            </xsl:if>
     439            <td class="tableOfContentsTitle">Table of Contents</td>
    404440            <td style="vertical-align:top;">
    405441                <a id="sidebarMinimizeButton" href="javascript:minimizeSidebar();" style="float: right; font-size:0.6em;">
Note: See TracChangeset for help on using the changeset viewer.