3d734bee42990eff2883b83bb67f635795024d40
[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           <xsl:if test="utwor/@thanks">
56             <p class="info"><xsl:value-of select="utwor/@thanks" /></p>
57           </xsl:if>
58
59           <p class="info">
60             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>.
61           </p>
62
63           <p class="footer info">
64             <a href="http://www.wolnelektury.pl/"><img src="logo_wolnelektury.png" alt="WolneLektury.pl" /></a>
65           </p>
66         </div>
67       </body>
68     </html>
69   </xsl:template>
70
71   <xsl:template match="text()" >
72     <xsl:value-of select="." />
73   </xsl:template>
74
75   <xsl:template match="node()" mode="poczatek">
76     <xsl:value-of select="." />
77   </xsl:template>
78
79   <xsl:template match="dc:creator" mode="poczatek">
80     <h2 class="author">
81       <xsl:apply-templates mode='person' />
82     </h2>
83   </xsl:template>
84
85   <xsl:template match="dc:creator/text()">
86     <h2 class="author" >
87       <xsl:apply-templates mode='person' />
88     </h2>
89   </xsl:template>
90
91   <xsl:template name="translators">
92     <xsl:if test="//dc:contributor.translator">
93         <p class="info">
94             <xsl:text>tłum. </xsl:text>
95             <xsl:for-each select="//dc:contributor.translator">
96                 <xsl:if test="position() != 1">, </xsl:if>
97                 <xsl:apply-templates mode="person" />
98             </xsl:for-each>
99         </p>
100     </xsl:if>
101   </xsl:template>
102
103   <xsl:template match="text()" mode="person">
104     <xsl:value-of select="wl:person_name(.)" />
105   </xsl:template>
106
107   <xsl:template match="autor_utworu" mode="poczatek">
108     <h2 class="author" >
109       <xsl:apply-templates />
110     </h2>
111   </xsl:template>
112
113   <xsl:template match="dzielo_nadrzedne" mode="poczatek">
114     <h2 class="collection" >
115       <xsl:apply-templates />
116     </h2>
117   </xsl:template>
118
119   <xsl:template match="nazwa_utworu" mode="poczatek" >
120     <h1 class="title" >
121       <xsl:apply-templates />
122     </h1>
123   </xsl:template>
124
125   <xsl:template match="dc:title" mode="poczatek" >
126     <h1 class="title" >
127       <xsl:apply-templates />
128     </h1>
129   </xsl:template>
130
131   <xsl:template match="podtytul" mode="poczatek">
132     <h2 class="subtitle" >
133       <xsl:apply-templates />
134     </h2>
135   </xsl:template>
136
137   <xsl:template match="pe|pa|pr|pt" />
138
139   <xsl:template match="extra" />
140
141   <xsl:template match="motyw" />
142
143 </xsl:stylesheet>