app/views/admin/users/index.html.slim

Summary

Maintainability
Test Coverage
= title User.model_name.human(count: :lots)
.container
  == render 'shared/flash_messages'
  .page-header
    h1
      = yield :title
      small< = @users.count
  .table-responsive
    table.table
      thead
        th = User.human_attribute_name :name
        th = User.human_attribute_name :email
        th = t('helpers.actions')
      tbody
        - @users.each do |user|
          tr.align-middle
            td = link_to user, user_path(user)
            td = user.email
            td
              - if user.banned?
                = link_to unban_admin_user_path(user.id), method: :post, data: { confirm: t('helpers.links.confirm') }, class: 'btn btn-sm btn-warning' do
                  = t('helpers.links.user.unban')
              - else
                = link_to ban_admin_user_path(user.id), method: :post, data: { confirm: t('helpers.links.confirm') }, class: 'btn btn-sm btn-warning' do
                  span.fas.fa-ban<>
                  = t('helpers.links.user.ban')
                = link_to login_as_admin_user_path(user.id), method: :get, class: 'btn btn-sm btn-secondary ms-2' do
                  span.fas.fa-sign-in-alt<>
                  = t('.login_as')
  == paginate @users