Merge commit '15fd712464' into kb_migration

This commit is contained in:
KMY 2023-05-01 15:05:34 +09:00
commit 3a1a6ba39e
289 changed files with 1339 additions and 1337 deletions

View file

@ -118,7 +118,7 @@ module ApplicationHelper
end
def check_icon
content_tag(:svg, tag(:path, 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z'), xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 20 20', fill: 'currentColor')
content_tag(:svg, tag.path('fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z'), xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 20 20', fill: 'currentColor')
end
def visibility_icon(status)
@ -154,19 +154,7 @@ module ApplicationHelper
end
def opengraph(property, content)
tag(:meta, content: content, property: property)
end
def react_component(name, props = {}, &block)
if block.nil?
content_tag(:div, nil, data: { component: name.to_s.camelcase, props: Oj.dump(props) })
else
content_tag(:div, data: { component: name.to_s.camelcase, props: Oj.dump(props) }, &block)
end
end
def react_admin_component(name, props = {})
content_tag(:div, nil, data: { 'admin-component': name.to_s.camelcase, props: Oj.dump({ locale: I18n.locale }.merge(props)) })
tag.meta(content: content, property: property)
end
def body_classes
@ -175,7 +163,7 @@ module ApplicationHelper
output << 'system-font' if current_account&.user&.setting_system_font_ui
output << (current_account&.user&.setting_reduce_motion ? 'reduce-motion' : 'no-reduce-motion')
output << 'rtl' if locale_direction == 'rtl'
output.reject(&:blank?).join(' ')
output.compact_blank.join(' ')
end
def cdn_host
@ -207,7 +195,7 @@ module ApplicationHelper
permit_visibilities = %w(public unlisted public_unlisted private direct)
permit_searchabilities = %w(public unlisted public_unlisted private direct)
default_privacy = current_account&.user&.setting_default_privacy
default_privacy = current_account&.user&.setting_default_privacy
permit_visibilities.shift(permit_visibilities.index(default_privacy) + 1) if default_privacy.present?
state_params[:visibility] = params[:visibility] if permit_visibilities.include? params[:visibility]
default_searchability = current_account&.user&.setting_default_searchability
@ -255,6 +243,8 @@ module ApplicationHelper
end
def prerender_custom_emojis_from_hash(html, custom_emojis_hash)
# rubocop:disable Style/OpenStructUse
prerender_custom_emojis(html, JSON.parse([custom_emojis_hash].to_json, object_class: OpenStruct))
# rubocop:enable Style/OpenStructUse
end
end