debian-mirror-gitlab/app/helpers/appearances_helper.rb
2016-08-24 12:49:21 +05:30

37 lines
658 B
Ruby

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
def custom_icon(icon_name, size: 16)
render "shared/icons/#{icon_name}.svg", size: size
end
end