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