1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
package VNDB::Util::LayoutHTML;
use strict;
use warnings;
use TUWF ':html';
use VNWeb::HTML;
use Exporter 'import';
our @EXPORT = qw|htmlHeader htmlFooter|;
sub htmlHeader { # %options->{ title, noindex, search, feeds, metadata }
my($self, %o) = @_;
%VNWeb::HTML::pagevars = ();
$o{og} = $o{metadata} ? +{ map +(s/og://r, $o{metadata}{$_}), keys $o{metadata}->%* } : undef;
$o{index} = !$o{noindex};
html lang => 'en';
head sub { VNWeb::HTML::_head_(\%o) };
body;
div id => 'bgright', ' ';
div id => 'header', sub { h1 sub { a href => '/', 'the visual novel database' } };
div id => 'menulist', sub { VNWeb::HTML::_menu_(\%o) };
div id => 'maincontent';
}
sub htmlFooter { # %options => { pref_code => 1 }
my($self, %o) = @_;
div id => 'footer', sub { VNWeb::HTML::_footer_ };
end 'div'; # maincontent
# Abuse an empty noscript tag for the formcode to update a preference setting, if the page requires one.
noscript id => 'pref_code', title => $self->authGetCode('/xml/prefs.xml'), ''
if $o{pref_code} && $self->authInfo->{id};
script type => 'text/javascript', src => $self->{url_static}.'/f/vndb.js?'.$self->{version}, '';
VNWeb::HTML::_scripts_({});
end 'body';
end 'html';
}
1;
|