Commit d75ade01 authored by Yorick Peterse's avatar Yorick Peterse

Refactor Gitlab::Favicon for EE

This moves the development favicon name in Gitlab::Favicon to a separate
method, allowing EE to redefine it to return a custom favicon.
parent 333bbf8d
# frozen_string_literal: true
module EE
module Gitlab
module Favicon
extend ActiveSupport::Concern
class_methods do
extend ::Gitlab::Utils::Override
override :development_favicon
def development_favicon
'favicon-green.png'
end
end
end
end
end
......@@ -10,7 +10,7 @@ module Gitlab
elsif Gitlab::Utils.to_boolean(ENV['CANARY'])
'favicon-yellow.png'
elsif Rails.env.development?
'favicon-green.png'
development_favicon
else
'favicon.png'
end
......@@ -18,6 +18,12 @@ module Gitlab
ActionController::Base.helpers.image_path(image_name, host: host)
end
def development_favicon
# This is a separate method so that EE can return a different favicon
# for development environments.
'favicon-blue.png'
end
def status_overlay(status_name)
path = File.join(
'ci_favicons',
......@@ -58,3 +64,5 @@ module Gitlab
end
end
end
Gitlab::Favicon.prepend(EE::Gitlab::Favicon)
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