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