Commit 8967fc04 authored by Alexis Reigel's avatar Alexis Reigel

use custom main favicon

parent 40d8d7df
...@@ -33,4 +33,8 @@ module AppearancesHelper ...@@ -33,4 +33,8 @@ module AppearancesHelper
render 'shared/logo_type.svg' render 'shared/logo_type.svg'
end end
end end
def brand_favicon
brand_item&.favicon
end
end end
...@@ -39,6 +39,7 @@ module PageLayoutHelper ...@@ -39,6 +39,7 @@ module PageLayoutHelper
end end
def favicon def favicon
return brand_favicon.default.url if brand_favicon
return 'favicon-yellow.ico' if Gitlab::Utils.to_boolean(ENV['CANARY']) return 'favicon-yellow.ico' if Gitlab::Utils.to_boolean(ENV['CANARY'])
return 'favicon-blue.ico' if Rails.env.development? return 'favicon-blue.ico' if Rails.env.development?
......
...@@ -55,6 +55,11 @@ describe PageLayoutHelper do ...@@ -55,6 +55,11 @@ describe PageLayoutHelper do
stub_env('CANARY', 'true') stub_env('CANARY', 'true')
expect(helper.favicon).to eq 'favicon-yellow.ico' expect(helper.favicon).to eq 'favicon-yellow.ico'
end end
it 'uses the custom favicon if an favicon appearance is present' do
create :appearance, favicon: fixture_file_upload(Rails.root.join('spec/fixtures/dk.png'))
expect(helper.favicon).to match %r{/uploads/-/system/appearance/favicon/\d+/default_dk.ico}
end
end end
describe 'page_image' do describe 'page_image' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment