Warning, /graphics/digikam/core/dplugins/generic/tools/htmlgallery/themes/matrix/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 : 2008-04-01
0010 * Description : A Matrix like theme for the digiKam html gallery tool.
0011 *
0012 * SPDX-FileCopyrightText: 2008 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="thumbnailLink">
0055 <xsl:param name="text"/>
0056 <xsl:param name="folder" select="'.'"/>
0057 <a class="imageLink" href="{$folder}/{full/@fileName}.html">
0058 <img src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}" />
0059 <br/>
0060 <xsl:value-of select="$text"/>
0061 </a>
0062 </xsl:template>
0063
0064 <xsl:template name="imagePage">
0065 <html>
0066 <head>
0067 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0068 <title><xsl:value-of select="title"/></title>
0069 <link rel="stylesheet" type="text/css" href="style.css"/>
0070 <xsl:call-template name="linkTagsImagePage"/>
0071 </head>
0072 <body id="imagePage">
0073 <h1>
0074 <div id="caption">
0075 <xsl:choose>
0076 <xsl:when test="count(/collections/collection) > 1">
0077 <a href="../index.html"><xsl:value-of select="$i18nCollectionList"/></a>
0078 »
0079 <a href="../{../fileName}.html"><xsl:value-of select="../name"/></a>
0080 </xsl:when>
0081 <xsl:otherwise>
0082 <a href="../index.html"><xsl:value-of select="../name"/></a>
0083 </xsl:otherwise>
0084 </xsl:choose>
0085 » <xsl:value-of select="title"/>
0086 (<xsl:value-of select="position()"/>/<xsl:value-of select="last()"/>)
0087 </div>
0088 </h1>
0089
0090 <div id="content">
0091 <div>
0092 <div id="previous">
0093 <xsl:choose>
0094 <xsl:when test="position() > 1">
0095 <xsl:for-each select="preceding-sibling::image[position()=1]">
0096 <xsl:call-template name="thumbnailLink">
0097 <xsl:with-param name="text">Previous</xsl:with-param>
0098 </xsl:call-template>
0099 </xsl:for-each>
0100 </xsl:when>
0101 <xsl:otherwise>
0102 <div class="endOfCollection">
0103 Previous
0104 </div>
0105 </xsl:otherwise>
0106 </xsl:choose>
0107 </div>
0108
0109 <div id="next">
0110 <xsl:choose>
0111 <xsl:when test="position() < last()">
0112 <xsl:for-each select="following-sibling::image[position()=1]">
0113 <xsl:call-template name="thumbnailLink">
0114 <xsl:with-param name="text">Next</xsl:with-param>
0115 </xsl:call-template>
0116 </xsl:for-each>
0117 </xsl:when>
0118 <xsl:otherwise>
0119 <div class="endOfCollection">
0120 Next
0121 </div>
0122 </xsl:otherwise>
0123 </xsl:choose>
0124 </div>
0125
0126 <div id="full">
0127 <img src="{full/@fileName}" width="{full/@width}" height="{full/@height}" />
0128 <p>
0129 <xsl:value-of select="description"/>
0130 </p>
0131 <xsl:if test="original/@fileName != ''">
0132 <p>
0133 <a href="{original/@fileName}"><xsl:value-of select="$i18nOriginalImage"/></a>
0134 (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)
0135 </p>
0136 </xsl:if>
0137 </div>
0138 <br style="clear:both"/>
0139 </div>
0140
0141 </div>
0142 </body>
0143 </html>
0144 </xsl:template>
0145
0146
0147 <xsl:template name="collectionPage">
0148 <html>
0149 <head>
0150 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0151 <title><xsl:value-of select="name"/></title>
0152 <link rel="stylesheet" type="text/css" href="matrix/style.css"/>
0153 <xsl:call-template name="linkTagsCollectionPage"/>
0154 </head>
0155 <body id="collectionPage">
0156 <h1>
0157 <xsl:if test="count(/collections/collection) > 1">
0158 <a href="index.html"><xsl:value-of select="$i18nCollectionList"/></a>
0159 »
0160 </xsl:if>
0161 <xsl:value-of select="name"/>
0162 </h1>
0163 <div id="content">
0164 <ul>
0165 <xsl:variable name="folder" select='fileName'/>
0166 <xsl:for-each select="image">
0167 <li>
0168 <xsl:call-template name="thumbnailLink">
0169 <xsl:with-param name="text"><xsl:value-of select="title"/></xsl:with-param>
0170 <xsl:with-param name="folder"><xsl:value-of select="$folder"/></xsl:with-param>
0171 </xsl:call-template>
0172 </li>
0173 <exsl:document href='{$folder}/{full/@fileName}.html'>
0174 <xsl:call-template name="imagePage"/>
0175 </exsl:document>
0176 </xsl:for-each>
0177 </ul>
0178 <br style="clear:both"/>
0179 </div> <!-- /content -->
0180 </body>
0181 </html>
0182 </xsl:template>
0183
0184
0185 <xsl:template name="collectionListPage">
0186 <html>
0187 <head>
0188 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
0189 <title><xsl:value-of select="$i18nCollectionList"/></title>
0190 <link rel="stylesheet" type="text/css" href="matrix/style.css"/>
0191 </head>
0192 <body>
0193 <h1><xsl:value-of select="$i18nCollectionList"/></h1>
0194 <div id="content">
0195 <ul>
0196 <xsl:for-each select="collections/collection">
0197 <xsl:sort select="name" order="ascending" data-type="text" />
0198 <li>
0199 <a href="{fileName}.html">
0200 <!-- Use first image as collection image -->
0201 <img src="{fileName}/{image[1]/thumbnail/@fileName}"
0202 width="{image[1]/thumbnail/@width}"
0203 height="{image[1]/thumbnail/@height}" />
0204 <br />
0205 <xsl:value-of select="name"/>
0206 </a>
0207 </li>
0208 <exsl:document href="{fileName}.html">
0209 <xsl:call-template name="collectionPage"/>
0210 </exsl:document>
0211 </xsl:for-each>
0212 </ul>
0213 </div> <!-- /content -->
0214 </body>
0215 </html>
0216 </xsl:template>
0217
0218
0219 <xsl:template match="/">
0220 <xsl:choose>
0221 <xsl:when test="count(collections/collection) > 1">
0222 <xsl:call-template name="collectionListPage"/>
0223 </xsl:when>
0224 <xsl:otherwise>
0225 <xsl:for-each select="collections/collection">
0226 <xsl:call-template name="collectionPage"/>
0227 </xsl:for-each>
0228 </xsl:otherwise>
0229 </xsl:choose>
0230 </xsl:template>
0231
0232
0233 </xsl:transform>