[Rt-commit] [rtir] 02/03: Don't require every RTIR page to use a custom header
Kevin Falcone
falcone at bestpractical.com
Tue Jul 22 12:34:51 EDT 2014
This is an automated email from the git hooks/post-receive script.
falcone pushed a commit to branch 3.2/core-forward
in repository rtir.
commit d9d8dcdf2736ee1ca47b4477d96f2fb867f83b42
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Tue Jul 22 11:36:20 2014 -0400
Don't require every RTIR page to use a custom header
The callback to change the 3 things we want to change has existed since
at least RT 3.5.1 fb115741. This paves the way for core RT components
that we want to exist under /RTIR/ to just need a tiny shim rather than
a full copy and paste of the component with a change to the Header line.
We can probably safely remove /RTIR/Elements/Header in a future RTIR
release and simplify even more code.
---
.../Header => Callbacks/RTIR/Elements/Header/Head} | 16 +++++++++-------
html/RTIR/Elements/Header | 8 +-------
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/html/RTIR/Elements/Header b/html/Callbacks/RTIR/Elements/Header/Head
similarity index 86%
copy from html/RTIR/Elements/Header
copy to html/Callbacks/RTIR/Elements/Header/Head
index 46432ba..af47c2d 100644
--- a/html/RTIR/Elements/Header
+++ b/html/Callbacks/RTIR/Elements/Header/Head
@@ -45,10 +45,12 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Elements/Header,
- URL => RT->Config->Get('WebPath') ."/RTIR/index.html",
- Name => loc("RTIR for [_1]", RT->Config->Get('rtirname')),
- LogoURL => RT->Config->Get('WebPath')."/static/images/RTIR/logo.png",
- %ARGS
-
-&>
+<%init>
+return unless $m->request_comp->path =~ m{^/RTIR/};
+$ARGSRef->{URL} //= RT->Config->Get('WebPath') ."/RTIR/index.html";
+$ARGSRef->{Name} //= loc("RTIR for [_1]", RT->Config->Get('rtirname'));
+$ARGSRef->{LogoURL} //= RT->Config->Get('WebPath')."/static/images/RTIR/logo.png";
+</%init>
+<%args>
+$ARGSRef
+</%args>
diff --git a/html/RTIR/Elements/Header b/html/RTIR/Elements/Header
index 46432ba..1071eb6 100644
--- a/html/RTIR/Elements/Header
+++ b/html/RTIR/Elements/Header
@@ -45,10 +45,4 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Elements/Header,
- URL => RT->Config->Get('WebPath') ."/RTIR/index.html",
- Name => loc("RTIR for [_1]", RT->Config->Get('rtirname')),
- LogoURL => RT->Config->Get('WebPath')."/static/images/RTIR/logo.png",
- %ARGS
-
-&>
+<& /Elements/Header, %ARGS &>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list