Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f26f891d
Commit
f26f891d
authored
Aug 27, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
f437a7b2
0c639b24
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
app/views/layouts/_piwik.html.haml
app/views/layouts/_piwik.html.haml
+2
-2
changelogs/unreleased/sh-fix-piwik-template.yml
changelogs/unreleased/sh-fix-piwik-template.yml
+5
-0
spec/views/layouts/_head.html.haml_spec.rb
spec/views/layouts/_head.html.haml_spec.rb
+20
-0
No files found.
app/views/layouts/_piwik.html.haml
View file @
f26f891d
...
...
@@ -11,5 +11,5 @@
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
<noscript><p><img
src=
"//
#{
extra_config
.
piwik_url
}
/piwik.php?idsite=
#{
extra_config
.
piwik_site_id
}
"
style=
"border:0;"
alt=
""
/></p></noscript>
<!-- End Piwik Code -->
<noscript><p><img
src=
"//
#{
extra_config
.
piwik_url
}
/piwik.php?idsite=
#{
extra_config
.
piwik_site_id
}
"
style=
"border:0;"
alt=
""
/></p></noscript>
<!-- End Piwik Code -->
changelogs/unreleased/sh-fix-piwik-template.yml
0 → 100644
View file @
f26f891d
---
title
:
Fix Piwik not working
merge_request
:
32234
author
:
type
:
fixed
spec/views/layouts/_head.html.haml_spec.rb
View file @
f26f891d
require
'spec_helper'
describe
'layouts/_head'
do
include
StubConfiguration
before
do
allow
(
view
).
to
receive
(
:current_application_settings
).
and_return
(
Gitlab
::
CurrentSettings
.
current_application_settings
)
end
...
...
@@ -87,6 +89,24 @@ describe 'layouts/_head' do
end
end
context
'when a Piwik config is set'
do
let
(
:piwik_host
)
{
'piwik.example.com'
}
before
do
stub_config
(
extra:
{
piwik_url:
piwik_host
,
piwik_site_id:
12345
})
end
it
'add a Piwik Javascript'
do
render
expect
(
rendered
).
to
match
(
/<script.*>.*var u="\/\/
#{
piwik_host
}
\/".*<\/script>/m
)
expect
(
rendered
).
to
match
(
%r(<noscript>.*<img src="//
#{
piwik_host
}
/piwik.php.*</noscript>)
)
end
end
def
stub_helper_with_safe_string
(
method
)
allow_any_instance_of
(
PageLayoutHelper
).
to
receive
(
method
)
.
and_return
(
%q{foo" http-equiv="refresh}
.
html_safe
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment