From 4c9afb9aa9c3fa8cb16824a7a032d560f5780403 Mon Sep 17 00:00:00 2001 From: Anthony Hughes Date: Wed, 25 Oct 2017 09:30:40 -0700 Subject: Bug 1332016 - Integrate the Socorro Lens into Bug Modal --- Bugzilla/Install/Filesystem.pm | 2 ++ Bugzilla/Template.pm | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index 2a2e9b71a..8532356a5 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -302,6 +302,8 @@ sub FILESYSTEM { dirs => DIR_WS_SERVE }, js => { files => WS_SERVE, dirs => DIR_WS_SERVE }, + static => { files => WS_SERVE, + dirs => DIR_WS_SERVE }, $skinsdir => { files => WS_SERVE, dirs => DIR_WS_SERVE }, 'docs/*/html' => { files => WS_SERVE, diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 1ad735067..49b7e9435 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -900,7 +900,7 @@ sub create { html_light => \&Bugzilla::Util::html_light_quote, email => \&Bugzilla::Util::email_filter, - + mtime => \&mtime_filter, # iCalendar contentline filter @@ -1131,6 +1131,19 @@ sub create { # However, we need to set the meta[name=viewport] server-side or the behavior is # not as predictable. It is possible other parts of the frontend may use this feature too. 'is_mobile_browser' => sub { return Bugzilla->cgi->user_agent =~ /Mobi/ }, + + 'socorro_lens_url' => sub { + my ($sigs) = @_; + + # strip [@ ] from sigs + my @sigs = map { /^\[\@\s*(.+?)\s*\]$/ } @$sigs; + + return '' unless @sigs; + # use a URI object to encode the query string part. + my $uri = URI->new(correct_urlbase() . 'static/metricsgraphics/socorro-lens.html'); + $uri->query_form('s' => join("\\", @sigs)); + return $uri; + }, }, }; -- cgit v1.2.3-24-g4f1b