fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3ea0bf
)
educational levels in catalogue pdf
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 21 Nov 2011 10:02:01 +0000
(11:02 +0100)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 21 Nov 2011 10:02:01 +0000
(11:02 +0100)
apps/catalogue/models.py
patch
|
blob
|
history
apps/catalogue/templatetags/catalogue_tags.py
patch
|
blob
|
history
apps/reporting/templates/reporting/catalogue.texml
patch
|
blob
|
history
lib/librarian
patch
|
blob
|
history
diff --git
a/apps/catalogue/models.py
b/apps/catalogue/models.py
index
22ed325
..
c420119
100644
(file)
--- a/
apps/catalogue/models.py
+++ b/
apps/catalogue/models.py
@@
-885,6
+885,19
@@
class Book(models.Model):
return books_by_author, orphans, books_by_parent
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 _has_factory(ftype):
has = lambda self: bool(getattr(self, "%s_file" % ftype))
diff --git
a/apps/catalogue/templatetags/catalogue_tags.py
b/apps/catalogue/templatetags/catalogue_tags.py
index
e6544b0
..
7667621
100644
(file)
--- a/
apps/catalogue/templatetags/catalogue_tags.py
+++ b/
apps/catalogue/templatetags/catalogue_tags.py
@@
-144,12
+144,14
@@
def book_tree(book_list, books_by_parent):
def book_tree_texml(book_list, books_by_parent, depth=1):
return "".join("""
<cmd name='hspace'><parm>%(depth)dem</parm></cmd>%(title)s
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,
<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)
"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)
diff --git
a/apps/reporting/templates/reporting/catalogue.texml
b/apps/reporting/templates/reporting/catalogue.texml
index
93a13d0
..
c17ed07
100755
(executable)
--- a/
apps/reporting/templates/reporting/catalogue.texml
+++ b/
apps/reporting/templates/reporting/catalogue.texml
@@
-47,7
+47,7
@@
LetterSpace=-1.0
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0em}
\setlength{\textheight}{24cm}
\setlength{\leftmargin}{0em}
\setlength{\rightmargin}{0em}
\setlength{\textheight}{24cm}
-\setlength{\textwidth}{17cm}
+\setlength{\textwidth}{17
.5
cm}
\pagestyle{fancy}
\pagestyle{fancy}
@@
-98,7
+98,7
@@
LetterSpace=-1.0
\end{flushright}
\end{minipage}
\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 %}
<TeXML escape="1">
{% book_tree_texml orphans books_by_parent %}
diff --git
a/lib/librarian
b/lib/librarian
index
84ec0eb
..
6798a1e
160000
(submodule)
--- a/
lib/librarian
+++ b/
lib/librarian
@@
-1
+1
@@
-Subproject commit
84ec0eba63d0933b3f22a7884c46be6b796ee165
+Subproject commit
6798a1eb468cd86db145323c446f5fa1e89daaca