Link book title to its gutenberg page.
This commit is contained in:
parent
646d0c4084
commit
9f16a10009
|
@ -39,6 +39,11 @@ sub add_my_helpers ($self) {
|
|||
return $self->config->{'default-rows-per-page'};
|
||||
}
|
||||
);
|
||||
$self->helper(
|
||||
gutenberg_url => sub ($self, $gid) {
|
||||
return "https://gutenberg.org/ebooks/" . $gid;
|
||||
}
|
||||
);
|
||||
$self->helper(
|
||||
logname => sub ($self) { $self->session('logname'); }
|
||||
);
|
||||
|
|
|
@ -12,7 +12,10 @@ Books by <strong><%= $author->name %></strong>
|
|||
</tr>
|
||||
% for my $book ($book_page->all) {
|
||||
<tr>
|
||||
<td><%= trct($book->title, 100) %></td>
|
||||
<td><%= link_to(
|
||||
trct($book->title, 100) => gutenberg_url($book->gutenberg_id)
|
||||
) %>
|
||||
</td>
|
||||
</tr>
|
||||
% }
|
||||
</table>
|
||||
|
|
|
@ -20,7 +20,10 @@
|
|||
</tr>
|
||||
% for my $book ($book_page->all) {
|
||||
<tr>
|
||||
<td><%= trct($book->title, 50) %></td>
|
||||
<td><%= link_to(
|
||||
trct($book->title, 50) => gutenberg_url($book->gutenberg_id)
|
||||
) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to(trct($book->author->name, 40) => 'author' =>
|
||||
{ id => $book->author->id, page_number => 1 }) %>
|
||||
|
|
Loading…
Reference in New Issue