]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - add code to allow using the bugzilla header/footer from mojo (ep) templates
authorDylan William Hardison <dylan@hardison.net>
Mon, 4 Feb 2019 18:12:24 +0000 (13:12 -0500)
committerGitHub <noreply@github.com>
Mon, 4 Feb 2019 18:12:24 +0000 (13:12 -0500)
Bugzilla/App.pm
Bugzilla/App/Plugin/Glue.pm
template/en/default/layouts/bugzilla.html.ep [new file with mode: 0644]

index 5a6b2fa70a232dfb014dd4bb8956a8e55f8d4eaf..3ab46150ac44a02336510d9475e573c2952037bd 100644 (file)
@@ -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');
 
index 9a710da73a85fb3ec397e28236bd26f3032b4c7b..6e28528a893ffe45dd877985cd44e05a60c55170 100644 (file)
@@ -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 (file)
index 0000000..2fb1bd3
--- /dev/null
@@ -0,0 +1,3 @@
+%= bz_include 'global/header.html.tmpl', title => $title;
+%= content
+%= bz_include 'global/footer.html.tmpl';