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

This commit is contained in:
KMY 2024-10-05 09:10:58 +09:00
commit 66bed31dbe
226 changed files with 2688 additions and 1846 deletions

View file

@ -37,4 +37,11 @@ module Admin::ActionLogsHelper
end
end
end
def sorted_action_log_types
Admin::ActionLogFilter::ACTION_TYPE_MAP
.keys
.map { |key| [I18n.t("admin.action_logs.action_types.#{key}"), key] }
.sort_by(&:first)
end
end

View file

@ -18,6 +18,11 @@ module Admin::DashboardHelper
end
end
def date_range(range)
[l(range.first), l(range.last)]
.join(' - ')
end
def relevant_account_timestamp(account)
timestamp, exact = if account.user_current_sign_in_at && account.user_current_sign_in_at < 24.hours.ago
[account.user_current_sign_in_at, true]
@ -25,6 +30,8 @@ module Admin::DashboardHelper
[account.user_current_sign_in_at, false]
elsif account.user_pending?
[account.user_created_at, true]
elsif account.suspended_at.present? && account.local? && account.user.nil?
[account.suspended_at, true]
elsif account.last_status_at.present?
[account.last_status_at, true]
else

View file

@ -3,12 +3,6 @@
module ApplicationHelper
include RegistrationLimitationHelper
DANGEROUS_SCOPES = %w(
read
write
follow
).freeze
RTL_LOCALES = %i(
ar
ckb
@ -97,8 +91,11 @@ module ApplicationHelper
Rails.env.production? ? site_title : "#{site_title} (Dev)"
end
def class_for_scope(scope)
'scope-danger' if DANGEROUS_SCOPES.include?(scope.to_s)
def label_for_scope(scope)
safe_join [
tag.samp(scope, class: { 'scope-danger' => SessionActivation::DEFAULT_SCOPES.include?(scope.to_s) }),
tag.span(t("doorkeeper.scopes.#{scope}"), class: :hint),
]
end
def can?(action, record)
@ -266,6 +263,10 @@ module ApplicationHelper
current_account&.user&.custom_css&.updated_at.to_s
end
def copyable_input(options = {})
tag.input(type: :text, maxlength: 999, spellcheck: false, readonly: true, **options)
end
private
def storage_host_var

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
module WebfingerHelper
def webfinger!(uri)
Webfinger.new(uri).perform
end
end