source: main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/transform/layouts/header.xsl@ 35091

Last change on this file since 35091 was 35091, checked in by davidb, 3 years ago

Added in so we can have LOD tabs on the right-hand side

  • Property svn:executable set to *
File size: 4.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8 extension-element-prefixes="java util"
9 exclude-result-prefixes="java util gsf">
10
11 <!-- ***** BROWSING TABS ***** -->
12 <xsl:template name="browsing-tabs">
13 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service or /page/pageResponse/collection[@name=$collNameChecked]/extraInfo/navigationTab">
14 <ul id="gs-nav">
15 <!-- if this collection has additional tabs, add them here -->
16 <xsl:call-template name="additionalNavTabs"/>
17 <!-- If this collection has a ClassifierBrowse service then add a tab for each classifier-->
18 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='browse' and @name='ClassifierBrowse']">
19 <!-- Loop through each classifier -->
20 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
21 <li>
22 <xsl:choose>
23 <!-- If this tab is selected then colour it differently -->
24 <xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)">
25 <xsl:attribute name='class'>ui-state-default ui-corner-top ui-tabs-selected ui-state-active</xsl:attribute>
26 </xsl:when>
27 <xsl:otherwise>
28 <xsl:attribute name='class'>ui-state-default ui-corner-top</xsl:attribute>
29 </xsl:otherwise>
30 </xsl:choose>
31
32 <a>
33 <!-- Add a title element to the <a> tag if a description exists for this classifier -->
34 <xsl:if test="displayItem[@name='description']">
35 <xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
36 </xsl:if>
37
38 <!-- Add the href element to the <a> tag -->
39 <xsl:choose>
40 <xsl:when test="@name">
41 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/<xsl:value-of select="@name"/></xsl:attribute>
42 </xsl:when>
43 <xsl:otherwise>
44 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/1</xsl:attribute>
45 </xsl:otherwise>
46 </xsl:choose>
47
48 <!-- Add the actual text of the <a> tag -->
49 <xsl:value-of select="displayItem[@name='name']"/>
50 </a>
51 </li>
52 </xsl:for-each>
53 </xsl:if>
54
55 <!-- PhindApplet. Need something similar for the Collage applet too, probably -->
56 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='PhindApplet']">
57 <li>
58 <xsl:choose>
59 <!-- If this tab is selected then colour it differently -->
60 <xsl:when test="/page/pageRequest[@action='a']">
61 <xsl:attribute name='class'>ui-state-default ui-corner-top ui-tabs-selected ui-state-active</xsl:attribute>
62 </xsl:when>
63 <xsl:otherwise>
64 <xsl:attribute name='class'>ui-state-default ui-corner-top</xsl:attribute>
65 </xsl:otherwise>
66 </xsl:choose>
67
68 <a>
69 <xsl:if test="displayItem[@name='description']">
70 <xsl:attribute name="title">
71 <xsl:value-of select="displayItem[@name='description']"/>
72 </xsl:attribute>
73 </xsl:if>
74 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=a&amp;rt=d&amp;s=<xsl:value-of select="@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
75 <xsl:value-of select="displayItem[@name='name']"/>
76 </a>
77 </li>
78 </xsl:for-each>
79
80 <!-- all other services -->
81 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[not(@type='query') and not(@type='browse') and not (@name='PhindApplet')]">
82 <xsl:call-template name="navigationTab"/>
83 </xsl:for-each>
84 </ul>
85
86 <xsl:call-template name="lodTabs"/>
87
88 <div style="clear:both;"><xsl:text> </xsl:text></div>
89 </xsl:if>
90 </xsl:template>
91
92 <xsl:template name="lodTabs">
93 <ul id="gs-lod">
94 <li class="ui-state-default ui-corner-top">
95 <a href="{$library_name}/collection/{$collName}/page/sparql">SPARQL</a>
96 </li>
97 <li class="ui-state-default ui-corner-top">
98 <a href="{$library_name}/collection/{$collName}/page/sgvizler">visualilzer</a>
99 </li>
100 </ul>
101 </xsl:template>
102</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.