diff options
author | Markus Koller <markus.koller.ext@siemens.com> | 2017-11-22 14:48:38 +0100 |
---|---|---|
committer | Markus Koller <markus.koller.ext@siemens.com> | 2017-12-04 17:22:59 +0100 |
commit | b8a393192529015bc2fa9d04c2782cf96e7ec896 (patch) | |
tree | fdf99629e27efe4b6ecfbe30228589eb22df0001 /app/helpers/appearances_helper.rb | |
parent | 0f3f50d188e5c3f458d65b91765f080288cb06ab (diff) | |
download | gitlab-ce-b8a393192529015bc2fa9d04c2782cf96e7ec896.tar.gz |
Add custom brand text on new project pages
Diffstat (limited to 'app/helpers/appearances_helper.rb')
-rw-r--r-- | app/helpers/appearances_helper.rb | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/app/helpers/appearances_helper.rb b/app/helpers/appearances_helper.rb index df590cf47c8..c037de33c22 100644 --- a/app/helpers/appearances_helper.rb +++ b/app/helpers/appearances_helper.rb @@ -1,30 +1,26 @@ module AppearancesHelper def brand_title - if brand_item && brand_item.title - brand_item.title - else - 'GitLab Community Edition' - end + brand_item&.title.presence || 'GitLab Community Edition' end def brand_image - if brand_item.logo? - image_tag brand_item.logo - else - nil - end + image_tag(brand_item.logo) if brand_item&.logo? end def brand_text markdown_field(brand_item, :description) end + def brand_new_project_guidelines + markdown_field(brand_item, :new_project_guidelines) + end + def brand_item @appearance ||= Appearance.current end def brand_header_logo - if brand_item && brand_item.header_logo? + if brand_item&.header_logo? image_tag brand_item.header_logo else render 'shared/logo.svg' @@ -33,7 +29,7 @@ module AppearancesHelper # Skip the 'GitLab' type logo when custom brand logo is set def brand_header_logo_type - unless brand_item && brand_item.header_logo? + unless brand_item&.header_logo? render 'shared/logo_type.svg' end end |