Changeset 25001 for main/trunk


Ignore:
Timestamp:
2012-01-26T14:19:06+13:00 (12 years ago)
Author:
sjm84
Message:

Some major changes to the header to make it work with the new visual style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/oran/transform/layouts/header.xsl

    r24907 r25001  
    44    xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
    55    xmlns:gslib="http://www.greenstone.org/skinning"
     6    xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
    67    extension-element-prefixes="java util"
    7     exclude-result-prefixes="java util">
     8    exclude-result-prefixes="java util gsf">
    89       
    910    <xsl:include href="../query-common.xsl"/>
     
    2526    <xsl:template name="create-html-header">
    2627        <title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
     28        <link rel="stylesheet" href="interfaces/{$interface_name}/style/jquery-ui-1.8.16.custom.css" type="text/css"/>
    2729        <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
    2830        <link rel="shortcut icon" href="favicon.ico"/>
    29         <!--<script type="text/javascript" src="interfaces/{$interface_name}/js/direct-edit.js"><xsl:text> </xsl:text></script>-->
    30        
     31       
     32        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"><xsl:text> </xsl:text></script>
     33        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"><xsl:text> </xsl:text></script>
     34        <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.themeswitcher.min.js"><xsl:text> </xsl:text></script>
     35       
     36        <script type="text/javascript" src="interfaces/{$interface_name}/js/direct-edit.js"><xsl:text> </xsl:text></script>
     37       
     38        <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
     39            <xsl:call-template name="map-scripts"/>
     40        </xsl:if>
    3141        <!--<xsl:call-template name="init-seaweed"/>-->
    3242        <xsl:call-template name="setup-gs-variable"/>
     
    3747        <!-- This template should be overridden in the collectionConfig.xml file if you want to add extra header content -->
    3848    </xsl:template>
    39        
     49   
    4050    <xsl:template name="init-seaweed">
    4151        <script type="text/javascript">
     
    4555                        de.init();
    4656
    47                             de.doc.declarePropertySets({
    48                                 metadata: {
    49                                     phMarkup: '[Enter metadata value]',
    50                                     name: "metadata"
    51                                 }
    52                             });
     57                        de.doc.declarePropertySets({
     58                            metadata: {
     59                                phMarkup: '[Enter metadata value]',
     60                                name: "metadata"
     61                            }
     62                        });
    5363                    }
    5464                    catch (err) {
    55                         //alert("Seaweed failed to initialise: " + err.message);
     65                        alert("Seaweed failed to initialise: " + err.message);
    5666                    }
    5767                });
     
    6171       
    6272    <!-- ***** HEADER LAYOUT TEMPLATE ***** -->
    63     <xsl:template name="create-banner">
    64         <div id="breadcrumbs"><xsl:call-template name="breadcrumbs"/><xsl:text> </xsl:text></div>
    65         <table id="titlesearchcontainer">
    66             <tr>
    67                 <xsl:call-template name="page-title-area"/>
    68                 <xsl:call-template name="quick-search-area"/>
    69             </tr>
    70         </table>
    71         <xsl:call-template name="home-help-preferences"/>
    72         <xsl:call-template name="browsing-tabs"/>
     73    <xsl:template name="create-banner">     
     74        <div id="gs_banner" class="ui-widget-header ui-corner-bottom">
     75            <table id="titlesearchcontainer">
     76                <tr>
     77                    <xsl:call-template name="page-title-area"/>
     78                    <xsl:call-template name="quick-search-area"/>
     79                </tr>
     80            </table>
     81            <xsl:call-template name="browsing-tabs"/>
     82        </div>
    7383    </xsl:template>
    7484   
     
    8191                    <!-- Loop through each classifier -->
    8292                    <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
    83                         <xsl:element name="li">
    84                             <!-- If this tab is selected then colour it differently (right part) -->
    85                             <xsl:if test="@name = /page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value">
    86                                 <xsl:attribute name='style'>background: transparent url('interfaces/oran/images/tab-right-selected.png') scroll no-repeat 100% -100px;</xsl:attribute>
    87                             </xsl:if>
     93                        <li>
     94                            <xsl:choose>
     95                                <!-- If this tab is selected then colour it differently -->
     96                                <xsl:when test="@name = /page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value">
     97                                    <xsl:attribute name='class'>ui-state-default ui-corner-top ui-tabs-selected ui-state-active</xsl:attribute>
     98                                </xsl:when>
     99                                <xsl:otherwise>
     100                                    <xsl:attribute name='class'>ui-state-default ui-corner-top</xsl:attribute>
     101                                </xsl:otherwise>
     102                            </xsl:choose>
    88103                           
    89                             <xsl:element name="a">
    90                                 <!-- If this tab is selected then colour it differently (left part) -->
    91                                 <xsl:if test="@name = /page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value">
    92                                     <xsl:attribute name='style'>background: transparent url('interfaces/oran/images/tab-left-selected.png') no-repeat scroll 0 -100px;</xsl:attribute>
    93                                 </xsl:if>
    94                                
     104                            <a>
    95105                                <!-- Add a title element to the <a> tag if a description exists for this classifier -->
    96106                                <xsl:if test="displayItem[@name='description']">
     
    110120                                <!-- Add the actual text of the <a> tag -->
    111121                                <xsl:value-of select="displayItem[@name='name']"/>
    112                             </xsl:element>
    113                         </xsl:element>
     122                            </a>
     123                        </li>
    114124                    </xsl:for-each>
    115125                </xsl:if>
     
    123133    </xsl:template>
    124134   
    125     <!-- ***** HOME HELP PREFERENCES ***** -->
     135    <!-- ***** HOME HELP PREFERENCES LOGIN ***** -->
    126136    <xsl:template name="home-help-preferences">
    127137        <xsl:if test="/page/pageResponse/collection">
    128138            <ul id="bannerLinks">
    129 
    130139                <!-- preferences -->
    131                 <li>
     140                <li class="ui-state-default ui-corner-all">
    132141                    <a href="{$library_name}?a=p&amp;amp;sa=pref&amp;amp;c={$collNameChecked}">
    133142                        <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
    134                         <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
     143                        <ul>
     144                            <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></span></li>
     145                            <li><span class="ui-icon ui-icon-wrench"><xsl:text> </xsl:text></span></li>
     146                        </ul>
    135147                    </a>
    136148                </li>
    137149
    138150                <!-- help -->
    139                 <li>
     151                <li class="ui-state-default ui-corner-all">
    140152                    <a href="{$library_name}?a=p&amp;amp;sa=help&amp;amp;c={$collNameChecked}">
    141153                        <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
    142                         <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
     154                        <ul>
     155                            <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></span></li>
     156                            <li><span class="ui-icon ui-icon-help"><xsl:text> </xsl:text></span></li>
     157                        </ul>
    143158                    </a>
    144159                </li>
    145160
    146161                <!-- home -->
    147                 <li>
     162                <li class="ui-state-default ui-corner-all">
    148163                    <a href="{$library_name}?a=p&amp;amp;sa=home">
    149164                        <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
    150                         <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
     165                        <ul>
     166                            <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></span></li>
     167                            <li><span class="ui-icon ui-icon-home"><xsl:text> </xsl:text></span></li>
     168                        </ul>
    151169                    </a>
     170                </li>
     171               
     172                <!-- login -->
     173                <li class="ui-state-default ui-corner-all">
     174                    <xsl:choose>
     175                        <xsl:when test="/page/pageResponse/authenticationNode/service/@asn = '1'">
     176                            <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login">
     177                                <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'logout_tip')"/></xsl:attribute>
     178                                <ul>
     179                                    <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'logout_b')"/></span></li>
     180                                    <li><span class="ui-icon ui-icon-unlocked"><xsl:text> </xsl:text></span></li>
     181                                </ul>
     182                            </a>
     183                        </xsl:when>
     184                        <xsl:otherwise>
     185                            <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login">
     186                                <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/></xsl:attribute>
     187                                <ul>
     188                                    <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_b')"/></span></li>
     189                                    <li><span class="ui-icon ui-icon-locked"><xsl:text> </xsl:text></span></li>
     190                                </ul>
     191                            </a>
     192                        </xsl:otherwise>
     193                    </xsl:choose>
    152194                </li>
    153195            </ul>
     
    164206                    <xsl:choose>
    165207                        <xsl:when test="string-length($pageTitleVar) &lt; 20">
    166                             <xsl:text>font-size: 1.5em; line-height: 1.5em;</xsl:text>
     208                            <xsl:text>font-size: 1.5em;</xsl:text>
    167209                        </xsl:when>
    168210                        <xsl:when test="string-length($pageTitleVar) &lt; 30">
    169                             <xsl:text>font-size: 1.4em; line-height: 1.4em;</xsl:text>
     211                            <xsl:text>font-size: 1.4em;</xsl:text>
    170212                        </xsl:when>
    171213                        <xsl:when test="string-length($pageTitleVar) &lt; 40">
    172                             <xsl:text>font-size: 1.3em; line-height: 1.3em;</xsl:text>
     214                            <xsl:text>font-size: 1.3em;</xsl:text>
    173215                        </xsl:when>
    174216                        <xsl:when test="string-length($pageTitleVar) &lt; 50">
    175                             <xsl:text>font-size: 1.2em; line-height: 1.2em;</xsl:text>
     217                            <xsl:text>font-size: 1.2em;</xsl:text>
    176218                        </xsl:when>
    177219                        <xsl:when test="string-length($pageTitleVar) &lt; 60">
    178                             <xsl:text>font-size: 1.1em; line-height: 1.2em;</xsl:text>
     220                            <xsl:text>font-size: 1.1em;</xsl:text>
    179221                        </xsl:when>
    180222                        <xsl:when test="string-length($pageTitleVar) &lt; 70">
    181                             <xsl:text>font-size: 1em; line-height: 1.1em;</xsl:text>
     223                            <xsl:text>font-size: 1em;</xsl:text>
    182224                        </xsl:when>
    183225                        <xsl:when test="string-length($pageTitleVar) &lt; 80">
    184                             <xsl:text>font-size: 0.9em; line-height: 1em;</xsl:text>
     226                            <xsl:text>font-size: 0.9em;</xsl:text>
    185227                        </xsl:when>
    186228                        <xsl:when test="string-length($pageTitleVar) &lt; 90">
    187                             <xsl:text>font-size: 0.8em; line-height: 0.9em;</xsl:text>
     229                            <xsl:text>font-size: 0.8em;</xsl:text>
    188230                        </xsl:when>
    189231                        <xsl:otherwise>
    190                             <xsl:text>font-size: 0.7em; line-height: 0.9em;</xsl:text>
     232                            <xsl:text>font-size: 0.7em;</xsl:text>
    191233                        </xsl:otherwise>
    192234                    </xsl:choose>
     
    233275                    </xsl:if>
    234276                    <!-- The submit button -->
    235                     <input type="submit">
     277                    <input type="submit" id="quickSearchSubmitButton">
    236278                        <xsl:attribute name="value">
    237279                            <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
     
    240282                    <br/>
    241283                    <!-- The list of other search types -->
    242                     <table>
    243                         <tr>
    244                             <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
    245                                 <td>
    246                                     <a>
    247                                         <xsl:attribute name="href">
    248                                             <xsl:value-of select="$library_name"/>?a=q&amp;rt=d&amp;c=<xsl:value-of select="$collNameChecked"/>&amp;s=<xsl:value-of select="@name"/>
    249                                         </xsl:attribute>
    250                                         <xsl:value-of select="displayItem[@name='name']"/>
    251                                     </a>
    252                                 </td>
    253                             </xsl:for-each>
    254                         </tr>
    255                     </table>
     284                    <ul>
     285                        <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
     286                            <li class="ui-state-default ui-corner-all">
     287                                <a>
     288                                    <xsl:attribute name="href">
     289                                        <xsl:value-of select="$library_name"/>?a=q&amp;rt=d&amp;c=<xsl:value-of select="$collNameChecked"/>&amp;s=<xsl:value-of select="@name"/>
     290                                    </xsl:attribute>
     291                                    <xsl:value-of select="displayItem[@name='name']"/>
     292                                </a>
     293                            </li>
     294                        </xsl:for-each>
     295                    </ul>
    256296                </form>
    257297            </td>
    258298        </xsl:if>
    259299    </xsl:template>
     300   
     301    <xsl:template name="map-scripts">
     302        <meta content="initial-scale=1.0, user-scalable=no" name="viewport"/>
     303        <script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"><xsl:text> </xsl:text></script>
     304        <script src="sites/localsite/collect/tipple-paradise-gardens/js/map-scripts.js" type="text/javascript"><xsl:text> </xsl:text></script>
     305        <script type="text/javascript">$(window).load(initializeMapScripts);</script>
     306    </xsl:template>
    260307</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.