push(@output, File::Spec->catdir( $path, "custom" ));
push(@output, File::Spec->catdir( $path, "factory" ));
}
+
return @output;
}
sub process {
my ( $self, $r ) = @_;
- $r->{content_type} ||= "text/html";
- $r->{document_encoding} ||= "utf-8";
my $status = $self->template($r);
return $self->error($r) if $status != OK;
return OK;
# a static page
return -1 unless @{ $r->{objects} || [] };
+ my $template_error = $r->{error};
$r->{error} = <<EOF;
-<H1> Template not found </H1>
+<h1> Template not found </h1>
-This template was not found while processing the following request:
+A template was not found while processing the following request:
-<B>@{[$r->{action}]}</B> on table <B>@{[ $r->{table} ]}</B> with objects:
+<strong>@{[$r->{action}]}</strong> on table
+<strong>@{[ $r->{table} ]}</strong> with objects:
-<PRE>
+<pre>
@{[join "\n", @{$r->{objects}}]}
-</PRE>
+</pre>
+
-Looking for template <B>@{[$r->{template}]}</B> in paths:
+The main template is <strong>@{[$r->{template}]}</strong>.
+The template subsystem's error message was
+<pre>
+$template_error
+</pre>
+We looked in paths:
-<PRE>
+<pre>
@{[ join "\n", $self->paths($r) ]}
-</PRE>
+</pre>
EOF
$r->{content_type} = "text/html";
$r->{output} = $r->{error};