Add funders info.
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Wed, 7 Aug 2013 10:19:28 +0000 (12:19 +0200)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Wed, 7 Aug 2013 10:19:28 +0000 (12:19 +0200)
librarian/dcparser.py
librarian/epub.py
librarian/epub/style.css
librarian/epub/xsltLast.xsl
librarian/pdf.py
librarian/pdf/wl.cls
librarian/pdf/wl2tex.xslt

index eddd8e5..abee11b 100644 (file)
@@ -171,6 +171,8 @@ class WorkInfo(object):
             as_person, salias='editor', multiple=True, default=[]),
         Field( DCNS('contributor.technical_editor'), 'technical_editors',
             as_person, salias='technical_editor', multiple=True, default=[]),
+        Field( DCNS('contributor.funding'), 'funders',
+            salias='funder', multiple=True, default=[]),
 
         Field( DCNS('date'), 'created_at', as_date),
         Field( DCNS('date.pd'), 'released_to_public_domain_at', as_date, required=False),
index eab2b18..24579d9 100644 (file)
@@ -415,6 +415,9 @@ def transform(wldoc, verbose=False,
     # add editors info
     document.edoc.getroot().set('editors', u', '.join(sorted(
         editor.readable() for editor in document.editors())))
+    if document.book_info.funders:
+        document.edoc.getroot().set('funders', u', '.join(
+            document.book_info.funders))
 
     opf = xslt(document.book_info.to_etree(), get_resource('epub/xsltContent.xsl'))
     manifest = opf.find('.//' + OPFNS('manifest'))
index 622c8da..a862dce 100644 (file)
@@ -364,7 +364,9 @@ em.author-emphasis
        margin-right: 2em;
 }
 
-p.minor {
+p.minor-info {
+    text-align: center;
+    margin-bottom: 1em;
     font-size: 0.75em;
 }
 p.footer {
index 9b52203..c4867d1 100644 (file)
@@ -63,6 +63,8 @@
 
           <xsl:call-template name="editors" />
 
+          <xsl:call-template name="funders" />
+
           <xsl:if test="@data-cover-by">
             <p class="info">Okładka na podstawie: 
             <xsl:choose>
@@ -82,7 +84,7 @@
           </xsl:if>
 
           <p class="info">&#160;</p>
-          <p class="minor info">
+          <p class="minor-info">
               Plik wygenerowany dnia <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.
           </p>
 
     </xsl:if>
   </xsl:template>
 
+  <xsl:template name="funders">
+    <xsl:if test="@funders">
+        <p class="minor-info">Publikację ufundowali i ufundowały:
+            <xsl:value-of select="@funders" />.</p>
+    </xsl:if>
+  </xsl:template>
+
   <xsl:template match="text()" mode="person">
     <xsl:value-of select="wl:person_name(.)" />
   </xsl:template>
index 9fb92b1..90e4dc2 100644 (file)
@@ -231,6 +231,8 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None,
         # add editors info
         root.set('editors', u', '.join(sorted(
             editor.readable() for editor in document.editors())))
+        if document.book_info.funders:
+            root.set('funders', u', '.join(document.book_info.funders))
 
         # hack the tree
         move_motifs_inside(document.edoc)
index 4a7648e..0de767c 100644 (file)
@@ -246,6 +246,11 @@ Letters={SmallCaps,UppercaseSmallCaps}
 
     \editors
 
+    \ifdefined\funders
+        \vspace{.6em}
+        \funders
+    \fi
+
     \ifdefined\coverby
         \vspace{.6em}
         \coverby
index 97296e9..c0c22e5 100644 (file)
                     </xsl:choose>
                 }
                 </xsl:if>
-                \def\editors{<xsl:call-template name="editors" />}
+                \def\editors{<TeXML escape="1"><xsl:call-template name="editors" /></TeXML>}
+                <xsl:if test="@funders">
+                    \def\funders{Publikację ufundowali i ufundowały:
+                        <TeXML escape="1"><xsl:value-of select="@funders" /></TeXML>.}
+                </xsl:if>
             </TeXML>
 
             <cmd name="editorialsection" />