2014-09-02 18:07:02 +05:30
|
|
|
module AppearancesHelper
|
|
|
|
def brand_title
|
2018-03-17 18:26:18 +05:30
|
|
|
brand_item&.title.presence || 'GitLab Community Edition'
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def brand_image
|
2018-03-17 18:26:18 +05:30
|
|
|
image_tag(brand_item.logo) if brand_item&.logo?
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def brand_text
|
2016-11-03 12:29:30 +05:30
|
|
|
markdown_field(brand_item, :description)
|
2016-04-02 18:10:28 +05:30
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def brand_new_project_guidelines
|
|
|
|
markdown_field(brand_item, :new_project_guidelines)
|
|
|
|
end
|
|
|
|
|
2016-04-02 18:10:28 +05:30
|
|
|
def brand_item
|
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-03-17 18:26:18 +05:30
|
|
|
if brand_item&.header_logo?
|
2016-04-02 18:10:28 +05:30
|
|
|
image_tag brand_item.header_logo
|
|
|
|
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
|
|
|
|
unless brand_item&.header_logo?
|
|
|
|
render 'shared/logo_type.svg'
|
|
|
|
end
|
2016-06-16 23:09:34 +05:30
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|