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