]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/Base.pm
Fixed mime type setting, fixed errors in revision 445, folded in Maypole::Component...
[maypole.git] / lib / Maypole / View / Base.pm
index 9615950d0bf141babecac61003218050f6e9bed7..ece5d98cb8af3167e06d8f132056c8ad1f286451 100644 (file)
@@ -25,6 +25,7 @@ sub paths {
        push(@output, File::Spec->catdir( $path, "custom" ));
        push(@output, File::Spec->catdir( $path, "factory" ));
     }
+
     return @output;
 }
 
@@ -73,8 +74,6 @@ sub vars {
 
 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;
@@ -90,23 +89,31 @@ sub error {
         # 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};