AlchemyCMS/alchemy-devise

View on GitHub
app/views/alchemy/admin/users/_user.html.erb

Summary

Maintainability
Test Coverage
<tr class="<%= cycle('even', 'odd') %>">
  <td class="icon">
    <%= render_icon(:user, style: user.logged_in? ? 'solid' : 'regular') %>
  </td>
  <td class="login">
  <% if can?(:edit, user) %>
    <%= link_to_dialog user.login,
      alchemy.edit_admin_user_path(user), {
        title: Alchemy.t(:edit_user),
        overflow: true,
        size: '430x560'
      },
      title: Alchemy.t(:edit_user) %>
  <% end %>
  </td>
  <td class="name"><%= user.firstname %></td>
  <td><%= user.lastname %></td>
  <td class="email"><%= user.email %></td>
  <td><%= Alchemy.t(user.language, scope: 'translations', default: Alchemy.t(:unknown)) %></td>
  <td><%= user.last_sign_in_at.present? ? l(user.last_sign_in_at, format: 'alchemy.default'.to_sym) : Alchemy.t(:unknown) %></td>
  <td class="role"><%= user.human_roles_string %></td>
  <td class="tools">
  <% if can?(:destroy, user) %>
    <%= delete_button alchemy.admin_user_path(user), {
      message: Alchemy.t(:confirm_to_delete_user),
      title: Alchemy.t(:delete_user),
      icon: :minus
    },
    title: Alchemy.t(:delete_user) %>
  <% end %>
  <% if can?(:edit, user) %>
    <%= link_to_dialog render_icon(:edit),
      alchemy.edit_admin_user_path(user), {
        title: Alchemy.t(:edit_user),
        overflow: true,
        size: '430x560'
      },
      title: Alchemy.t(:edit_user) %>
  <% end %>
  </td>
</tr>