From: Dylan William Hardison Date: Mon, 4 Feb 2019 18:12:24 +0000 (-0500) Subject: no bug - add code to allow using the bugzilla header/footer from mojo (ep) templates X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd9f7f50a93f17247acac0060d46ed1ad4e0b9d5;p=thirdparty%2Fbugzilla.git no bug - add code to allow using the bugzilla header/footer from mojo (ep) templates --- diff --git a/Bugzilla/App.pm b/Bugzilla/App.pm index 5a6b2fa70..3ab46150a 100644 --- a/Bugzilla/App.pm +++ b/Bugzilla/App.pm @@ -52,6 +52,7 @@ sub startup { $self->plugin('Bugzilla::App::Plugin::OAuth2'); push @{$self->commands->namespaces}, 'Bugzilla::App::Command'; + push @{$self->renderer->paths}, @{ Bugzilla::Template::_include_path() }; $self->sessions->cookie_name('bugzilla'); diff --git a/Bugzilla/App/Plugin/Glue.pm b/Bugzilla/App/Plugin/Glue.pm index 9a710da73..6e28528a8 100644 --- a/Bugzilla/App/Plugin/Glue.pm +++ b/Bugzilla/App/Plugin/Glue.pm @@ -149,6 +149,17 @@ sub register { } ); + $app->helper( + 'bz_include' => sub { + my ($self, $file, %vars) = @_; + my $template = Bugzilla->template; + my $buffer = ""; + $template->process($file, \%vars, \$buffer) + or die $template->error; + return Mojo::ByteStream->new($buffer); + } + ); + $app->log(MojoX::Log::Log4perl::Tiny->new( logger => Log::Log4perl->get_logger(ref $app))); } diff --git a/template/en/default/layouts/bugzilla.html.ep b/template/en/default/layouts/bugzilla.html.ep new file mode 100644 index 000000000..2fb1bd3f7 --- /dev/null +++ b/template/en/default/layouts/bugzilla.html.ep @@ -0,0 +1,3 @@ +%= bz_include 'global/header.html.tmpl', title => $title; +%= content +%= bz_include 'global/footer.html.tmpl';