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