]> git.phdru.name Git - m_librarian.git/blob - m_librarian/web/views/list_books.tmpl
Feat(web:books): Показывать список книг с разбивкой по авторам и сериям
[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   <div style="width: 100%; height: 90%">
11   <select multiple name="books" style="height: 100%">
12   #set $series = None
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     #if $series is not None
18     </optgroup>
19     #end if
20     #set $series = $book.series
21     <optgroup label="#slurp
22 $author — #slurp
23     #if $book.series
24 $cgi.escape($series, 1)#slurp
25     #else
26 Вне серий#slurp
27     #end if
28 ">
29     #end if
30     <option value="$book.id">$book.ser_no $cgi.escape($book.title)</option>
31     #end for
32   #end for
33   </optgroup>
34   </select>
35   </div>
36   <div style="width: 100%; text-align: center">
37   <input type="submit" value="Скачать">
38   </div>
39   </form>
40 #else
41   <p>Не найдено ни одной книги!</p>
42 #end if
43 #end def