2014-07-11 10:16:44 -04:00
|
|
|
module AppearancesHelper
|
2014-07-11 08:05:40 -04:00
|
|
|
def brand_title
|
2018-04-02 10:27:12 -04:00
|
|
|
current_appearance&.title.presence || 'GitLab Community Edition'
|
2014-07-11 08:05:40 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def brand_image
|
2018-04-02 10:27:12 -04:00
|
|
|
image_tag(current_appearance.logo) if current_appearance&.logo?
|
2014-07-11 08:05:40 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def brand_text
|
2018-04-02 10:27:12 -04:00
|
|
|
markdown_field(current_appearance, :description)
|
2016-02-22 14:49:16 -05:00
|
|
|
end
|
|
|
|
|
2017-11-22 08:48:38 -05:00
|
|
|
def brand_new_project_guidelines
|
2018-04-02 10:27:12 -04:00
|
|
|
markdown_field(current_appearance, :new_project_guidelines)
|
2017-11-22 08:48:38 -05:00
|
|
|
end
|
|
|
|
|
2018-04-02 10:27:12 -04:00
|
|
|
def current_appearance
|
2017-08-09 10:41:51 -04:00
|
|
|
@appearance ||= Appearance.current
|
2014-07-11 08:05:40 -04:00
|
|
|
end
|
2015-02-25 01:58:47 -05:00
|
|
|
|
|
|
|
def brand_header_logo
|
2018-04-02 10:27:12 -04:00
|
|
|
if current_appearance&.header_logo?
|
|
|
|
image_tag current_appearance.header_logo
|
2016-02-22 14:49:16 -05:00
|
|
|
else
|
|
|
|
render 'shared/logo.svg'
|
|
|
|
end
|
2015-02-25 01:58:47 -05:00
|
|
|
end
|
2017-11-15 16:31:17 -05:00
|
|
|
|
|
|
|
# Skip the 'GitLab' type logo when custom brand logo is set
|
|
|
|
def brand_header_logo_type
|
2018-04-02 10:27:12 -04:00
|
|
|
unless current_appearance&.header_logo?
|
2017-11-15 16:31:17 -05:00
|
|
|
render 'shared/logo_type.svg'
|
|
|
|
end
|
|
|
|
end
|
2014-07-11 08:05:40 -04:00
|
|
|
end
|