diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /app/helpers/application_helper.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 340f3d45365..c78563a9a5f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -124,7 +124,7 @@ module ApplicationHelper end def simple_sanitize(str) - sanitize(str, tags: %w(a span)) + sanitize(str, tags: %w[a span]) end def body_data @@ -187,14 +187,14 @@ module ApplicationHelper css_classes << html_class unless html_class.blank? content_tag :time, l(time, format: "%b %d, %Y"), - class: css_classes.join(' '), - title: l(time.to_time.in_time_zone, format: :timeago_tooltip), - datetime: time.to_time.getutc.iso8601, - data: { - toggle: 'tooltip', - placement: placement, - container: 'body' - } + class: css_classes.join(' '), + title: l(time.to_time.in_time_zone, format: :timeago_tooltip), + datetime: time.to_time.getutc.iso8601, + data: { + toggle: 'tooltip', + placement: placement, + container: 'body' + } end def edited_time_ago_with_tooltip(object, placement: 'top', html_class: 'time_ago', exclude_author: false) @@ -234,11 +234,11 @@ module ApplicationHelper end def promo_url - 'https://' + promo_host + "https://#{promo_host}" end def support_url - Gitlab::CurrentSettings.current_application_settings.help_page_support_url.presence || promo_url + '/getting-help/' + Gitlab::CurrentSettings.current_application_settings.help_page_support_url.presence || "#{promo_url}/getting-help/" end def instance_review_permitted? @@ -279,7 +279,19 @@ module ApplicationHelper end def stylesheet_link_tag_defer(path) - stylesheet_link_tag(path, media: "print", crossorigin: ActionController::Base.asset_host ? 'anonymous' : nil) + if startup_css_enabled? + stylesheet_link_tag(path, media: "print", crossorigin: ActionController::Base.asset_host ? 'anonymous' : nil) + else + stylesheet_link_tag(path, crossorigin: ActionController::Base.asset_host ? 'anonymous' : nil) + end + end + + def startup_css_enabled? + !params.has_key?(:no_startup_css) + end + + def use_new_fonts? + Feature.enabled?(:new_fonts, current_user) || request.params.has_key?(:new_fonts) end def outdated_browser? |