Merge remote-tracking branch 'parent/main' into upstream-20240118

This commit is contained in:
KMY 2024-01-18 09:17:39 +09:00
commit 2b51fabe9c
397 changed files with 2899 additions and 3252 deletions

View file

@ -27,20 +27,24 @@ module AccountsHelper
end
end
def account_formatted_stat(value)
number_to_human(value, precision: 3, strip_insignificant_zeros: true)
end
def account_description(account)
prepend_str = [
[
number_to_human(account.public_statuses_count, precision: 3, strip_insignificant_zeros: true),
account_formatted_stat(account.public_statuses_count),
I18n.t('accounts.posts', count: account.public_statuses_count),
].join(' '),
[
number_to_human(account.public_following_count, precision: 3, strip_insignificant_zeros: true),
account_formatted_stat(account.public_following_count),
I18n.t('accounts.following', count: account.public_following_count),
].join(' '),
[
number_to_human(account.public_followers_count, precision: 3, strip_insignificant_zeros: true),
account_formatted_stat(account.public_followers_count),
I18n.t('accounts.followers', count: account.public_followers_count),
].join(' '),
].join(', ')

View file

@ -2,7 +2,7 @@
module MascotHelper
def mascot_url
full_asset_url(instance_presenter.mascot&.file&.url || asset_pack_path('media/images/elephant_ui_plane.svg'))
full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg'))
end
def instance_presenter

View file

@ -24,8 +24,12 @@ module RoutingHelper
Rails.configuration.action_controller.asset_host || root_url
end
def full_pack_url(source, **options)
full_asset_url(asset_pack_path(source, **options))
def frontend_asset_path(source, **options)
asset_pack_path("media/#{source}", **options)
end
def frontend_asset_url(source, **options)
full_asset_url(frontend_asset_path(source, **options))
end
def use_storage?