Merge branch 'master' into ofop
[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="not(utwor/@not-wl)">
40           <xsl:if test="not(utwor/@less-advertising)">
41             <p class="info">
42               <a>
43                   <xsl:attribute name="href">
44                       <xsl:value-of select="//dc:identifier.url" />
45                   </xsl:attribute>
46                   Ta lektura</a>,
47               podobnie jak tysiące innych, jest dostępna on-line na stronie
48               <a href="http://www.wolnelektury.pl/">wolnelektury.pl</a>.
49             </p>
50           </xsl:if>
51
52           <p class="info">
53             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>.
54           </p>
55
56           <p class="footer info">
57             <a href="http://www.wolnelektury.pl/"><img src="logo_wolnelektury.png" alt="WolneLektury.pl" /></a>
58           </p>
59       </xsl:if>
60       <!--xsl:if test="utwor/@not-wl">
61           <p class="info">
62             Konwersja wykonana przez<a href="http://www.nowoczesnapolska.org.pl/"> fundację Nowoczesna Polska</a>.
63           </p>
64       </xsl:if-->
65         </div>
66       </body>
67     </html>
68   </xsl:template>
69
70   <xsl:template match="text()" >
71     <xsl:value-of select="." />
72   </xsl:template>
73
74   <xsl:template match="node()" mode="poczatek">
75     <xsl:value-of select="." />
76   </xsl:template>
77
78   <xsl:template match="dc:creator" mode="poczatek">
79     <h2 class="author">
80       <xsl:apply-templates mode='person' />
81     </h2>
82   </xsl:template>
83
84   <xsl:template match="dc:creator/text()">
85     <h2 class="author" >
86       <xsl:apply-templates mode='person' />
87     </h2>
88   </xsl:template>
89
90   <xsl:template name="translators">
91     <xsl:if test="//dc:contributor.translator">
92         <p class="info">
93             <xsl:text>tłum. </xsl:text>
94             <xsl:for-each select="//dc:contributor.translator">
95                 <xsl:if test="position() != 1">, </xsl:if>
96                 <xsl:apply-templates mode="person" />
97             </xsl:for-each>
98         </p>
99     </xsl:if>
100   </xsl:template>
101
102   <xsl:template match="text()" mode="person">
103     <xsl:value-of select="wl:person_name(.)" />
104   </xsl:template>
105
106   <xsl:template match="autor_utworu" mode="poczatek">
107     <h2 class="author" >
108       <xsl:apply-templates />
109     </h2>
110   </xsl:template>
111
112   <xsl:template match="dzielo_nadrzedne" mode="poczatek">
113     <h2 class="collection" >
114       <xsl:apply-templates />
115     </h2>
116   </xsl:template>
117
118   <xsl:template match="nazwa_utworu" mode="poczatek" >
119     <h1 class="title" >
120       <xsl:apply-templates />
121     </h1>
122   </xsl:template>
123
124   <xsl:template match="dc:title" mode="poczatek" >
125     <h1 class="title" >
126       <xsl:apply-templates />
127     </h1>
128   </xsl:template>
129
130   <xsl:template match="podtytul" mode="poczatek">
131     <h2 class="subtitle" >
132       <xsl:apply-templates />
133     </h2>
134   </xsl:template>
135
136   <xsl:template match="pe|pa|pr|pt" />
137
138   <xsl:template match="extra" />
139
140   <xsl:template match="motyw" />
141
142 </xsl:stylesheet>