source: main/trunk/model-interfaces-dev/opotiki/transform/pages/home.xsl@ 34269

Last change on this file since 34269 was 34269, checked in by ak19, 4 years ago

Also updating the temporary opotiki interface's home page's display of coll descr to support html.

File size: 9.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
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 extension-element-prefixes="java util"
8 exclude-result-prefixes="java util">
9
10 <xsl:variable name="groupPath"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/></xsl:variable>
11
12 <!-- use the 'main' layout -->
13 <!--<xsl:include href="layouts/main.xsl"/>-->
14
15 <!-- set page title -->
16 <xsl:template name="pageTitle"><xsl:choose><xsl:when test="$groupPath != ''"><gslib:groupName path="{$groupPath}"/></xsl:when><xsl:otherwise><gslib:siteName/></xsl:otherwise></xsl:choose></xsl:template>
17
18 <!-- set page breadcrumbs -->
19 <xsl:template name="breadcrumbs">
20 <xsl:if test="$groupPath != ''">
21 <gslib:siteLink/>
22 <xsl:for-each select="/page/pageResponse/pathList/group">
23 <xsl:sort data-type="number" select="@position"/>
24 <gslib:rightArrow/>
25 <xsl:if test="position() != last()">
26 <!-- don't want the current group in the breadcrumbs -->
27 <a>
28 <xsl:attribute name="href"><gslib:groupHref path="{@path}"/></xsl:attribute>
29 <xsl:attribute name="title"><gslib:groupName path="{@path}"/></xsl:attribute>
30 <gslib:groupName path="{@path}"/>
31 </a>
32 </xsl:if>
33 </xsl:for-each>
34 </xsl:if>
35 </xsl:template>
36
37 <!-- the page content -->
38 <xsl:template match="/page/pageResponse">
39 <!--<h2><gslib:selectACollectionTextBar/></h2>-->
40
41
42 <div class="content">
43 <!--
44 <xsl:for-each select="./collectionList/collection">
45 <xsl:variable name="collectionFolder" select="@name"/>
46 <xsl:variable name="homeImage">
47 <xsl:choose>
48 <xsl:when test="displayItem[@name='smallicon']">
49 sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="$collectionFolder"/>/images/<xsl:value-of select="displayItem[@name='smallicon']"/>
50 </xsl:when>
51 <xsl:otherwise>
52 interfaces/<xsl:value-of select="$interface_name"/>/images/default.jpg
53 </xsl:otherwise>
54 </xsl:choose>
55 </xsl:variable>
56
57
58 </xsl:for-each>
59 -->
60 <img src="interfaces/perrin/images/default.jpg" alt="" />
61 </div>
62 <div class="column">
63 <ul class="latestnews">
64 <li>
65 <p><strong><a href="#">Highlighted Item 1</a></strong><br/>This is a place where you can put information about an item you would like to highlight in your collection, with or without an accompanying image.</p>
66 </li>
67 <li>
68 <p><strong><a href="#">Highlighted Item 2</a></strong><br/>This is a place where you can put information about an item you would like to highlight in your collection,with or without an accompanying image.</p>
69 </li>
70
71 </ul>
72 </div>
73 <br class="clear" />
74 <div id="hpage_cats">
75 <xsl:call-template name="collectionAndGroupLinks"/>
76 <!--<xsl:call-template name="collectionsList"/>-->
77 </div>
78 </xsl:template>
79
80
81 <xsl:template name="additionalHeaderContent">
82 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.easing.1.3.js"><xsl:text> </xsl:text></script>
83 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.timers.1.2.js"><xsl:text> </xsl:text></script>
84 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.2.1.1.min.js"><xsl:text> </xsl:text></script>
85 <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.setup.js"><xsl:text> </xsl:text></script>
86 </xsl:template>
87
88 <xsl:template name="collectionsList">
89 <!-- for every collection in the library -->
90 <xsl:for-each select="./collectionList/collection">
91 <xsl:call-template name="collDescription"/>
92 </xsl:for-each>
93 </xsl:template>
94
95 <xsl:template name="collDescription">
96 <xsl:variable name="collectionFolder" select="@name"/>
97 <xsl:variable name="collectionName" select="displayItemList/displayItem[@name='name']"/>
98 <xsl:variable name="aboutImage" select="displayItemList/displayItem[@name='icon']"/>
99 <xsl:variable name="homeImage" select="displayItemList/displayItem[@name='smallicon']"/>
100 <xsl:variable name="collDesc" select="displayItemList/displayItem[@name='description']"/>
101 <xsl:variable name="numDocs" select="metadataList/metadata[@name='numDocs']"/>
102 <!-- creates a header that links to the collection's about page -->
103 <h2><a href="{$library_name}/collection/{$collectionFolder}/page/about"><xsl:value-of select="$collectionName"/></a></h2>
104 <!-- if there is an About page image for the collection, this is displayed -->
105 <xsl:if test="$homeImage">
106 <img src="sites/{$site_name}/collect/{$collectionFolder}/images/{$homeImage}" alt="{$collectionName}" />
107 </xsl:if>
108
109 <xsl:choose>
110 <!-- has a description - display it -->
111 <xsl:when test="$collDesc">
112 <p class="justify"><!--<xsl:value-of select="$collDesc" disable-output-escaping="yes"/>--><xsl:apply-templates select="displayItemList/displayItem[@name='description']"/></p>
113 </xsl:when>
114 <!-- no description - a generic sentence -->
115 <xsl:otherwise>
116 <p class="justify">Welcome to the <xsl:value-of select="$collectionName"/> collection. This collection contains <xsl:value-of select="$numDocs"/> documents.</p>
117 </xsl:otherwise>
118 </xsl:choose>
119 </xsl:template>
120
121 <xsl:template name="collectionAndGroupLinks">
122 <xsl:for-each select="collectionList/collection|groupList/group">
123 <xsl:sort data-type="number" select="@position"/>
124 <xsl:if test="name() = 'collection'">
125 <xsl:call-template name="collDescription"/>
126 <!--<xsl:call-template name="collectionLinkWithImage2"/>-->
127 <!--<gslib:collectionLinkWithImage/>-->
128 </xsl:if>
129 <xsl:if test="name() = 'group'">
130 <xsl:call-template name="customGroupDescription"/>
131 <!--<gslib:groupLinkWithImage/>-->
132 </xsl:if>
133 </xsl:for-each>
134
135 </xsl:template>
136 <xsl:template match="/page/xsltparams">
137 <!-- suppress xsltparam block in page -->
138 </xsl:template>
139
140 <!-- Modified version of <gslib:groupLinkWithImage/>-->
141 <xsl:template name="customGroupDescription">
142 <xsl:variable name="short"><xsl:value-of select="shortDescription"/></xsl:variable>
143 <xsl:variable name="desc"><xsl:value-of select="description"/></xsl:variable>
144 <xsl:variable name="group_href"><xsl:value-of select="$library_name"/>/group/<xsl:if test="/page/pageRequest/paramList/param[@name='group']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/>/</xsl:if><xsl:value-of select="@name"/></xsl:variable>
145
146 <!-- creates a header that links to the collection's about page -->
147 <!--group: <xsl:value-of select="@name"/>-->
148 <h2>
149 <a href="{$group_href}" title="{$short}">
150 <xsl:choose>
151 <xsl:when test="boolean(title)">
152 <xsl:value-of select="title"/>
153 </xsl:when>
154 <xsl:otherwise>
155 <xsl:value-of select="@name"/>
156 </xsl:otherwise>
157 </xsl:choose>
158 </a>
159 </h2>
160
161 <!-- if there is an image for this group, this is displayed -->
162 <xsl:choose>
163 <xsl:when test="util:checkFileExistence($site_name, backgroundImage)">
164 <img class="groupLinkImage">
165 <xsl:attribute name="alt"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:attribute>
166 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/<xsl:value-of select="backgroundImage"/></xsl:attribute>
167 </img>
168 </xsl:when>
169 </xsl:choose>
170
171 <xsl:choose>
172 <!-- If the group has a description - display it -->
173 <xsl:when test="$desc">
174 <p class="justify"><xsl:value-of select="$desc" disable-output-escaping="yes"/></p>
175 </xsl:when>
176 <!-- If no group description - repeat group name -->
177 <xsl:otherwise>
178 <p class="justify">Collection group: <xsl:value-of select="@name" disable-output-escaping="yes"/></p>
179 </xsl:otherwise>
180 </xsl:choose>
181 </xsl:template>
182
183 <!-- Copied from <gslib:collectionLinkWithImage/>. Not used.
184 See Jenny's template for collDescription.
185 The coll_href var may become important if something doesn't work in existing
186 collDescription.
187 For now though, there is no /page/pageRequest/paramList/param name=group
188 -->
189 <!--
190 <xsl:template name="collDescription">
191 <xsl:variable name="desc"><xsl:value-of select="displayItemList/displayItem[@name='shortDescription']"/></xsl:variable>
192 <xsl:variable name="coll_href"><xsl:value-of select="$library_name"/>/collection/<xsl:if test="/page/pageRequest/paramList/param[@name='group']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/>/</xsl:if><xsl:value-of select="@name"/>/page/about<xsl:choose><xsl:when test="libraryParamList/param">?<xsl:for-each select="libraryParamList/param"><xsl:value-of select="@name"/>=<xsl:value-of select="@default"/>&amp;</xsl:for-each></xsl:when></xsl:choose></xsl:variable>
193 <xsl:choose>
194 <xsl:when test="displayItemList/displayItem[@name='smallicon']">
195 <a href="{$coll_href}" title="{$desc}">
196 <img class="collectionLinkImage">
197 <xsl:attribute name="alt"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:attribute>
198 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="displayItemList/displayItem[@name='smallicon']"/></xsl:attribute>
199 </img>
200 </a>
201 </xsl:when>
202 <xsl:otherwise>
203 <a href="{$coll_href}" title="{$desc}">
204 <div class="collectionLink ui-corner-all">
205 <div class="collectionLinkText ui-widget-content ui-corner-top">
206 <xsl:choose><xsl:when test="displayItemList/displayItem[@name='name']"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:when>
207 <xsl:otherwise>
208 <xsl:value-of select="@name"/>
209 </xsl:otherwise>
210 </xsl:choose>
211
212 </div>
213 <div style="height:15px;" class="ui-state-default ui-corner-bottom"><xsl:text> </xsl:text></div>
214 </div>
215 </a>
216 </xsl:otherwise>
217 </xsl:choose>
218 </xsl:template>
219 -->
220</xsl:stylesheet>
221
222
Note: See TracBrowser for help on using the repository browser.