appearances_helper.rb 636 Bytes
Newer Older
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1
module AppearancesHelper
2
  def brand_title
3 4 5 6 7
    if brand_item && brand_item.title
      brand_item.title
    else
      'GitLab Community Edition'
    end
8 9 10
  end

  def brand_image
11 12 13 14 15
    if brand_item.logo?
      image_tag brand_item.logo
    else
      nil
    end
16 17 18
  end

  def brand_text
19 20 21 22 23
    markdown(brand_item.description)
  end

  def brand_item
    @appearance ||= Appearance.first
24
  end
25 26

  def brand_header_logo
27 28 29 30 31
    if brand_item && brand_item.header_logo?
      image_tag brand_item.header_logo
    else
      render 'shared/logo.svg'
    end
32
  end
Annabel Dunstone's avatar
Annabel Dunstone committed
33 34 35 36

  def navbar_icon(icon_name)
    render "shared/icons/#{icon_name}.svg"
  end
37
end