gitlab-org--gitlab-foss/app/helpers/appearances_helper.rb

40 lines
816 B
Ruby
Raw Normal View History

module AppearancesHelper
def brand_title
if brand_item && brand_item.title
brand_item.title
else
'GitLab Community Edition'
end
end
def brand_image
if brand_item.logo?
image_tag brand_item.logo
else
nil
end
end
def brand_text
markdown(brand_item.description)
end
def brand_item
@appearance ||= Appearance.first
end
def brand_header_logo
if brand_item && brand_item.header_logo?
image_tag brand_item.header_logo
else
render 'shared/logo.svg'
end
end
2016-05-05 17:00:40 +00:00
def custom_icon(icon_name, size: 16)
2016-08-18 23:27:22 +00:00
# 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-06-24 15:37:49 +00:00
render "shared/icons/#{icon_name}.svg", size: size
2016-05-05 17:00:40 +00:00
end
end