diff options
Diffstat (limited to 'app/helpers/appearances_helper.rb')
-rw-r--r-- | app/helpers/appearances_helper.rb | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/app/helpers/appearances_helper.rb b/app/helpers/appearances_helper.rb index ab743e27603..e9465e0db22 100644 --- a/app/helpers/appearances_helper.rb +++ b/app/helpers/appearances_helper.rb @@ -4,14 +4,40 @@ module AppearancesHelper include MarkupHelper include Gitlab::Utils::StrongMemoize - def appearance_short_name - Appearance.current&.pwa_short_name.presence || _('GitLab') + def appearance_pwa_icon_path_scaled(width) + return unless Appearance::ALLOWED_PWA_ICON_SCALER_WIDTHS.include?(width) + + append_root_path((current_appearance&.pwa_icon_path_scaled(width) || "/-/pwa-icons/logo-#{width}.png")) + end + + def appearance_maskable_logo + append_root_path('/-/pwa-icons/maskable-logo.png') + end + + def append_root_path(path) + Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, path) end def brand_title current_appearance&.title.presence || default_brand_title end + def appearance_pwa_name + current_appearance&.pwa_name.presence || _('GitLab') + end + + def appearance_pwa_short_name + current_appearance&.pwa_short_name.presence || _('GitLab') + end + + def appearance_pwa_description + current_appearance&.pwa_description.presence || + _("The complete DevOps platform. " \ + "One application with endless possibilities. " \ + "Organizations rely on GitLab’s source code management, " \ + "CI/CD, security, and more to deliver software rapidly.") + end + def default_brand_title # This resides in a separate method so that EE can easily redefine it. _('GitLab Community Edition') |