Warning, /graphics/digikam/core/dplugins/generic/tools/htmlgallery/themes/classic/template.xsl is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" encoding="UTF-8" ?> 0002 0003 <!-- 0004 * ============================================================ 0005 * 0006 * This file is a part of digiKam project 0007 * https://www.digikam.org 0008 * 0009 * Date : 2007-07-05 0010 * Description : A classic theme for the digiKam html gallery tool. 0011 * 0012 * SPDX-FileCopyrightText: 2007 by Aurélien Gâteau <aurelien dot gateau at free.fr> 0013 * 0014 * SPDX-License-Identifier: GPL-2.0-or-later 0015 * 0016 * ============================================================ 0017 --> 0018 0019 <!DOCTYPE stylesheet [ 0020 <!ENTITY raquo "»"> 0021 ]> 0022 0023 <xsl:transform version="1.0" 0024 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 0025 xmlns:exsl="http://exslt.org/common" 0026 extension-element-prefixes="exsl"> 0027 0028 <xsl:template name="linkTagsImagePage"> 0029 <link rel="first" href="{../image[position()=1]/full/@fileName}.html"></link> 0030 <link rel="last" href="{../image[position()=last()]/full/@fileName}.html"></link> 0031 <xsl:if test="position() > 1"> 0032 <link rel="prev" href="{preceding-sibling::image[position()=1]/full/@fileName}.html"></link> 0033 </xsl:if> 0034 <xsl:if test="position() < last()"> 0035 <link rel="next" href="{following-sibling::image[position()=1]/full/@fileName}.html"></link> 0036 </xsl:if> 0037 <xsl:choose> 0038 <xsl:when test="count(/collections/collection) > 1"> 0039 <link rel="up" href="../{../fileName}.html"></link> 0040 <link rel="top" href="../index.html"></link> 0041 </xsl:when> 0042 <xsl:otherwise> 0043 <link rel="up" href="../index.html"></link> 0044 </xsl:otherwise> 0045 </xsl:choose> 0046 </xsl:template> 0047 0048 <xsl:template name="linkTagsCollectionPage"> 0049 <xsl:if test="count(/collections/collection) > 1"> 0050 <link rel="up" href="index.html"></link> 0051 </xsl:if> 0052 </xsl:template> 0053 0054 <xsl:template name="style"> 0055 <style type='text/css'> 0056 body { 0057 color: <xsl:value-of select="$fgColor"/>; 0058 background: <xsl:value-of select="$bgColor"/>; 0059 font-family: /*param*/Helvetica, sans-serif; 0060 font-size: <xsl:value-of select="$fontSize"/>pt; 0061 margin: 4%; 0062 } 0063 0064 h1 { 0065 color: <xsl:value-of select="$fgColor"/>; 0066 } 0067 0068 table { 0069 text-align: center; 0070 margin-left: auto; 0071 margin-right: auto; 0072 } 0073 0074 td { 0075 color: <xsl:value-of select="$fgColor"/>; 0076 padding: 1em; 0077 } 0078 0079 img.photo { 0080 border: <xsl:value-of select="$imgBorderSize"/>px solid <xsl:value-of select="$imgBorderColor"/>; 0081 } 0082 0083 a:link { 0084 color: <xsl:value-of select="$linkColor"/>; 0085 } 0086 0087 a:visited { 0088 color: <xsl:value-of select="$visitedLinkColor"/>; 0089 } 0090 </style> 0091 </xsl:template> 0092 0093 <xsl:template name="imagePage"> 0094 <xsl:param name="index" select="1"/> 0095 <html> 0096 <head> 0097 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 0098 <title><xsl:value-of select="title"/></title> 0099 <xsl:call-template name="style"/> 0100 <xsl:call-template name="linkTagsImagePage"/> 0101 </head> 0102 <body> 0103 <div align="center"> 0104 <xsl:if test="$index > 1"> 0105 <xsl:for-each select="../image[$index - 1]"> 0106 <a href="{full/@fileName}.html"> 0107 <img class="photo" src="{thumbnail/@fileName}" alt="{$i18nPrevious}" title="{$i18nPrevious}" height="{thumbnail/@width}" width="{thumbnail/@height}"/> 0108 </a> 0109 </xsl:for-each> 0110 | 0111 </xsl:if> 0112 0113 <xsl:choose> 0114 <xsl:when test="count(/collections/collection) > 1"> 0115 <a href="../{../fileName}.html"><img src="../classic/up.png" border="0" title="{../description}" alt="{../description}"/></a> 0116 | <a href="../index.html"><img src="../classic/gohome.png" border="0" alt="{$i18nCollectionList}" title="{$i18nCollectionList}"/></a> 0117 </xsl:when> 0118 <xsl:otherwise> 0119 <a href="../index.html"><img src="../classic/up.png" border="0" title="{$i18nCollectionList}" alt="{$i18nCollectionList}"/></a> 0120 </xsl:otherwise> 0121 </xsl:choose> 0122 0123 <xsl:if test="$index < count(../image)"> 0124 | 0125 <xsl:for-each select="../image[$index + 1]"> 0126 <a href="{full/@fileName}.html"> 0127 <img class="photo" src="{thumbnail/@fileName}" alt="{$i18nNext}" title="{$i18nNext}" height="{thumbnail/@width}" width="{thumbnail/@height}"/> 0128 </a> 0129 </xsl:for-each> 0130 </xsl:if> 0131 <br/> 0132 <hr/> 0133 <br/> 0134 <br/> 0135 <img class="photo" src="{full/@fileName}" width="{full/@width}" height="{full/@height}" alt="{description}" title="{description}"/> 0136 <xsl:if test="original/@fileName != ''"> 0137 <p> 0138 <a href="{original/@fileName}"><xsl:value-of select="$i18nOriginalImage"/></a> 0139 (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>) 0140 </p> 0141 </xsl:if> 0142 <!-- FIXME title="description, imageSize, fileSize" --> 0143 <br/> 0144 <br/> 0145 </div> 0146 <hr/> 0147 <!-- FIXME footer --> 0148 </body> 0149 </html> 0150 </xsl:template> 0151 0152 0153 <xsl:template name="collectionPage"> 0154 <html> 0155 <head> 0156 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 0157 <title><xsl:value-of select="name"/></title> 0158 <xsl:call-template name="style"/> 0159 <xsl:call-template name="linkTagsCollectionPage"/> 0160 </head> 0161 <body> 0162 <xsl:if test="count(/collections/collection) > 1"> 0163 <a href="index.html"><img src="classic/gohome.png" border="0" alt="{$i18nCollectionList}" title="{$i18nCollectionList}"/></a> 0164 </xsl:if> 0165 <h1>"<xsl:value-of select="name"/>"</h1> 0166 <!-- FIXME: Album info --> 0167 0168 <table> 0169 <xsl:call-template name="thumbnailTable"/> 0170 </table> 0171 <hr/> 0172 0173 <!-- FIXME: Footer --> 0174 </body> 0175 </html> 0176 </xsl:template> 0177 0178 0179 <!-- Called only once per table, use recursion to generate every row --> 0180 <xsl:template name="thumbnailTable"> 0181 <xsl:param name="index" select="1"/> 0182 0183 <xsl:if test="$index < count(image)+1"> 0184 <tr> 0185 <xsl:call-template name="thumbnailTableCell"> 0186 <xsl:with-param name="index" select="$index"/> 0187 <xsl:with-param name="counter" select="$index + $thumbnailPerRow - 1"/> 0188 </xsl:call-template> 0189 </tr> 0190 0191 <xsl:call-template name="thumbnailTable"> 0192 <xsl:with-param name="index" select="$index + $thumbnailPerRow"/> 0193 </xsl:call-template> 0194 </xsl:if> 0195 </xsl:template> 0196 0197 0198 <!-- Called for every cell, use recursion to generate every cell --> 0199 <xsl:template name="thumbnailTableCell"> 0200 <xsl:param name="index" select="1"/> 0201 <xsl:param name="counter" select="1"/> 0202 0203 <xsl:if test="$index < count(image) + 1"> 0204 <td align="center"> 0205 <xsl:variable name="folder" select='fileName'/> 0206 <xsl:for-each select="image[$index]"> 0207 <a href='{$folder}/{full/@fileName}.html'> 0208 <img class="photo" src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}" /> 0209 <div><xsl:value-of select="title"/></div> 0210 <!--FIXME image size and file size --> 0211 </a> 0212 0213 <exsl:document href='{$folder}/{full/@fileName}.html'> 0214 <xsl:call-template name="imagePage"> 0215 <xsl:with-param name="index" select="$index"/> 0216 </xsl:call-template> 0217 </exsl:document> 0218 </xsl:for-each> 0219 </td> 0220 0221 <xsl:if test="$counter > $index"> 0222 <xsl:call-template name="thumbnailTableCell"> 0223 <xsl:with-param name="index" select="$index + 1"/> 0224 <xsl:with-param name="counter" select="$counter"/> 0225 </xsl:call-template> 0226 </xsl:if> 0227 </xsl:if> 0228 </xsl:template> 0229 0230 0231 <xsl:template name="collectionListPage"> 0232 <html> 0233 <head> 0234 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 0235 <title><xsl:value-of select="$i18nCollectionList"/></title> 0236 <xsl:call-template name="style"/> 0237 </head> 0238 <body> 0239 <h1><xsl:value-of select="$i18nCollectionList"/></h1> 0240 <hr/> 0241 <p> 0242 0243 <xsl:for-each select="collections/collection"> 0244 <xsl:sort select="name" order="ascending" data-type="text" /> 0245 <xsl:variable name="title" select='concat(name, " [", count(image), "]")'/> 0246 <a href="{fileName}.html"> 0247 <!-- Use first image as collection image --> 0248 <img class="photo" 0249 src="{fileName}/{image[1]/thumbnail/@fileName}" 0250 width="{image[1]/thumbnail/@width}" 0251 height="{image[1]/thumbnail/@height}" 0252 alt="{$title}" 0253 title="{$title}"/> 0254 </a> 0255 <a href="{fileName}.html"><xsl:value-of select="$title"/></a> 0256 <br /> 0257 <exsl:document href="{fileName}.html"> 0258 <xsl:call-template name="collectionPage"/> 0259 </exsl:document> 0260 </xsl:for-each> 0261 0262 </p> 0263 <hr/> 0264 <!-- FIXME: Footer --> 0265 </body> 0266 </html> 0267 </xsl:template> 0268 0269 0270 <xsl:template match="/"> 0271 <xsl:choose> 0272 <xsl:when test="count(collections/collection) > 1"> 0273 <xsl:call-template name="collectionListPage"/> 0274 </xsl:when> 0275 <xsl:otherwise> 0276 <xsl:for-each select="collections/collection"> 0277 <xsl:call-template name="collectionPage"/> 0278 </xsl:for-each> 0279 </xsl:otherwise> 0280 </xsl:choose> 0281 </xsl:template> 0282 0283 0284 </xsl:transform>