debian-mirror-gitlab/app/helpers/appearances_helper.rb

40 lines
824 B
Ruby
Raw Normal View History

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-11-03 12:29:30 +05:30
markdown_field(brand_item, :description)
2016-04-02 18:10:28 +05:30
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-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
end
2014-09-02 18:07:02 +05:30
end