app/views/users/index.html.erb

Summary

Maintainability
Test Coverage
<%= page_header title: t('txt.views.users.index.header') %>
<div class="table-responsive">
  <table class="table users-table">
    <thead>
      <tr>
        <th><%= t('txt.views.users.name') %></th>
        <th><%= t('txt.views.users.contact_info') %></th>
        <th><%= t('txt.views.users.role') %></th>
        <th><%= t('txt.views.users.active') %></th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <% @users.each do |user| %>
        <tr class="users-table-row">
          <td><%= user.name %></td>
          <td class="text-nowrap">
            <div><%= icon(:envelope) %> <%= mail_to user.email %></div>
            <% if user.telephone_number.present? %>
              <div><%= icon(:phone) %> <%= user.telephone_number %></div>
            <% end %>
          </td>
          <td><%= user.role.humanize %></td>
          <td><%= icon(:check) if user.active? %></td>
          <td class="text-nowrap">
            <%= link_to t('txt.views.users.edit_link'), edit_user_path(id: user), class: 'btn btn-outline-secondary' %>
            <%= link_to t('txt.views.users.destroy_link'), user_path(id: user), data: { confirm: t('txt.views.users.sure')}, method: :delete, class: "btn btn-danger" %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>

<%= render 'sidebar' %>