charset: check ucplanes for modification date
[sheet.git] / common.inc.plp
index e4cc5f99f5635a4920d007ddb5433878c13c991c..31c2c2270b71e209a20cf885fe0363ad623066e6 100644 (file)
@@ -11,9 +11,13 @@ use HTTP::Date;
 use Encode qw( decode_utf8 );
 
 sub Alert {
-       my ($title, $debug) = @_;
-       $title .= ": <em>$debug</em>" if $Dev and defined $debug;
-       say "<p class=error>$title</p>\n";
+       my ($html, $debug) = @_;
+       ref $html eq 'ARRAY' or $html = [$html];
+       my ($title, @lines) = @{$html};
+       $body = "<h2>$title</h2>";
+       $body .= "\n<p>$_</p>" for @lines;
+       $body .= "\n<pre>$debug</pre>" if $Dev and $debug;
+       say "<div class=error>$body</div>\n";
 }
 
 $PLP::ERROR = sub {
@@ -155,7 +159,7 @@ sub Html {
        <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="license copyright"
         title="Licensed under the GNU Affero General Public License, version 3">AGPLv3</a>
 EOT
-               say sprintf '• %.3fs', Time::HiRes::tv_interval($Time) if $Dev;
+               say sprintf '• %.3fs', Time::HiRes::tv_interval($Time) if $Dev and $Time;
                say '</p>';
                say '';
                say '</html>';