return books_by_author, orphans, books_by_parent
+ _audiences_pl = {
+ "SP1": (1, u"szkoła podstawowa"),
+ "SP2": (1, u"szkoła podstawowa"),
+ "P": (1, u"szkoła podstawowa"),
+ "G": (2, u"gimnazjum"),
+ "L": (3, u"liceum"),
+ "LP": (3, u"liceum"),
+ }
+ def audiences_pl(self):
+ audiences = self.get_extra_info_value().get('audiences', [])
+ audiences = sorted(set([self._audiences_pl[a] for a in audiences]))
+ return [a[1] for a in audiences]
+
def _has_factory(ftype):
has = lambda self: bool(getattr(self, "%s_file" % ftype))
def book_tree_texml(book_list, books_by_parent, depth=1):
return "".join("""
<cmd name='hspace'><parm>%(depth)dem</parm></cmd>%(title)s
+ <spec cat='align' /><cmd name="note"><parm>%(audiences)s</parm></cmd>
<spec cat='align' /><cmd name="note"><parm>%(audiobook)s</parm></cmd>
<ctrl ch='\\' />
%(children)s
""" % {
"depth": depth,
"title": book.title,
+ "audiences": ", ".join(book.audiences_pl()),
"audiobook": "audiobook" if book.has_media('mp3') else "",
"children": book_tree_texml(books_by_parent.get(book.id, ()), books_by_parent, depth + 1)
} for book in book_list)
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0em}
\setlength{\textheight}{24cm}
-\setlength{\textwidth}{17cm}
+\setlength{\textwidth}{17.5cm}
\pagestyle{fancy}
\end{flushright}
\end{minipage}
- \begin{longtable}{p{15cm} p{2cm}}
+ \begin{longtable}{p{9.5cm} p{5.5cm}r p{2cm}}
<TeXML escape="1">
{% book_tree_texml orphans books_by_parent %}
-Subproject commit 84ec0eba63d0933b3f22a7884c46be6b796ee165
+Subproject commit 6798a1eb468cd86db145323c446f5fa1e89daaca