3 #from m_librarian.translations import translations
5 #attr $title = 'Список книг'
9 <script type="text/javascript" language="Javascript">
11 function toggleBooks(name, value) {
12 cboxes = document.querySelectorAll(
13 'input[type=checkbox][name^=' + name + '_book]');
14 for (var i = 0; i < cboxes.length; i++) {
15 cboxes[i].checked = value;
22 <form action="/download/" method="POST" style="height: 80%">
23 <table style="width: 100%; height: 90%">
26 #set $_ = $getattr($translations, 'ugettext', None) or $translations.gettext
27 #for $column in $columns
28 <td style="text-align: center">$cgi.escape($_($column))</td>
31 #set $columns1 = $len($columns)+1
32 #for $anum, $author in $enumerate($sorted($books_by_author))
35 #set $books = $books_by_author[$author]
37 #if $book.series != $series
38 #set $series = $book.series
41 <td><input type=checkbox name="a${anum+1}_s${snum}"
42 onClick="toggleBooks(this.name, this.checked)"></td>
43 <td colspan="${columns1-1}"><b>
46 $cgi.escape($series, 1)#slurp
54 <td><input type=checkbox name="a${anum+1}_s${snum}_books" value="$book.id"></td>
55 #for $column in $columns
56 #if $column in ('ser_no', 'size')
57 #set $style = ' style="text-align: right; width: 5ex"'
61 <td$style>$cgi.escape(unicode($getattr($book, $column) or ''))</td>
67 <td colspan="$columns1" style="text-align: center"><input type="submit" value="Скачать"></td>
72 <p>Не найдено ни одной книги!</p>