_local_account.html.haml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. - if account.avatar?
  2. %tr
  3. %th= t('admin.accounts.avatar')
  4. %td= table_link_to 'trash', 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 'trash', 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 'vcard', 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 'ban', 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?
  51. = table_link_to 'unlock', t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(account.user.id), method: :delete if can?(:disable_2fa, account.user)
  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: :create, 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. - recent_ips = account.user.ips.order(used_at: :desc).to_a
  66. - recent_ips.each_with_index do |recent_ip, i|
  67. %tr
  68. - if i.zero?
  69. %th{ rowspan: recent_ips.size }= t('admin.accounts.most_recent_ip')
  70. %td= recent_ip.ip
  71. %td= table_link_to 'search', t('admin.accounts.search_same_ip'), admin_accounts_path(ip: recent_ip.ip)
  72. %tr
  73. %th= t('admin.accounts.most_recent_activity')
  74. %td
  75. - if account.user_current_sign_in_at
  76. %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
  77. %td
  78. - if account.user&.invited?
  79. %tr
  80. %th= t('admin.accounts.invited_by')
  81. %td= admin_account_link_to account.user.invite.user.account
  82. %td