2014-09-02 18:07:02 +05:30
|
|
|
module AppearancesHelper
|
|
|
|
def brand_title
|
2018-05-09 12:01:36 +05:30
|
|
|
current_appearance&.title.presence || 'GitLab Community Edition'
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def brand_image
|
2018-05-09 12:01:36 +05:30
|
|
|
image_tag(current_appearance.logo) if current_appearance&.logo?
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def brand_text
|
2018-05-09 12:01:36 +05:30
|
|
|
markdown_field(current_appearance, :description)
|
2016-04-02 18:10:28 +05:30
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def brand_new_project_guidelines
|
2018-05-09 12:01:36 +05:30
|
|
|
markdown_field(current_appearance, :new_project_guidelines)
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
def current_appearance
|
2017-09-10 17:25:29 +05:30
|
|
|
@appearance ||= Appearance.current
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
def brand_header_logo
|
2018-05-09 12:01:36 +05:30
|
|
|
if current_appearance&.header_logo?
|
|
|
|
image_tag current_appearance.header_logo
|
2016-04-02 18:10:28 +05:30
|
|
|
else
|
|
|
|
render 'shared/logo.svg'
|
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
2016-06-16 23:09:34 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
# Skip the 'GitLab' type logo when custom brand logo is set
|
|
|
|
def brand_header_logo_type
|
2018-05-09 12:01:36 +05:30
|
|
|
unless current_appearance&.header_logo?
|
2018-03-17 18:26:18 +05:30
|
|
|
render 'shared/logo_type.svg'
|
|
|
|
end
|
2016-06-16 23:09:34 +05:30
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|