package HTML;

sub print_head { # title
    my($title) = @_;
    print qq{<html><head>
<title>$title</title>
</head><body>
<h1>$title</h1>
};
}
# external
$tail = "</body></html>\n";
# external
sub print_status_page { # title
    &print_head(@_);
    print $tail;
}

sub make_buttons { # pagename, button template [[name => realname], ...}
    my $pagename = shift;
    my $template = shift;
    print "<hr>\n";
    foreach (@$template) {
	print qq{<a href="${$_}[0]=$pagename">${$_}[1]</a>\n};
    }
}

sub textform { # label, options, data, buttons
    my ($label, $options,$data,$buttons) =@_;
    print qq{
<form method="POST">
$label: <textarea name="body" $options>
$data
</textarea><br>
<input type="submit" value="accept changes">
<input type="reset" value="punt changes">
$buttons
</form>
};
}

1;
