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