Use field partial in admin account show view (#35503)
This commit is contained in:
9
app/views/admin/accounts/_field.html.haml
Normal file
9
app/views/admin/accounts/_field.html.haml
Normal file
@@ -0,0 +1,9 @@
|
||||
-# locals: (field:, account:)
|
||||
%dl
|
||||
%dt.emojify{ title: field.name }
|
||||
= prerender_custom_emojis(h(field.name), account.emojis)
|
||||
%dd{ title: field.value, class: field_verified_class(field.verified?) }
|
||||
- if field.verified?
|
||||
%span.verified__mark{ title: t('accounts.link_verified_on', date: l(field.verified_at)) }
|
||||
= material_symbol 'check'
|
||||
= prerender_custom_emojis(account_field_value_format(field, with_rel_me: false), account.emojis)
|
||||
@@ -7,25 +7,17 @@
|
||||
|
||||
= render 'application/card', account: @account
|
||||
|
||||
- account = @account
|
||||
- fields = account.fields
|
||||
- unless fields.empty? && account.note.blank?
|
||||
- if @account.fields? || @account.note?
|
||||
.admin-account-bio
|
||||
- unless fields.empty?
|
||||
- if @account.fields?
|
||||
%div
|
||||
.account__header__fields
|
||||
- fields.each do |field|
|
||||
%dl
|
||||
%dt.emojify{ title: field.name }= prerender_custom_emojis(h(field.name), account.emojis)
|
||||
%dd{ title: field.value, class: custom_field_classes(field) }
|
||||
- if field.verified?
|
||||
%span.verified__mark{ title: t('accounts.link_verified_on', date: l(field.verified_at)) }
|
||||
= material_symbol 'check'
|
||||
= prerender_custom_emojis(account_field_value_format(field, with_rel_me: false), account.emojis)
|
||||
= render partial: 'field', collection: @account.fields, locals: { account: @account }
|
||||
|
||||
- if account.note.present?
|
||||
- if @account.note?
|
||||
%div
|
||||
.account__header__content.emojify= prerender_custom_emojis(account_bio_format(account), account.emojis)
|
||||
.account__header__content.emojify
|
||||
= prerender_custom_emojis(account_bio_format(@account), @account.emojis)
|
||||
|
||||
= render 'admin/accounts/counters', account: @account
|
||||
|
||||
|
||||
Reference in New Issue
Block a user