style the table

This commit is contained in:
Pfingstfrosch 2020-05-16 15:06:42 +02:00
parent 6922f31bc5
commit b11ef548b6
2 changed files with 67 additions and 34 deletions

View File

@ -27,3 +27,24 @@
.thumb { .thumb {
width: 3em; width: 3em;
} }
.table_wrapper {
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 8px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th .asc {
background-image: url("app/assets/images/up.png");
}
th .desc {
background-image: url("app/assets/images/down.png");
}
}

View File

@ -24,17 +24,21 @@
<%# end %> <%# end %>
<!--</ul>--> <!--</ul>-->
<% if !@favorite_people[0].blank? %>
<div class="table_wrapper">
<table> <table>
<tr> <tr>
<th>Thumb</th> <th></th>
<th><%= sortable "First Name", "first_name" %></th> <th><%= sortable "First Name", "first_name" %></th>
<th><%= sortable "Last Name", "last_name" %></th> <th><%= sortable "Last Name", "last_name" %></th>
<th><%= sortable "Registration Date", "created_at" %></th> <th><%= sortable "Registration Date", "created_at" %></th>
<th>Del</th> <th></th>
<th></th>
</tr> </tr>
<% for person in @favorite_people %> <% for person in @favorite_people %>
<tr> <tr>
<td> <td>
<%= link_to crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) do %>
<span> <span>
<% if person['picture_uri'] != nil %> <% if person['picture_uri'] != nil %>
<%= image_tag @host + person['picture_uri'], class: 'thumb'%> <%= image_tag @host + person['picture_uri'], class: 'thumb'%>
@ -42,6 +46,7 @@
<%= show_svg('account_circle-black-48dp.svg')%> <%= show_svg('account_circle-black-48dp.svg')%>
<% end %> <% end %>
</span> </span>
<% end %>
</td> </td>
<td> <td>
<%= person['first_name'] %> <%= person['first_name'] %>
@ -53,8 +58,15 @@
<%= person['created_at'] %> <%= person['created_at'] %>
</td> </td>
<td> <td>
<%= link_to "X", {:action => "delete_person", :tiss_id => person['tiss_id']}, :method => 'delete' %> <%= button_to 'Details', crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) %>
</td>
<td>
<%= button_to "Delete", {:action => "delete_person", :tiss_id => person['tiss_id']}, :method => 'delete' %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</table> </table>
</div>
<% else %>
No favorite people added yet!
<% end %>