Module: AppearancesHelper
Instance Method Summary
collapse
#clear_memoization, #strong_memoize, #strong_memoized?
#asciidoc?, #cross_project_reference, #first_line_in_markdown, #gitlab_markdown?, #link_to_html, #link_to_markdown, #link_to_markdown_field, #markdown, #markdown_field, #markup, #markup?, #markup_unsafe, #plain?, #render_wiki_content
Instance Method Details
#brand_header_logo ⇒ Object
38
39
40
41
42
43
44
|
# File 'app/helpers/appearances_helper.rb', line 38
def brand_header_logo
if current_appearance&.
image_tag current_appearance., class: 'brand-header-logo'
else
render 'shared/logo.svg'
end
end
|
#brand_header_logo_type ⇒ Object
Skip the 'GitLab' type logo when custom brand logo is set
47
48
49
50
51
|
# File 'app/helpers/appearances_helper.rb', line 47
def brand_header_logo_type
unless current_appearance&.
render 'shared/logo_type.svg'
end
end
|
#brand_image ⇒ Object
16
17
18
|
# File 'app/helpers/appearances_helper.rb', line 16
def brand_image
image_tag(current_appearance.logo_path) if current_appearance&.logo?
end
|
#brand_new_project_guidelines ⇒ Object
24
25
26
|
# File 'app/helpers/appearances_helper.rb', line 24
def brand_new_project_guidelines
markdown_field(current_appearance, :new_project_guidelines)
end
|
#brand_profile_image_guidelines ⇒ Object
28
29
30
|
# File 'app/helpers/appearances_helper.rb', line 28
def brand_profile_image_guidelines
markdown_field(current_appearance, :profile_image_guidelines)
end
|
#brand_text ⇒ Object
20
21
22
|
# File 'app/helpers/appearances_helper.rb', line 20
def brand_text
markdown_field(current_appearance, :description)
end
|
#brand_title ⇒ Object
7
8
9
|
# File 'app/helpers/appearances_helper.rb', line 7
def brand_title
current_appearance&.title.presence || default_brand_title
end
|
#current_appearance ⇒ Object
32
33
34
35
36
|
# File 'app/helpers/appearances_helper.rb', line 32
def current_appearance
strong_memoize(:current_appearance) do
Appearance.current
end
end
|
#default_brand_title ⇒ Object
11
12
13
14
|
# File 'app/helpers/appearances_helper.rb', line 11
def default_brand_title
'GitLab Community Edition'
end
|
62
63
64
65
66
|
# File 'app/helpers/appearances_helper.rb', line 62
def
return unless current_appearance&.
render_message(:footer_message)
end
|
53
54
55
56
57
58
59
60
|
# File 'app/helpers/appearances_helper.rb', line 53
def
return unless current_appearance&.
class_names = []
class_names << 'with-performance-bar' if performance_bar_enabled?
render_message(:header_message, class_names: class_names)
end
|