[open-ils-commits] r20346 - trunk/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Apr 27 12:18:57 EDT 2011
Author: dbs
Date: 2011-04-27 12:18:54 -0400 (Wed, 27 Apr 2011)
New Revision: 20346
Modified:
trunk/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/OpenLibrary.pm
Log:
Turn ebooks AC from OpenLibrary into usable HTML
Add <a> elements to turn URLs into links, and use the upper case
ebook format as the content of the link. "Read online" is the one
i18n-unfriendly exception, but this is a good start.
Signed-off-by: Dan Scott <dscott at laurentian.ca>
Modified: trunk/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/OpenLibrary.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/OpenLibrary.pm 2011-04-27 16:12:03 UTC (rev 20345)
+++ trunk/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/OpenLibrary.pm 2011-04-27 16:18:54 UTC (rev 20346)
@@ -105,7 +105,7 @@
# Internet Archive online reader
my $stream_url = $ebooks_json->[0]->{'read_url'} || '';
if ($stream_url) {
- $ebook_html .= "<div class='ebook_stream'>$stream_url</div>\n";
+ $ebook_html .= "<li class='ebook_stream'><a href='$stream_url'>Read online</a></li>\n";
$logger->debug("$key: stream URL = $stream_url");
}
@@ -115,12 +115,12 @@
if ($ebook_formats->{$ebook} eq 'read_url') {
next;
}
- $ebook_html .= "<div class='$ebook'>" .
- $ebook_formats->{$ebook}->{'url'} . "</div>\n";
+ $ebook_html .= "<li class='ebook_$ebook'><a href='" .
+ $ebook_formats->{$ebook}->{'url'} . "'>" . uc($ebook) . "</a></li>\n";
}
$logger->debug("$key: $ebook_html");
- $self->send_html("<div class='ebooks'>$ebook_html</div>");
+ $self->send_html("<ul class='ebooks'>$ebook_html</ul>");
}
=head1
More information about the open-ils-commits
mailing list