_local_account.html.haml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. - if account.avatar?
  2. %tr
  3. %th= t('admin.accounts.avatar')
  4. %td= table_link_to 'delete', t('admin.accounts.remove_avatar'), remove_avatar_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:remove_avatar, account)
  5. %td
  6. - if account.header?
  7. %tr
  8. %th= t('admin.accounts.header')
  9. %td= table_link_to 'delete', t('admin.accounts.remove_header'), remove_header_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:remove_header, account)
  10. %td
  11. %tr
  12. %th= t('admin.accounts.role')
  13. %td
  14. - if account.user_role&.everyone?
  15. = t('admin.accounts.no_role_assigned')
  16. - else
  17. = account.user_role&.name
  18. %td
  19. = table_link_to 'contact_mail', t('admin.accounts.change_role.label'), admin_user_role_path(account.user) if can?(:change_role, account.user)
  20. %tr
  21. %th{ rowspan: can?(:create, :email_domain_block) ? 3 : 2 }= t('admin.accounts.email')
  22. %td{ rowspan: can?(:create, :email_domain_block) ? 3 : 2 }= account.user_email
  23. %td= table_link_to 'edit', t('admin.accounts.change_email.label'), admin_account_change_email_path(account.id) if can?(:change_email, account.user)
  24. %tr
  25. %td= table_link_to 'search', t('admin.accounts.search_same_email_domain'), admin_accounts_path(email: "%@#{account.user_email.split('@').last}")
  26. - if can?(:create, :email_domain_block)
  27. %tr
  28. %td= table_link_to 'hide_source', t('admin.accounts.add_email_domain_block'), new_admin_email_domain_block_path(_domain: account.user_email.split('@').last)
  29. - if account.user_unconfirmed_email.present?
  30. %tr
  31. %th= t('admin.accounts.unconfirmed_email')
  32. %td= account.user_unconfirmed_email
  33. %td
  34. %tr
  35. %th= t('admin.accounts.email_status')
  36. %td
  37. - if account.user&.confirmed?
  38. = t('admin.accounts.confirmed')
  39. - else
  40. = t('admin.accounts.confirming')
  41. %td= table_link_to 'refresh', t('admin.accounts.resend_confirmation.send'), resend_admin_account_confirmation_path(account.id), method: :post if can?(:confirm, account.user)
  42. %tr
  43. %th{ rowspan: can?(:reset_password, account.user) ? 2 : 1 }= t('admin.accounts.security')
  44. %td{ rowspan: can?(:reset_password, account.user) ? 2 : 1 }
  45. - if account.user&.two_factor_enabled?
  46. = t 'admin.accounts.security_measures.password_and_2fa'
  47. - else
  48. = t 'admin.accounts.security_measures.only_password'
  49. %td
  50. - if account.user&.two_factor_enabled? && can?(:disable_2fa, account.user)
  51. = table_link_to 'lock_open', t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(account.user.id), method: :delete
  52. - if can?(:reset_password, account.user)
  53. %tr
  54. %td
  55. = table_link_to 'key', t('admin.accounts.reset_password'), admin_account_reset_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
  56. %tr
  57. %th= t('simple_form.labels.defaults.locale')
  58. %td= standard_locale_name(account.user_locale)
  59. %td
  60. %tr
  61. %th= t('admin.accounts.joined')
  62. %td
  63. %time.formatted{ datetime: account.created_at.iso8601, title: l(account.created_at) }= l account.created_at
  64. %td
  65. = render partial: 'admin/accounts/user_ip', collection: account.user.ips.by_latest_used
  66. %tr
  67. %th= t('admin.accounts.most_recent_activity')
  68. %td
  69. - if account.user_current_sign_in_at
  70. %time.formatted{ datetime: account.user_current_sign_in_at.iso8601, title: l(account.user_current_sign_in_at) }= l account.user_current_sign_in_at
  71. %td
  72. - if account.user&.invited?
  73. %tr
  74. %th= t('admin.accounts.invited_by')
  75. %td= admin_account_link_to account.user.invite.user.account
  76. %td