220 |
my $revision = Frey::SVK->info->{Revision} || ''; |
my $revision = Frey::SVK->info->{Revision} || ''; |
221 |
$revision = $1 if $info->{'Mirrored From'} =~ m{Rev\.\s+(\d+)}; |
$revision = $1 if $info->{'Mirrored From'} =~ m{Rev\.\s+(\d+)}; |
222 |
|
|
223 |
|
$self->add_icon; |
224 |
|
|
225 |
my $html = join("\n", |
my $html = join("\n", |
226 |
qq|<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head>|, |
qq|<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head>|, |
227 |
$self->_head_html, |
$self->_head_html, |
319 |
cluck "## DEMOLISH status ", $#status + 1, " elements ", dump( map { keys %$_ } @status ) if @status; |
cluck "## DEMOLISH status ", $#status + 1, " elements ", dump( map { keys %$_ } @status ) if @status; |
320 |
} |
} |
321 |
|
|
322 |
|
sub add_icon { |
323 |
|
my $self = shift; |
324 |
|
my $icon = ref($self); |
325 |
|
$icon = $self->class if $self->can('class'); |
326 |
|
$icon =~ s{::}{/}g; |
327 |
|
|
328 |
|
my $icon_path = "static/icons/$icon.png"; |
329 |
|
|
330 |
|
if ( -e $icon_path ) { |
331 |
|
$self->add_head( qq|<link rel="icon" type="image/png" href="/$icon_path" />| ); |
332 |
|
warn "# using icon $icon_path"; |
333 |
|
|
334 |
|
# FIXME http://en.wikipedia.org/wiki/Favicon suggest just rel="icon" but that doesn't seem to work! |
335 |
|
my $ico_path = $icon_path; |
336 |
|
$ico_path =~ s{png$}{ico}; |
337 |
|
if ( ! -e $ico_path ) { |
338 |
|
system "convert $icon_path $ico_path"; |
339 |
|
warn "# convert $icon_path $ico_path : $@"; |
340 |
|
} |
341 |
|
$self->add_head( qq|<link rel="shortcut icon" type="image/x-icon" href="/$ico_path" />| ) if -e $ico_path; |
342 |
|
|
343 |
|
} else { |
344 |
|
warn "can't find $icon_path"; |
345 |
|
} |
346 |
|
} |
347 |
|
|
348 |
1; |
1; |