Skip to content

Commit

Permalink
fixed issue with albums without conver not able to create pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
thawn committed Jun 4, 2017
1 parent 1ed92bc commit 3ca32a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/TTMp32Gme/PrintHandler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ sub format_main_oid {
"<img class='img-24mm play-img' src='$oid_path' alt='oid: $oid'>";
}

sub format_cover {
my ( $album ) = @_;
if ( $album->{'picture_filename'} ) {
return '<img class="img-responsive cover-img"src="/assets/images/' . $album->{'oid'} . '/' . $album->{'picture_filename'} . '" alt="cover">';
} else {
return '';
}
}

## external functions:

sub create_print_layout {
Expand All @@ -108,6 +117,7 @@ sub create_print_layout {
$album->{'play_controls'} = $controls;
$album->{'main_oid_image'} =
format_main_oid( $oid, $oid_map, $httpd, $dbh );
$album->{'formatted_cover'} = format_cover($album);
$content .= $template->fill_in( HASH => $album );
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/templates/printing_contents.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ <h4 class="panel-title">{ $album_title }</h4>
<div class="panel-body">
<div class="row">
<div class="col-xs-4 cover">
<img class="img-responsive cover-img"
src="/assets/images/{$oid}/{$picture_filename}" alt="cover">
{$formatted_cover}
<div class="power-on">
<img class="play-img img-24mm" src="/assets/images/white.png"> <span
class="glyphicon glyphicon-off" style=""></span>{ $main_oid_image }
Expand Down

0 comments on commit 3ca32a3

Please sign in to comment.