evodata/app/views/users/index.html.erb
2022-01-22 18:30:59 +01:00

68 lines
3 KiB
Plaintext

<div class="w-full">
<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Users</h1>
<%= link_to 'New user', new_user_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
</div>
<div id="users" class="min-w-full px-4 py-8 sm:px-0">
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
<div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Gravatar
</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Email
</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Name
</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Created at
</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Updated at
</th>
<th scope="col" class="relative px-6 py-3">
<span class="sr-only">Edit</span>
</th>
</tr>
</thead>
<tbody>
<% @users.each do |user| %>
<tr class="<%= cycle("bg-white", "bg-gray-50") %>">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
<%= user_gravatar current_user, class: "h-10 w-10 rounded-full", size: 80 %>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
<%= user.email %>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
<%= user.name %>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<%= user.created_at %>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<%= user.updated_at %>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<%= link_to "Show", user, class: "text-indigo-600 hover:text-indigo-900" %>
<%= link_to 'Edit', edit_user_path(user), class: "text-indigo-600 hover:text-indigo-900" %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>