From 16cb5693dc41b55b5d88c7f2d8db503a12bd15a2 Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Sat, 16 Feb 2019 23:37:17 +0100 Subject: [PATCH] WIP - Load default template if does not exist (#1653) --- lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm index 99d2ca74c..c606cf0ac 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm @@ -242,6 +242,9 @@ sub sendHtml { $args{headers} ||= $req->respHeaders || []; my $htpl; $template = ( $args{templateDir} // $self->templateDir ) . "/$template.tpl"; + unless (-f $template){ + $template = $self->templateDir . "/bootstrap/$template.tpl"; + } return $self->sendError( $req, "Unable to read $template", 500 ) unless ( -r $template and -f $template ); eval {