|
2 | 2 |
|
3 | 3 | <div class="w-full">
|
4 | 4 | <%% if notice.present? %>
|
5 |
| - <p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%%= notice %></p> |
| 5 | + <p class="inline-block px-3 py-2 mb-5 font-medium text-green-500 rounded-md bg-green-50" id="notice"><%%= notice %></p> |
6 | 6 | <%% end %>
|
7 | 7 |
|
8 |
| - <div class="flex justify-between items-center"> |
9 |
| - <h1 class="font-bold text-4xl"><%= human_name.pluralize %></h1> |
| 8 | + <div class="flex items-center justify-between"> |
| 9 | + <h1 class="text-4xl font-bold"><%= human_name.pluralize %></h1> |
10 | 10 | <%%= link_to "New <%= human_name.downcase %>", new_<%= singular_route_name %>_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
|
11 | 11 | </div>
|
12 | 12 |
|
13 |
| - <div id="<%= plural_table_name %>" class="min-w-full"> |
| 13 | + <div id="<%= plural_table_name %>" class="inline-block min-w-full mt-10"> |
14 | 14 | <%% if @<%= plural_table_name %>.any? %>
|
15 |
| - <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> |
16 |
| - <%%= render <%= singular_table_name %> %> |
17 |
| - <p> |
18 |
| - <%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %> |
19 |
| - </p> |
20 |
| - <%% end %> |
| 15 | + <table class="min-w-full divide-y divide-gray-300"> |
| 16 | + <thead> |
| 17 | + <tr> |
| 18 | +<% attributes.reject(&:password_digest?).each do |attribute| -%> |
| 19 | + <th class="py-3.5 text-left font-semibold"><%= attribute.human_name %></th> |
| 20 | +<% end -%> |
| 21 | + <th class="py-3.5 text-left font-semibold">Actions</th> |
| 22 | + </tr> |
| 23 | + </thead> |
| 24 | + <tbody class="divide-y divide-gray-200"> |
| 25 | + <%% @users.each do |user| %> |
| 26 | + <tr class="border-b"> |
| 27 | +<% attributes.reject(&:password_digest?).each do |attribute| -%> |
| 28 | + <td class="py-4 whitespace-nowrap"><%%= <%= singular_name %>.<%= attribute.column_name %> %></td> |
| 29 | +<% end -%> |
| 30 | + <td class="py-4 space-x-4 whitespace-nowrap"> |
| 31 | + <%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "text-blue-600 hover:text-blue-900" %> |
| 32 | + </td> |
| 33 | + </tr> |
| 34 | + <%% end %> |
| 35 | + </tbody> |
| 36 | + </table> |
21 | 37 | <%% else %>
|
22 |
| - <p class="text-center my-10">No <%= human_name.downcase.pluralize %> found.</p> |
| 38 | + <p class="my-10 text-center">No <%= human_name.downcase.pluralize %> found.</p> |
23 | 39 | <%% end %>
|
24 | 40 | </div>
|
25 | 41 | </div>
|
0 commit comments