Commit f17cf3cd authored by Alexis Reigel's avatar Alexis Reigel Committed by Douwe Maan

use custom main favicon

parent bad02223
...@@ -35,4 +35,8 @@ module AppearancesHelper ...@@ -35,4 +35,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-green.ico' if Rails.env.development? return 'favicon-green.ico' if Rails.env.development?
......
...@@ -60,6 +60,11 @@ describe PageLayoutHelper do ...@@ -60,6 +60,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