compile once for now
[librarian.git] / librarian / epub / xsltLast.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     xmlns:date="http://exslt.org/dates-and-times">
8   <xsl:output method="html" version="1.0" encoding="utf-8" />
9   <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
10   <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
11
12   <xsl:template match="utwor">
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 redakcyjna</xsl:text>
19         </title>
20       </head>
21       <body>
22         <div id="book-text" >
23           <p class="info">
24               <xsl:choose>
25                   <xsl:when test="//dc:rights.license">
26                       Ten utwór jest udostepniony na licencji
27                       <a>
28                           <xsl:attribute name="href">
29                               <xsl:value-of select="//dc:rights.license" />
30                           </xsl:attribute>
31                           <xsl:value-of select="//dc:rights" />
32                       </a>
33                   </xsl:when>
34                   <xsl:otherwise>
35                     Ten utwór nie jest objęty majątkowym prawem autorskim i znajduje się w domenie
36                     publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować
37                     i rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami
38                     (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to
39                     te dodatkowe materiały udostępnione są na licencji
40                     <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons
41                     Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL</a>.
42                   </xsl:otherwise>
43               </xsl:choose>
44           </p>
45
46           <p class="info">Źródło: <a>
47               <xsl:attribute name="href">
48                   <xsl:value-of select="//dc:identifier.url" />
49               </xsl:attribute>
50               <xsl:attribute name="title">
51                   <xsl:for-each select="//dc:creator/text()"><xsl:value-of select="wl:person_name(.)"/>, </xsl:for-each><xsl:value-of select="//dc:title" />
52               </xsl:attribute>
53               <xsl:value-of select="//dc:identifier.url" />
54           </a></p>
55
56           <xsl:if test="//dc:source" >
57             <p class="info">Tekst opracowany na podstawie: <xsl:value-of select="//dc:source" /></p>
58           </xsl:if>
59
60           <xsl:if test=".//dc:publisher">
61             <p class="info">
62               Wydawca:
63               <xsl:for-each select="//dc:publisher/text()">
64                 <xsl:value-of select="."/>
65                 <xsl:if test="not(position() = last())">, </xsl:if>
66               </xsl:for-each>
67             </p>
68           </xsl:if>
69
70           <xsl:if test="//dc:description" >
71             <p class="info"><xsl:value-of select="//dc:description" /></p>
72           </xsl:if>
73
74           <xsl:call-template name="editors" />
75
76           <xsl:call-template name="funders" />
77
78           <xsl:if test="@data-cover-by">
79             <p class="info">Okładka na podstawie: 
80             <xsl:choose>
81             <xsl:when test="@data-cover-source">
82                 <a>
83                 <xsl:attribute name="href">
84                   <xsl:value-of select="@data-cover-source" />
85                 </xsl:attribute>
86                 <xsl:value-of select="@data-cover-by" />
87                 </a>
88             </xsl:when>
89             <xsl:otherwise>
90                 <xsl:value-of select="@data-cover-by" />
91             </xsl:otherwise>
92             </xsl:choose>
93             </p>
94           </xsl:if>
95
96           <p class="info">&#160;</p>
97           <p class="minor-info">
98               Plik wygenerowany dnia <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.
99           </p>
100
101         </div>
102       </body>
103     </html>
104   </xsl:template>
105
106   <xsl:template match="text()" >
107     <xsl:value-of select="." />
108   </xsl:template>
109
110   <xsl:template name="editors">
111     <xsl:if test="@editors">
112         <p class="info">
113             <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>
114             <xsl:value-of select="@editors" />.</p>
115     </xsl:if>
116   </xsl:template>
117
118   <xsl:template name="funders">
119     <xsl:if test="@funders">
120         <p class="minor-info">Publikację wsparli i wsparły:
121             <xsl:value-of select="@funders" />.</p>
122     </xsl:if>
123   </xsl:template>
124
125   <xsl:template match="text()" mode="person">
126     <xsl:value-of select="wl:person_name(.)" />
127   </xsl:template>
128 </xsl:stylesheet>