Welcome to mirror list, hosted at ThFree Co, Russian Federation.

appearances_helper.rb « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f48db024e3fdc0f6d054a32056e98b05b4396fd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module AppearancesHelper
  def brand_title
    current_appearance&.title.presence || 'GitLab Community Edition'
  end

  def brand_image
    image_tag(current_appearance.logo) if current_appearance&.logo?
  end

  def brand_text
    markdown_field(current_appearance, :description)
  end

  def brand_new_project_guidelines
    markdown_field(current_appearance, :new_project_guidelines)
  end

  def current_appearance
    @appearance ||= Appearance.current
  end

  def brand_header_logo
    if current_appearance&.header_logo?
      image_tag current_appearance.header_logo
    else
      render 'shared/logo.svg'
    end
  end

  # Skip the 'GitLab' type logo when custom brand logo is set
  def brand_header_logo_type
    unless current_appearance&.header_logo?
      render 'shared/logo_type.svg'
    end
  end
end