pgc-www/templates/book/authors.html.ep

41 lines
1006 B
Plaintext

% layout 'default';
% title 'Authors';
<h1><%= title %></h1>
<%# On a new search, reset the page number to 1. %>
%= form_for authors => { page_number => 1 } => begin
<span>
%= label_for name_like => 'Name like'
%= text_field name_like => flash('name_like')
</span>
<span>
%= label_for minimum_book_count => 'Wrote at least'
<%= number_field minimum_book_count => 0,
min => 0, maxlength => 4, size => 4 %> books
</span>
%= submit_button "Search"
%= end
% if ($pager->total_entries > 0) {
<p/>
<div>
<table>
<tr class="header">
<th class="count">Books</th>
<th class="author-wide">Authored by</th>
</tr>
% my $n = 0; for my $author ($author_page->all) {
<tr <%== 'class="odd"' if (++$n % 2) %>>
<td class="count"><%= $author->books->count %></td>
<td>
<%= link_to(trct($author->name, 100) => 'author' =>
{ id => $author->id, page_number => 1 }) %>
</td>
</tr>
% }
</table>
</div>
% }
%= include '_page-navigation', items_name => 'authors'