[Kde-imaging] Dateframes Theme

Wojciech Jarosz wjarosz at ucsd.edu
Mon Jul 23 21:23:38 CEST 2007


This sounds really interesting! I've wanted to get access to more
metadata about the images when writing my HTMLExport theme. Would it
be possible to also add a data field for each collection? This would
allow the theme to sort the collection lists page by date. You could
probably come up with some xslt to compute an average or minimum data
for each collection, but an explicit date would make things easier.

thanks,
-w

On 7/22/07, Robert M. Marmorstein <rmmarm at sdf.lonestar.org> wrote:
> Hey all,
>
> Awhile ago Beth and I started working on a new htmlexport theme that
> would print dates underneath the pictures.  It required some patches to
> "generator.cpp" and we had some trouble getting localization working.  I
> think we've got something that works now -- it allows you to customize
> the date format to suit your particular country/locale.
>
> Attached are the patches (including the new theme).  Sorry to take so
> long with these -- we are moving so that I can start a new job and
> haven't had much time for hacking.
>
> Please let me know if anything else needs to be done to make these useful,
>
> Robert
>
> diff -Naur htmlexport.old/generator.cpp htmlexport/generator.cpp
> --- htmlexport.old/generator.cpp        2007-07-22 17:45:57.000000000 -0400
> +++ htmlexport/generator.cpp    2007-07-22 17:46:54.000000000 -0400
> @@ -310,6 +310,7 @@
>                 XMLElement imageX(xmlWriter, "image");
>                 xmlWriter.writeElement("title", info.title());
>                 xmlWriter.writeElement("description", info.description());
> +               xmlWriter.writeElement("date", info.time().toString("yyyy-MM-ddThh:mm:ss"));
>
>                 appendImageElementToXML(xmlWriter, "full", fullFileName, fullImage);
>                 appendImageElementToXML(xmlWriter, "thumbnail", thumbnailFileName, thumbnail);
> @@ -346,6 +347,7 @@
>                         XMLElement collectionX(xmlWriter, "collection");
>                         xmlWriter.writeElement("name", collection.name());
>                         xmlWriter.writeElement("fileName", collectionFileName);
> +                       xmlWriter.writeElement("comment", collection.comment());
>
>                         // Loop on image in collection
>                         KURL::List imageList = collection.images();
> diff -Naur htmlexport.old/themes/dateframes/dateframes.desktop htmlexport/themes/dateframes/dateframes.desktop
> --- htmlexport.old/themes/dateframes/dateframes.desktop 1969-12-31 19:00:00.000000000 -0500
> +++ htmlexport/themes/dateframes/dateframes.desktop     2007-07-22 17:47:25.000000000 -0400
> @@ -0,0 +1,39 @@
> +[Desktop Entry]
> +Name=Date Frames
> +Comment=A frame theme based on Ruediger Bente's frame theme
> +
> +[X-HTMLExport Author]
> +Name=Elizabeth Marmorstein
> +Url=mailto:purplegamba at cox.net
> +
> +[X-HTMLExport Parameter color1]
> +Name=Thumbnail Background
> +Type=color
> +Default=#FFFFFF
> +
> +[X-HTMLExport Parameter color2]
> +Name=Image Background (contrasting)
> +Type=color
> +Default=#000055
> +
> +[X-HTMLExport Parameter color3]
> +Name=Nav Bar Background (dark)
> +Type=color
> +Default=#000011
> +
> +[X-HTMLExport Parameter intro]
> +Name=Gallery Introduction
> +Type=string
> +Default=Welcome to my web gallery!
> +
> +[X-HTMLExport Parameter longformat]
> +Name=Caption Date Format (see http://xsltsl.sourceforge.net/date-time.html)
> +Type=string
> +Default=%A, %b %e, %Y   %i:%M%P
> +Comment=XSL Date Format String: Use the syntax given at http://xsltsl.sourceforge.net/date-time.html
> +
> +[X-HTMLExport Parameter shortformat]
> +Name=Image List Date Format
> +Type=string
> +Default=%m-%d-%Y
> +Comment=XSL Date Format String: Use the syntax given at http://xsltsl.sourceforge.net/date-time.html
> diff -Naur htmlexport.old/themes/dateframes/dateframes.desktop.old htmlexport/themes/dateframes/dateframes.desktop.old
> --- htmlexport.old/themes/dateframes/dateframes.desktop.old     1969-12-31 19:00:00.000000000 -0500
> +++ htmlexport/themes/dateframes/dateframes.desktop.old 2007-07-22 17:47:25.000000000 -0400
> @@ -0,0 +1,28 @@
> +[Desktop Entry]
> +Name=Date Frames
> +Comment=A frame theme based on Ruediger Bente's frame theme
> +
> +[X-HTMLExport Author]
> +Name=Elizabeth Marmorstein
> +Url=mailto:purplegamba at cox.net
> +
> +[X-HTMLExport Parameter color1]
> +Name=Thumbnail Background
> +Type=color
> +Default=#FFFFFF
> +
> +[X-HTMLExport Parameter color2]
> +Name=Image Background (contrasting)
> +Type=color
> +Default=#000055
> +
> +[X-HTMLExport Parameter color3]
> +Name=Nav Bar Background (dark)
> +Type=color
> +Default=#000011
> +
> +[X-HTMLExport Parameter intro]
> +Name=Gallery Introduction
> +Type=string
> +Default=Welcome to my web gallery!
> +
> diff -Naur htmlexport.old/themes/dateframes/template.xsl htmlexport/themes/dateframes/template.xsl
> --- htmlexport.old/themes/dateframes/template.xsl       1969-12-31 19:00:00.000000000 -0500
> +++ htmlexport/themes/dateframes/template.xsl   2007-07-22 17:47:25.000000000 -0400
> @@ -0,0 +1,378 @@
> +<?xml version="1.0" encoding="UTF-8" ?>
> +<!DOCTYPE stylesheet [
> +<!ENTITY raquo "&#187;" >
> +<!ENTITY blank "&#160;" >
> +]>
> +
> +<xsl:transform version="1.0"
> +       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> +       xmlns:exsl="http://exslt.org/common"
> +       xmlns:dt="http://xsltsl.org/date-time"
> +       extension-element-prefixes="exsl">
> +
> +       <xsl:import href="http://xsltsl.sourceforge.net/modules/date-time.xsl"/>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create single image page for each image                         ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createImagePage">
> +       <xsl:param name="prevPic"/>
> +       <xsl:param name="nextPic"/>
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +               <title><xsl:value-of select="title"/></title>
> +               <link rel="stylesheet" type="text/css" href="../dateframes/style.css"/>
> +       </head>
> +       <body id="imagePage">
> +               <!-- Add Previous/Next Links -->
> +               <xsl:if test="string($prevPic)">
> +                       <a href="{$prevPic}.html">
> +                               <xsl:value-of select="$i18nPrevious"/>
> +                       </a>
> +               </xsl:if>
> +               <xsl:if test="string($prevPic) and string($nextPic)">
> +                       |
> +               </xsl:if>
> +               <xsl:if test="string($nextPic)">
> +                       <a href="{$nextPic}.html">
> +                               <xsl:value-of select="$i18nNext"/>
> +                       </a>
> +               </xsl:if>
> +               <br/>
> +
> +               <!-- Draw the picture -->
> +               <img src="{full/@fileName}" width="{full/@width}" height="{full/@height}" />
> +               <br/>
> +
> +               <!-- Add Previous/Next Links -->
> +               <xsl:if test="string($prevPic)">
> +                       <a href="{$prevPic}.html">
> +                               <xsl:value-of select="$i18nPrevious"/>
> +                       </a>
> +               </xsl:if>
> +               <xsl:if test="string($prevPic) and string($nextPic)">
> +                       |
> +               </xsl:if>
> +               <xsl:if test="string($nextPic)">
> +                       <a href="{$nextPic}.html">
> +                               <xsl:value-of select="$i18nNext"/>
> +                       </a>
> +               </xsl:if>
> +               <br/>
> +
> +
> +               <!-- Add Original File Link, if present -->
> +               <xsl:if test="original/@fileName != ''">
> +                       <p>
> +                       <a href="{original/@fileName}"><xsl:value-of select="$i18nOriginalImage"/></a>
> +                       (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)
> +                       </p>
> +               </xsl:if>
> +
> +               <!-- Add Caption and Date-->
> +               <div id="caption">
> +                       <xsl:value-of select="description"/>
> +                       <br/>
> +                       <xsl:call-template name="dt:format-date-time">
> +                               <xsl:with-param name="xsd-date-time" select="date"/>
> +                               <xsl:with-param name="format" select="$longformat"/>
> +                       </xsl:call-template>
> +                       <br/>
> +               </div>
> +       </body>
> +       </html>
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create thumbnail page for each collection                       ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createThumbnailPage">
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +               <title><xsl:value-of select="name"/></title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +               <h1>
> +               <span>
> +                       <xsl:value-of select="name"/>
> +               </span>
> +               </h1>
> +
> +       <body id="collectionPage">
> +       <div id="comment">
> +               <xsl:value-of select="comment"/><br/>
> +       </div>
> +       <ul>
> +                       <xsl:variable name="folder" select='fileName'/>
> +                       <xsl:for-each select="image">
> +                               <xsl:variable name="cur" select="position()"/>
> +                               <li>
> +                                       <a href="{$folder}/{full/@fileName}.html" target="image">
> +                                               <img src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}"/>
> +                                       </a><br/>
> +                                       <xsl:call-template name="dt:format-date-time">
> +                                               <xsl:with-param name="xsd-date-time" select="date"/>
> +                                               <xsl:with-param name="format" select="$shortformat"/>
> +                                       </xsl:call-template>
> +                                       <br/>
> +                               </li>
> +                               <exsl:document href='{$folder}/{full/@fileName}.html'>
> +                                       <xsl:call-template name="createImagePage">
> +                                               <xsl:with-param name="prevPic" select="preceding-sibling::*[1]/full/@fileName"/>
> +                                               <xsl:with-param name="nextPic" select="following-sibling::*[1]/full/@fileName"/>
> +                                       </xsl:call-template>
> +                               </exsl:document>
> +                       </xsl:for-each>
> +       </ul>
> +       </body>
> +       </html>
> +</xsl:template>
> +
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create the collection index page when more than one collection  ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createCollectionIndexPage">
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +               <title><xsl:value-of select="$i18nCollectionList"/></title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +       <body id="collectPage">
> +                       <xsl:for-each select="collections/collection">
> +                                       &blank;
> +                                       <a href="Thmbs{fileName}.html" target="mythmbs">
> +                                               <xsl:value-of select="name"/>
> +
> +                                       </a>
> +                                       <xsl:for-each select="image">
> +                                               <xsl:choose>
> +                                                       <xsl:when test="position()=last()">
> +                                                               (<xsl:value-of select="position()"/>)
> +                                                       </xsl:when>
> +                                               </xsl:choose>
> +                                       </xsl:for-each>
> +                                       <exsl:document href="Thmbs{fileName}.html">
> +                                               <xsl:call-template name="createThumbnailPage"/>
> +                                       </exsl:document>
> +
> +                       </xsl:for-each>
> +       </body>
> +       </html>
> +
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create the frameset page                                       ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createCollectionFrameSetPage">
> +<!-- ** create variable tsize for the width of the thumbnails frame            ** -->
> +<!-- ** add 10 pixel to tsize for the border around the thumbnail              ** -->
> +       <xsl:variable name="tsize" select="3*(collections/collection[1]/image[1]/thumbnail/@width + 18) + 65"/>
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +
> +               <title>
> +               <xsl:value-of select="name"/>
> +               </title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +       <frameset rows="40,*" noresize="1" border="0">
> +               <frame src="collect.html" name="collection"/>
> +               <frameset cols="{$tsize},*" noresize="1" border="0">
> +                       <frame src="blank.html" name="mythmbs"/>
> +                       <frame src="intro.html" name="image"/>
> +               </frameset>
> +       </frameset>
> +       </html>
> +       <exsl:document href="collect.html">
> +               <xsl:call-template name="createCollectionIndexPage"/>
> +       </exsl:document>
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create a blank page                                             ** -->
> +<!-- ** as a starting page when more than one collection is used        ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createBlankPage">
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +
> +               <title>
> +               <xsl:value-of select="name"/>
> +               </title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +       <body id="blankPage">
> +               <xsl:value-of select="title"/>
> +       </body>
> +
> +       </html>
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create the intro page                                           ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createIntroPage">
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +
> +               <title>
> +               <xsl:value-of select="name"/>
> +               </title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +       <body id="intro">
> +               <xsl:value-of select="$intro"/>
> +       </body>
> +
> +       </html>
> +</xsl:template>
> +
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create css style sheet                                       ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createStyleSheet">
> +body {
> +       background-color: <xsl:value-of select="$color1"/>; /*background behind thumbnails, outside boxes*/
> +       color: <xsl:value-of select="$color2"/>; /*default text color*/
> +       font-size: 14pt;
> +       text-align: center;
> +       font-family: Bitstream Vera Serif, serif;
> +       margin: 0in;
> +       padding: 0in;
> +}
> +
> +a { /*links (album titles)*/
> +       color: #FFFFFF;
> +       text-decoration: none;
> +}
> +
> +a:hover { /*links when mouse is over them (album titles)*/
> +       color: #5555FF;
> +       text-decoration: underline;
> +}
> +
> +h1 { /*album title above thumbnails*/
> +       padding-top: 0.1em;
> +       color: <xsl:value-of select="$color2"/>;
> +       font-size: 14pt;
> +       text-align: center;
> +}
> +
> +/* Collection page */
> +#collectionPage {
> +       background-color: <xsl:value-of select="$color1"/>;
> +       color: <xsl:value-of select="$color2"/>;
> +       padding-left: 2%;
> +       text-align: center;
> +       width: 95%;
> +}
> +
> +#comment {
> +       width: 95%;
> +       text-align: center;
> +}
> +
> +#collectionPage h1 {
> +       margin-top: 12px;
> +}
> +
> +#collectionPage ul { /*affects list of thumbnails*/
> +       padding: 0;
> +}
> +
> +#collectionPage li { /*affects stuff in boxes with thumbnails*/
> +        display: block;
> +        float: left;
> +        margin-left: 6px;
> +       margin-top: 6px;
> +       padding: 5px;
> +       color: <xsl:value-of select="$color1"/>;
> +       font-size: 8pt;
> +       background-color: <xsl:value-of select="$color2"/>;
> +       border: 1px solid #000000;
> +}
> +
> +/* Blank Page */
> +#blankPage {
> +       background-color: <xsl:value-of select="$color1"/>;
> +}
> +
> +#intro {
> +       padding: 10%;
> +       background-color: <xsl:value-of select="$color2"/>;
> +       color: <xsl:value-of select="$color1"/>;
> +       font-size: 16pt;
> +       text-align: center;
> +}
> +
> +/*  Collect Page */
> +#collectPage { /*album titles at top*/
> +       background-color: <xsl:value-of select="$color3"/>;
> +       font-size: 12pt;
> +       padding-top: 0.5em;
> +       margin: 0 auto;
> +       width: 95%;
> +       color: #AAAAAA; /*number of pics in collection*/
> +       text-align: center;
> +}
> +
> +
> +/* Image page */
> +#imagePage {
> +       padding:.5em;
> +       background-color:<xsl:value-of select="$color2"/>; /*background color behind the big image*/
> +       text-align: center;
> +       color: <xsl:value-of select="$color1"/>;
> +}
> +
> +
> +#caption { /*caption below photo*/
> +       padding-bottom:1em;
> +       padding-top:1em;
> +       color: <xsl:value-of select="$color1"/>;
> +       font-size: 16pt;
> +}
> +
> +#imagePage img {
> +       border: 1px solid #CECECE; /*border around picture*/
> +}
> +
> +#imagePage a { /*links*/
> +       color: <xsl:value-of select="$color1"/>;
> +       text-decoration: none;
> +}
> +
> +#imagePage a:hover { /*links when mouse is over them*/
> +       color: <xsl:value-of select="$color1"/>;
> +       text-decoration: underline;
> +}
> +
> +
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** the beginning of all                                            ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template match="/">
> +       <xsl:call-template name="createCollectionFrameSetPage"/>
> +       <exsl:document href="blank.html">
> +               <xsl:call-template name="createBlankPage"/>
> +       </exsl:document>
> +       <exsl:document href="intro.html">
> +               <xsl:call-template name="createIntroPage"/>
> +       </exsl:document>
> +       <exsl:document href="dateframes/style.css">
> +               <xsl:call-template name="createStyleSheet"/>
> +       </exsl:document>
> +</xsl:template>
> +
> +</xsl:transform>
> diff -Naur htmlexport.old/themes/dateframes/template.xsl.old htmlexport/themes/dateframes/template.xsl.old
> --- htmlexport.old/themes/dateframes/template.xsl.old   1969-12-31 19:00:00.000000000 -0500
> +++ htmlexport/themes/dateframes/template.xsl.old       2007-07-22 17:47:25.000000000 -0400
> @@ -0,0 +1,378 @@
> +<?xml version="1.0" encoding="UTF-8" ?>
> +<!DOCTYPE stylesheet [
> +<!ENTITY raquo "&#187;" >
> +<!ENTITY blank "&#160;" >
> +]>
> +
> +<xsl:transform version="1.0"
> +       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> +       xmlns:exsl="http://exslt.org/common"
> +       xmlns:dt="http://xsltsl.org/date-time"
> +       extension-element-prefixes="exsl">
> +
> +       <xsl:import href="http://xsltsl.sourceforge.net/modules/date-time.xsl"/>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create single image page for each image                         ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createImagePage">
> +       <xsl:param name="prevPic"/>
> +       <xsl:param name="nextPic"/>
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +               <title><xsl:value-of select="title"/></title>
> +               <link rel="stylesheet" type="text/css" href="../dateframes/style.css"/>
> +       </head>
> +       <body id="imagePage">
> +               <!-- Add Previous/Next Links -->
> +               <xsl:if test="string($prevPic)">
> +                       <a href="{$prevPic}.html">
> +                               <xsl:value-of select="$i18nPrevious"/>
> +                       </a>
> +               </xsl:if>
> +               <xsl:if test="string($prevPic) and string($nextPic)">
> +                       |
> +               </xsl:if>
> +               <xsl:if test="string($nextPic)">
> +                       <a href="{$nextPic}.html">
> +                               <xsl:value-of select="$i18nNext"/>
> +                       </a>
> +               </xsl:if>
> +               <br/>
> +
> +               <!-- Draw the picture -->
> +               <img src="{full/@fileName}" width="{full/@width}" height="{full/@height}" />
> +               <br/>
> +
> +               <!-- Add Previous/Next Links -->
> +               <xsl:if test="string($prevPic)">
> +                       <a href="{$prevPic}.html">
> +                               <xsl:value-of select="$i18nPrevious"/>
> +                       </a>
> +               </xsl:if>
> +               <xsl:if test="string($prevPic) and string($nextPic)">
> +                       |
> +               </xsl:if>
> +               <xsl:if test="string($nextPic)">
> +                       <a href="{$nextPic}.html">
> +                               <xsl:value-of select="$i18nNext"/>
> +                       </a>
> +               </xsl:if>
> +               <br/>
> +
> +
> +               <!-- Add Original File Link, if present -->
> +               <xsl:if test="original/@fileName != ''">
> +                       <p>
> +                       <a href="{original/@fileName}"><xsl:value-of select="$i18nOriginalImage"/></a>
> +                       (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)
> +                       </p>
> +               </xsl:if>
> +
> +               <!-- Add Caption and Date-->
> +               <div id="caption">
> +                       <xsl:value-of select="description"/>
> +                       <br/>
> +                       <xsl:call-template name="dt:format-date-time">
> +                               <xsl:with-param name="xsd-date-time" select="date"/>
> +                               <xsl:with-param name="format" select="'%a, %b %e, %Y   %i:%M%P'"/>
> +                       </xsl:call-template>
> +                       <br/>
> +               </div>
> +       </body>
> +       </html>
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create thumbnail page for each collection                       ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createThumbnailPage">
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +               <title><xsl:value-of select="name"/></title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +               <h1>
> +               <span>
> +                       <xsl:value-of select="name"/>
> +               </span>
> +               </h1>
> +
> +       <body id="collectionPage">
> +       <div id="comment">
> +               <xsl:value-of select="comment"/><br/>
> +       </div>
> +       <ul>
> +                       <xsl:variable name="folder" select='fileName'/>
> +                       <xsl:for-each select="image">
> +                               <xsl:variable name="cur" select="position()"/>
> +                               <li>
> +                                       <a href="{$folder}/{full/@fileName}.html" target="image">
> +                                               <img src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}"/>
> +                                       </a><br/>
> +                                       <xsl:call-template name="dt:format-date-time">
> +                                               <xsl:with-param name="xsd-date-time" select="date"/>
> +                                               <xsl:with-param name="format" select="'%n-%e-%Y'"/>
> +                                       </xsl:call-template>
> +                                       <br/>
> +                               </li>
> +                               <exsl:document href='{$folder}/{full/@fileName}.html'>
> +                                       <xsl:call-template name="createImagePage">
> +                                               <xsl:with-param name="prevPic" select="preceding-sibling::*[1]/full/@fileName"/>
> +                                               <xsl:with-param name="nextPic" select="following-sibling::*[1]/full/@fileName"/>
> +                                       </xsl:call-template>
> +                               </exsl:document>
> +                       </xsl:for-each>
> +       </ul>
> +       </body>
> +       </html>
> +</xsl:template>
> +
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create the collection index page when more than one collection  ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createCollectionIndexPage">
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +               <title><xsl:value-of select="$i18nCollectionList"/></title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +       <body id="collectPage">
> +                       <xsl:for-each select="collections/collection">
> +                                       &blank;
> +                                       <a href="Thmbs{fileName}.html" target="mythmbs">
> +                                               <xsl:value-of select="name"/>
> +
> +                                       </a>
> +                                       <xsl:for-each select="image">
> +                                               <xsl:choose>
> +                                                       <xsl:when test="position()=last()">
> +                                                               (<xsl:value-of select="position()"/>)
> +                                                       </xsl:when>
> +                                               </xsl:choose>
> +                                       </xsl:for-each>
> +                                       <exsl:document href="Thmbs{fileName}.html">
> +                                               <xsl:call-template name="createThumbnailPage"/>
> +                                       </exsl:document>
> +
> +                       </xsl:for-each>
> +       </body>
> +       </html>
> +
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create the frameset page                                       ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createCollectionFrameSetPage">
> +<!-- ** create variable tsize for the width of the thumbnails frame            ** -->
> +<!-- ** add 10 pixel to tsize for the border around the thumbnail              ** -->
> +       <xsl:variable name="tsize" select="3*(collections/collection[1]/image[1]/thumbnail/@width + 18) + 65"/>
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +
> +               <title>
> +               <xsl:value-of select="name"/>
> +               </title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +       <frameset rows="40,*" noresize="1" border="0">
> +               <frame src="collect.html" name="collection"/>
> +               <frameset cols="{$tsize},*" noresize="1" border="0">
> +                       <frame src="blank.html" name="mythmbs"/>
> +                       <frame src="intro.html" name="image"/>
> +               </frameset>
> +       </frameset>
> +       </html>
> +       <exsl:document href="collect.html">
> +               <xsl:call-template name="createCollectionIndexPage"/>
> +       </exsl:document>
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create a blank page                                             ** -->
> +<!-- ** as a starting page when more than one collection is used        ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createBlankPage">
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +
> +               <title>
> +               <xsl:value-of select="name"/>
> +               </title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +       <body id="blankPage">
> +               <xsl:value-of select="title"/>
> +       </body>
> +
> +       </html>
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create the intro page                                           ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createIntroPage">
> +       <html>
> +       <head>
> +               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> +
> +               <title>
> +               <xsl:value-of select="name"/>
> +               </title>
> +               <link rel="stylesheet" type="text/css" href="dateframes/style.css"/>
> +       </head>
> +       <body id="intro">
> +               <xsl:value-of select="$intro"/>
> +       </body>
> +
> +       </html>
> +</xsl:template>
> +
> +
> +<!-- ********************************************************************* -->
> +<!-- ** Create css style sheet                                       ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template name="createStyleSheet">
> +body {
> +       background-color: <xsl:value-of select="$color1"/>; /*background behind thumbnails, outside boxes*/
> +       color: <xsl:value-of select="$color2"/>; /*default text color*/
> +       font-size: 14pt;
> +       text-align: center;
> +       font-family: Bitstream Vera Serif, serif;
> +       margin: 0in;
> +       padding: 0in;
> +}
> +
> +a { /*links (album titles)*/
> +       color: #FFFFFF;
> +       text-decoration: none;
> +}
> +
> +a:hover { /*links when mouse is over them (album titles)*/
> +       color: #5555FF;
> +       text-decoration: underline;
> +}
> +
> +h1 { /*album title above thumbnails*/
> +       padding-top: 0.1em;
> +       color: <xsl:value-of select="$color2"/>;
> +       font-size: 14pt;
> +       text-align: center;
> +}
> +
> +/* Collection page */
> +#collectionPage {
> +       background-color: <xsl:value-of select="$color1"/>;
> +       color: <xsl:value-of select="$color2"/>;
> +       padding-left: 2%;
> +       text-align: center;
> +       width: 95%;
> +}
> +
> +#comment {
> +       width: 95%;
> +       text-align: center;
> +}
> +
> +#collectionPage h1 {
> +       margin-top: 12px;
> +}
> +
> +#collectionPage ul { /*affects list of thumbnails*/
> +       padding: 0;
> +}
> +
> +#collectionPage li { /*affects stuff in boxes with thumbnails*/
> +        display: block;
> +        float: left;
> +        margin-left: 6px;
> +       margin-top: 6px;
> +       padding: 5px;
> +       color: <xsl:value-of select="$color1"/>;
> +       font-size: 8pt;
> +       background-color: <xsl:value-of select="$color2"/>;
> +       border: 1px solid #000000;
> +}
> +
> +/* Blank Page */
> +#blankPage {
> +       background-color: <xsl:value-of select="$color1"/>;
> +}
> +
> +#intro {
> +       padding: 10%;
> +       background-color: <xsl:value-of select="$color2"/>;
> +       color: <xsl:value-of select="$color1"/>;
> +       font-size: 16pt;
> +       text-align: center;
> +}
> +
> +/*  Collect Page */
> +#collectPage { /*album titles at top*/
> +       background-color: <xsl:value-of select="$color3"/>;
> +       font-size: 12pt;
> +       padding-top: 0.5em;
> +       margin: 0 auto;
> +       width: 95%;
> +       color: #AAAAAA; /*number of pics in collection*/
> +       text-align: center;
> +}
> +
> +
> +/* Image page */
> +#imagePage {
> +       padding:.5em;
> +       background-color:<xsl:value-of select="$color2"/>; /*background color behind the big image*/
> +       text-align: center;
> +       color: <xsl:value-of select="$color1"/>;
> +}
> +
> +
> +#caption { /*caption below photo*/
> +       padding-bottom:1em;
> +       padding-top:1em;
> +       color: <xsl:value-of select="$color1"/>;
> +       font-size: 16pt;
> +}
> +
> +#imagePage img {
> +       border: 1px solid #CECECE; /*border around picture*/
> +}
> +
> +#imagePage a { /*links*/
> +       color: <xsl:value-of select="$color1"/>;
> +       text-decoration: none;
> +}
> +
> +#imagePage a:hover { /*links when mouse is over them*/
> +       color: <xsl:value-of select="$color1"/>;
> +       text-decoration: underline;
> +}
> +
> +
> +</xsl:template>
> +
> +<!-- ********************************************************************* -->
> +<!-- ** the beginning of all                                            ** -->
> +<!-- ********************************************************************* -->
> +<xsl:template match="/">
> +       <xsl:call-template name="createCollectionFrameSetPage"/>
> +       <exsl:document href="blank.html">
> +               <xsl:call-template name="createBlankPage"/>
> +       </exsl:document>
> +       <exsl:document href="intro.html">
> +               <xsl:call-template name="createIntroPage"/>
> +       </exsl:document>
> +       <exsl:document href="dateframes/style.css">
> +               <xsl:call-template name="createStyleSheet"/>
> +       </exsl:document>
> +</xsl:template>
> +
> +</xsl:transform>
>
> _______________________________________________
> Kde-imaging mailing list
> Kde-imaging at kde.org
> https://mail.kde.org/mailman/listinfo/kde-imaging
>
>


More information about the Kde-imaging mailing list