Merge commit 'f877aa9d70
' into kb_migration
This commit is contained in:
commit
32f0e619f0
440 changed files with 6249 additions and 3435 deletions
|
@ -32,10 +32,6 @@ module ApplicationHelper
|
|||
paths.any? { |path| current_page?(path) } ? 'active' : ''
|
||||
end
|
||||
|
||||
def active_link_to(label, path, **options)
|
||||
link_to label, path, options.merge(class: active_nav_class(path))
|
||||
end
|
||||
|
||||
def show_landing_strip?
|
||||
!user_signed_in? && !single_user_mode?
|
||||
end
|
||||
|
@ -149,7 +145,7 @@ module ApplicationHelper
|
|||
if prefers_autoplay?
|
||||
image_tag(custom_emoji.image.url, class: 'emojione', alt: ":#{custom_emoji.shortcode}:")
|
||||
else
|
||||
image_tag(custom_emoji.image.url(:static), class: 'emojione custom-emoji', alt: ":#{custom_emoji.shortcode}", 'data-original' => full_asset_url(custom_emoji.image.url), 'data-static' => full_asset_url(custom_emoji.image.url(:static)))
|
||||
image_tag(custom_emoji.image.url(:static), :class => 'emojione custom-emoji', :alt => ":#{custom_emoji.shortcode}", 'data-original' => full_asset_url(custom_emoji.image.url), 'data-static' => full_asset_url(custom_emoji.image.url(:static)))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -175,11 +171,11 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def storage_host
|
||||
"https://#{ENV['S3_ALIAS_HOST'].presence || ENV['S3_CLOUDFRONT_HOST']}"
|
||||
URI::HTTPS.build(host: storage_host_name).to_s
|
||||
end
|
||||
|
||||
def storage_host?
|
||||
ENV['S3_ALIAS_HOST'].present? || ENV['S3_CLOUDFRONT_HOST'].present?
|
||||
storage_host_name.present?
|
||||
end
|
||||
|
||||
def quote_wrap(text, line_width: 80, break_sequence: "\n")
|
||||
|
@ -247,4 +243,10 @@ module ApplicationHelper
|
|||
prerender_custom_emojis(html, JSON.parse([custom_emojis_hash].to_json, object_class: OpenStruct))
|
||||
# rubocop:enable Style/OpenStructUse
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def storage_host_name
|
||||
ENV.fetch('S3_ALIAS_HOST', nil) || ENV.fetch('S3_CLOUDFRONT_HOST', nil)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue