EPUB3 support.
[librarian.git] / src / 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:param name="outputtype"/>
9
10   <xsl:template match="/">
11     <html>
12       <head>
13         <link rel="stylesheet" href="style.css" type="text/css" />
14         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
15         <title>
16           <xsl:text>Strona tytułowa</xsl:text>
17         </title>
18       </head>
19       <body>
20         <div id="book-text" >
21           <div class='title-page'>
22             <xsl:choose>
23               <xsl:when test="//autor_utworu | //nazwa_utworu">
24                 <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>
25                 <xsl:apply-templates select="//nazwa_utworu | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
26               </xsl:when>
27               <xsl:otherwise>
28                 <xsl:apply-templates select="//dc:creator" mode="poczatek"/>
29                 <xsl:apply-templates select="//dc:title | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
30               </xsl:otherwise>
31             </xsl:choose>
32           </div>
33
34           <p class="info">&#160;</p>
35
36           <xsl:call-template name="translators" />
37
38           <xsl:if test="utwor/@working-copy">
39             <p class="info">[Kopia robocza]</p>
40           </xsl:if>
41
42           <xsl:if test="not(utwor/@less-advertising)">
43             <p class="info">
44               <a>
45                   <xsl:attribute name="href">
46                       <xsl:value-of select="//dc:identifier.url" />
47                   </xsl:attribute>
48                   Ta lektura</a>,
49               podobnie jak tysiące innych, jest dostępna on-line na stronie
50               <a href="http://www.wolnelektury.pl/">wolnelektury.pl</a>.
51             </p>
52           </xsl:if>
53
54           <xsl:if test="utwor/@thanks">
55             <p class="info"><xsl:value-of select="utwor/@thanks" /></p>
56           </xsl:if>
57
58           <p class="info">
59             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>.
60           </p>
61
62           <xsl:variable name="isbnId" select="concat($outputtype, '-id')"/>
63           <xsl:if test=".//meta[@id=$isbnId]">
64             <xsl:variable name="isbn" select=".//meta[@id=$isbnId]"/>
65             <p class="info">ISBN <xsl:value-of select="substring-after($isbn, 'ISBN-')"/></p>
66           </xsl:if>
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>