working copy epub flag
[librarian.git] / librarian / epub / xsltTitle.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0"
3     xmlns="http://www.w3.org/1999/xhtml"
4     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5     xmlns:dc="http://purl.org/dc/elements/1.1/"
6     xmlns:wl="http://wolnelektury.pl/functions">
7   <xsl:output method="html" version="1.0" encoding="utf-8" />
8   <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
9   <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
10
11   <xsl:template match="/">
12     <html>
13       <head>
14         <link rel="stylesheet" href="style.css" type="text/css" />
15         <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
16         <title>
17           <xsl:text>Strona tytułowa</xsl:text>
18         </title>
19       </head>
20       <body>
21         <div id="book-text" >
22           <div class='title-page'>
23             <xsl:choose>
24               <xsl:when test="//autor_utworu | //nazwa_utworu">
25                 <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>
26                 <xsl:apply-templates select="//nazwa_utworu | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
27               </xsl:when>
28               <xsl:otherwise>
29                 <xsl:apply-templates select="//dc:creator" mode="poczatek"/>
30                 <xsl:apply-templates select="//dc:title | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
31               </xsl:otherwise>
32             </xsl:choose>
33           </div>
34
35           <p class="info">&#160;</p>
36
37           <xsl:call-template name="translators" />
38
39           <xsl:if test="utwor/@working-copy">
40             <p class="info">[Kopia robocza]</p>
41           </xsl:if>
42
43           <xsl:if test="not(utwor/@less-advertising)">
44             <p class="info">
45               <a>
46                   <xsl:attribute name="href">
47                       <xsl:value-of select="//dc:identifier.url" />
48                   </xsl:attribute>
49                   Ta lektura</a>,
50               podobnie jak tysiące innych, jest dostępna on-line na stronie
51               <a href="http://www.wolnelektury.pl/">wolnelektury.pl</a>.
52             </p>
53           </xsl:if>
54
55           <p class="info">
56             Utwór opracowany został w&#160;ramach projektu<a href="http://www.wolnelektury.pl/"> Wolne Lektury</a> przez<a href="http://www.nowoczesnapolska.org.pl/"> fundację Nowoczesna Polska</a>.
57           </p>
58
59           <p class="footer info">
60             <a href="http://www.wolnelektury.pl/"><img src="logo_wolnelektury.png" alt="WolneLektury.pl" /></a>
61           </p>
62         </div>
63       </body>
64     </html>
65   </xsl:template>
66
67   <xsl:template match="text()" >
68     <xsl:value-of select="." />
69   </xsl:template>
70
71   <xsl:template match="node()" mode="poczatek">
72     <xsl:value-of select="." />
73   </xsl:template>
74
75   <xsl:template match="dc:creator" mode="poczatek">
76     <h2 class="author">
77       <xsl:apply-templates mode='person' />
78     </h2>
79   </xsl:template>
80
81   <xsl:template match="dc:creator/text()">
82     <h2 class="author" >
83       <xsl:apply-templates mode='person' />
84     </h2>
85   </xsl:template>
86
87   <xsl:template name="translators">
88     <xsl:if test="//dc:contributor.translator">
89         <p class="info">
90             <xsl:text>tłum. </xsl:text>
91             <xsl:for-each select="//dc:contributor.translator">
92                 <xsl:if test="position() != 1">, </xsl:if>
93                 <xsl:apply-templates mode="person" />
94             </xsl:for-each>
95         </p>
96     </xsl:if>
97   </xsl:template>
98
99   <xsl:template match="text()" mode="person">
100     <xsl:value-of select="wl:person_name(.)" />
101   </xsl:template>
102
103   <xsl:template match="autor_utworu" mode="poczatek">
104     <h2 class="author" >
105       <xsl:apply-templates />
106     </h2>
107   </xsl:template>
108
109   <xsl:template match="dzielo_nadrzedne" mode="poczatek">
110     <h2 class="collection" >
111       <xsl:apply-templates />
112     </h2>
113   </xsl:template>
114
115   <xsl:template match="nazwa_utworu" mode="poczatek" >
116     <h1 class="title" >
117       <xsl:apply-templates />
118     </h1>
119   </xsl:template>
120
121   <xsl:template match="dc:title" mode="poczatek" >
122     <h1 class="title" >
123       <xsl:apply-templates />
124     </h1>
125   </xsl:template>
126
127   <xsl:template match="podtytul" mode="poczatek">
128     <h2 class="subtitle" >
129       <xsl:apply-templates />
130     </h2>
131   </xsl:template>
132
133   <xsl:template match="pe|pa|pr|pt" />
134
135   <xsl:template match="extra" />
136
137   <xsl:template match="motyw" />
138
139 </xsl:stylesheet>