X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FView%2FBase.pm;h=ece5d98cb8af3167e06d8f132056c8ad1f286451;hb=f19715f56244cc6d862169c2dd656b8a2f3845b5;hp=a3d9466562b574b722bf96d7ee05a044087f3725;hpb=0df49a961d4cc7ebb6866f4e31273288ed2305bc;p=maypole.git diff --git a/lib/Maypole/View/Base.pm b/lib/Maypole/View/Base.pm index a3d9466..ece5d98 100644 --- a/lib/Maypole/View/Base.pm +++ b/lib/Maypole/View/Base.pm @@ -25,6 +25,7 @@ sub paths { push(@output, File::Spec->catdir( $path, "custom" )); push(@output, File::Spec->catdir( $path, "factory" )); } + return @output; } @@ -55,6 +56,7 @@ sub vars { $classmeta->{moniker} ||= $class->moniker; $classmeta->{plural} ||= $class->plural_moniker; $classmeta->{cgi} ||= { $class->to_cgi }; + $classmeta->{stringify_column} ||= $class->stringify_column; # User-friendliness facility for custom template writers. if ( @{ $r->objects || [] } > 1 ) { @@ -72,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; @@ -89,23 +89,31 @@ sub error { # a static page return -1 unless @{ $r->{objects} || [] }; + my $template_error = $r->{error}; $r->{error} = < Template not found +

Template not found

-This template was not found while processing the following request: +A template was not found while processing the following request: -@{[$r->{action}]} on table @{[ $r->{table} ]} with objects: +@{[$r->{action}]} on table +@{[ $r->{table} ]} with objects: -
+
 @{[join "\n", @{$r->{objects}}]}
-
+
+ -Looking for template @{[$r->{template}]} in paths: +The main template is @{[$r->{template}]}. +The template subsystem's error message was +
+$template_error
+
+We looked in paths: -
+
 @{[ join "\n", $self->paths($r) ]}
-
+
EOF $r->{content_type} = "text/html"; $r->{output} = $r->{error};