2014-09-02 18:07:02 +05:30
|
|
|
module AppearancesHelper
|
|
|
|
def brand_title
|
2016-04-02 18:10:28 +05:30
|
|
|
if brand_item && brand_item.title
|
|
|
|
brand_item.title
|
|
|
|
else
|
|
|
|
'GitLab Community Edition'
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def brand_image
|
2016-04-02 18:10:28 +05:30
|
|
|
if brand_item.logo?
|
|
|
|
image_tag brand_item.logo
|
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def brand_text
|
2016-04-02 18:10:28 +05:30
|
|
|
markdown(brand_item.description)
|
|
|
|
end
|
|
|
|
|
|
|
|
def brand_item
|
|
|
|
@appearance ||= Appearance.first
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
def brand_header_logo
|
2016-04-02 18:10:28 +05:30
|
|
|
if brand_item && brand_item.header_logo?
|
|
|
|
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
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
def custom_icon(icon_name, size: 16)
|
2016-09-13 17:45:13 +05:30
|
|
|
# We can't simply do the below, because there are some .erb SVGs.
|
|
|
|
# File.read(Rails.root.join("app/views/shared/icons/_#{icon_name}.svg")).html_safe
|
2016-08-24 12:49:21 +05:30
|
|
|
render "shared/icons/#{icon_name}.svg", size: size
|
2016-06-16 23:09:34 +05:30
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|