Debian Codegraph @

core/dplugins/generic/tools/htmlgallery/themes/snow/template.xsl

raw
1 <?xml version="1.0" encoding="UTF-8" ?>
2
3 <!--
4 * ============================================================
5 *
6 * This file is a part of digiKam project
7 * https://www.digikam.org
8 *
9 * Date : 2012-07-05
10 * Description : A Snow theme for the digiKam html gallery tool.
11 *
12 * SPDX-FileCopyrightText: 2012 by Aurélien Gâteau <aurelien dot gateau at free.fr>
13 *
14 * SPDX-License-Identifier: GPL-2.0-or-later
15 *
16 * ============================================================
17 -->
18
19 <!DOCTYPE stylesheet [
20 <!ENTITY raquo "&#187;">
21 ]>
22
23 <xsl:transform version="1.0"
24 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
25 xmlns:exsl="http://exslt.org/common"
26 extension-element-prefixes="exsl">
27
28 <xsl:template name="linkTagsImagePage">
29 <link rel="first" href="{../image[position()=1]/full/@fileName}.html"></link>
30 <link rel="last" href="{../image[position()=last()]/full/@fileName}.html"></link>
31 <xsl:if test="position() &gt; 1">
32 <link rel="prev" href="{preceding-sibling::image[position()=1]/full/@fileName}.html"></link>
33 </xsl:if>
34 <xsl:if test="position() &lt; last()">
35 <link rel="next" href="{following-sibling::image[position()=1]/full/@fileName}.html"></link>
36 </xsl:if>
37 <xsl:choose>
38 <xsl:when test="count(/collections/collection) &gt; 1">
39 <link rel="up" href="../{../fileName}.html"></link>
40 <link rel="top" href="../index.html"></link>
41 </xsl:when>
42 <xsl:otherwise>
43 <link rel="up" href="../index.html"></link>
44 </xsl:otherwise>
45 </xsl:choose>
46 </xsl:template>
47
48 <xsl:template name="linkTagsCollectionPage">
49 <xsl:if test="count(/collections/collection) &gt; 1">
50 <link rel="up" href="index.html"></link>
51 </xsl:if>
52 </xsl:template>
53
54 <xsl:template name="imagePage">
55 <html>
56 <head>
57 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
58 <title><xsl:value-of select="title"/></title>
59 <link rel="stylesheet" type="text/css" href="../snow/style.css"/>
60 <xsl:call-template name="linkTagsImagePage"/>
61 </head>
62 <body id="imagePage">
63 <h1>
64 <div id="previous">
65 <xsl:choose>
66 <xsl:when test="position() &gt; 1">
67 <a href="{preceding-sibling::image[position()=1]/full/@fileName}.html">
68 <img src="../snow/previous.png" alt="&lt;" title="{$i18nPrevious}" />
69 </a>
70 </xsl:when>
71 <xsl:otherwise>
72 <img src="../snow/previous_disabled.png" alt="&lt;" title="{$i18nPrevious}" />
73 </xsl:otherwise>
74 </xsl:choose>
75 </div>
76 <div id="next">
77 <xsl:choose>
78 <xsl:when test="position() &lt; last()">
79 <a href="{following-sibling::image[position()=1]/full/@fileName}.html">
80 <img src="../snow/next.png" alt="&gt;" title="{$i18nNext}" />
81 </a>
82 </xsl:when>
83 <xsl:otherwise>
84 <img src="../snow/next_disabled.png" alt="&gt;" title="{$i18nNext}" />
85 </xsl:otherwise>
86 </xsl:choose>
87 </div>
88 <div id="caption">
89 <xsl:choose>
90 <xsl:when test="count(/collections/collection) &gt; 1">
91 <a href="../index.html"><xsl:value-of select="$i18nCollectionList"/></a>
92 &raquo;
93 <a href="../{../fileName}.html"><xsl:value-of select="../name"/></a>
94 </xsl:when>
95 <xsl:otherwise>
96 <a href="../index.html"><xsl:value-of select="../name"/></a>
97 </xsl:otherwise>
98 </xsl:choose>
99
100 &raquo; <xsl:value-of select="title"/>
101 (<xsl:value-of select="position()"/>/<xsl:value-of select="last()"/>)
102 </div>
103 </h1>
104
105 <div id="content">
106 <img src="{full/@fileName}" width="{full/@width}" height="{full/@height}" />
107 <p>
108 <xsl:value-of select="description"/>
109 </p>
110 <xsl:if test="original/@fileName != ''">
111 <p>
112 <a href="{original/@fileName}"><xsl:value-of select="$i18nOriginalImage"/></a>
113 (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)
114 </p>
115 </xsl:if>
116 </div>
117 </body>
118 </html>
119 </xsl:template>
120
121
122 <xsl:template name="collectionPage">
123 <html>
124 <head>
125 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
126 <title><xsl:value-of select="name"/></title>
127 <link rel="stylesheet" type="text/css" href="snow/style.css"/>
128 <xsl:call-template name="linkTagsCollectionPage"/>
129 </head>
130 <body id="collectionPage">
131 <h1>
132 <xsl:if test="count(/collections/collection) &gt; 1">
133 <a href="index.html"><xsl:value-of select="$i18nCollectionList"/></a>
134 &raquo;
135 </xsl:if>
136 <xsl:value-of select="name"/>
137 </h1>
138 <div id="content">
139 <ul>
140 <xsl:variable name="folder" select='fileName'/>
141 <xsl:for-each select="image">
142 <li>
143 <a href='{$folder}/{full/@fileName}.html'>
144 <img src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}" />
145 </a>
146 <br/>
147 <a href='{$folder}/{full/@fileName}.html'>
148 <xsl:value-of select="title"/>
149 </a>
150 </li>
151 <exsl:document href='{$folder}/{full/@fileName}.html'>
152 <xsl:call-template name="imagePage"/>
153 </exsl:document>
154 </xsl:for-each>
155 </ul>
156 </div> <!-- /content -->
157 </body>
158 </html>
159 </xsl:template>
160
161
162 <xsl:template name="collectionListPage">
163 <html>
164 <head>
165 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
166 <title><xsl:value-of select="$i18nCollectionList"/></title>
167 <link rel="stylesheet" type="text/css" href="snow/style.css"/>
168 </head>
169 <body>
170 <h1><xsl:value-of select="$i18nCollectionList"/></h1>
171 <div id="content">
172 <ul>
173 <xsl:for-each select="collections/collection">
174 <xsl:sort select="name" order="ascending" data-type="text" />
175 <li>
176 <a href="{fileName}.html">
177 <!-- Use first image as collection image -->
178 <img src="{fileName}/{image[1]/thumbnail/@fileName}"
179 width="{image[1]/thumbnail/@width}"
180 height="{image[1]/thumbnail/@height}" />
181 <br />
182 <xsl:value-of select="name"/>
183 </a>
184 </li>
185 <exsl:document href="{fileName}.html">
186 <xsl:call-template name="collectionPage"/>
187 </exsl:document>
188 </xsl:for-each>
189 </ul>
190 </div> <!-- /content -->
191 </body>
192 </html>
193 </xsl:template>
194
195
196 <xsl:template match="/">
197 <xsl:choose>
198 <xsl:when test="count(collections/collection) &gt; 1">
199 <xsl:call-template name="collectionListPage"/>
200 </xsl:when>
201 <xsl:otherwise>
202 <xsl:for-each select="collections/collection">
203 <xsl:call-template name="collectionPage"/>
204 </xsl:for-each>
205 </xsl:otherwise>
206 </xsl:choose>
207 </xsl:template>
208
209
210 </xsl:transform>