last page not-wl version
[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 chroniony 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           <xsl:if test="not(utwor/@not-wl)">
47             <p class="info">Źródło: <a>
48               <xsl:attribute name="href">
49                   <xsl:value-of select="//dc:identifier.url" />
50               </xsl:attribute>
51               <xsl:attribute name="title">
52                   <xsl:value-of select="wl:person_name(//dc:creator/text())" />, <xsl:value-of select="//dc:title" />
53               </xsl:attribute>
54               <xsl:value-of select="//dc:identifier.url" />
55             </a></p>
56           </xsl:if>
57           
58           
59
60           <xsl:if test="//dc:source" >
61             <p class="info">Tekst opracowany na podstawie: <xsl:value-of select="//dc:source" /></p>
62           </xsl:if>
63
64           <xsl:if test="//dc:description" >
65             <p class="info"><xsl:value-of select="//dc:description" /></p>
66           </xsl:if>
67
68           <xsl:call-template name="editors" />
69
70           <xsl:if test="@data-cover-by">
71             <p class="info">Okładka na podstawie: 
72             <xsl:choose>
73             <xsl:when test="@data-cover-source">
74                 <a>
75                 <xsl:attribute name="href">
76                   <xsl:value-of select="@data-cover-source" />
77                 </xsl:attribute>
78                 <xsl:value-of select="@data-cover-by" />
79                 </a>
80             </xsl:when>
81             <xsl:otherwise>
82                 <xsl:value-of select="@data-cover-by" />
83             </xsl:otherwise>
84             </xsl:choose>
85             </p>
86           </xsl:if>
87
88           <xsl:if test="not(utwor/@not-wl)">
89               <div class="info">
90               <img src="jedenprocent.png" alt="Logo 1%" />
91               <div>Przekaż 1% podatku na rozwój Wolnych Lektur.</div>
92               <div>Nazwa organizacji: Fundacja Nowoczesna Polska</div>
93               <div>KRS 0000070056</div>
94               </div>
95           </xsl:if>
96
97           <p class="info">&#160;</p>
98           <p class="minor info">
99               Plik wygenerowany dnia <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.
100           </p>
101
102         </div>
103       </body>
104     </html>
105   </xsl:template>
106
107   <xsl:template match="text()" >
108     <xsl:value-of select="." />
109   </xsl:template>
110
111   <xsl:template name="editors">
112     <xsl:if test="//dc:contributor.editor[text()]|//dc:contributor.technical_editor[text()]">
113         <p class="info">
114             <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>
115             <xsl:for-each select="//dc:contributor.editor[text()]|//dc:contributor.technical_editor[text() and not(//dc:contributor.editor/text()=text())]">
116                 <xsl:sort />
117                 <xsl:if test="position() != 1">, </xsl:if>
118                 <xsl:apply-templates mode="person" />
119             </xsl:for-each>.
120         </p>
121     </xsl:if>
122   </xsl:template>
123
124   <xsl:template match="dc:contributor.editor|dc:contributor.technical_editor">
125       <br /><xsl:apply-templates mode='person' />
126   </xsl:template>
127
128   <xsl:template match="text()" mode="person">
129     <xsl:value-of select="wl:person_name(.)" />
130   </xsl:template>
131 </xsl:stylesheet>