]> git.phdru.name Git - m_librarian.git/blob - m_librarian/web/views/list_books.tmpl
Feat(web): Configure columns for author and book tables
[m_librarian.git] / m_librarian / web / views / list_books.tmpl
1 #encoding utf-8
2 #import cgi
3 #extends views.layout
4 #attr $title = 'Список книг'
5 #def body
6 <h1>$title</h1>
7
8 #if $books_by_author
9   <form action="/download/" method="POST" style="height: 80%">
10   <table style="width: 100%; height: 90%">
11   #set $series = None
12   #set $columns1 = $len($columns)+1
13   #for $author in $sorted($books_by_author)
14     #set $books = $books_by_author[$author]
15     #for $book in $books
16     #if $book.series != $series
17     #set $series = $book.series
18   <tr>
19   <td colspan="$columns1"><b>
20   $author — <i>
21   #if $book.series
22 $cgi.escape($series, 1)#slurp
23   #else
24 Вне серий#slurp
25   #end if
26   </i></b></td>
27   </tr>
28     #end if
29   <tr>
30   <td><input type=checkbox name=books value="$book.id"></td>
31   #for $column in $columns
32   <td>$cgi.escape(unicode($getattr($book, $column) or ''))</td>
33   #end for
34   </tr>
35     #end for
36   #end for
37   <tr>
38   <td colspan="$columns1" style="text-align: center"><input type="submit" value="Скачать"></td>
39   </tr>
40   </table>
41   </form>
42 #else
43   <p>Не найдено ни одной книги!</p>
44 #end if
45 #end def