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

@ -26,4 +26,25 @@
.thumb {
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,37 +24,49 @@
<%# end %>
<!--</ul>-->
<table>
<tr>
<th>Thumb</th>
<th><%= sortable "First Name", "first_name" %></th>
<th><%= sortable "Last Name", "last_name" %></th>
<th><%= sortable "Registration Date", "created_at" %></th>
<th>Del</th>
</tr>
<% for person in @favorite_people %>
<tr>
<td>
<span>
<% if person['picture_uri'] != nil %>
<%= image_tag @host + person['picture_uri'], class: 'thumb'%>
<% else %>
<%= show_svg('account_circle-black-48dp.svg')%>
<% end %>
</span>
</td>
<td>
<%= person['first_name'] %>
</td>
<td>
<%= person['last_name'] %>
</td>
<td>
<%= person['created_at'] %>
</td>
<td>
<%= link_to "X", {:action => "delete_person", :tiss_id => person['tiss_id']}, :method => 'delete' %>
</td>
</tr>
<% end %>
</table>
<% if !@favorite_people[0].blank? %>
<div class="table_wrapper">
<table>
<tr>
<th></th>
<th><%= sortable "First Name", "first_name" %></th>
<th><%= sortable "Last Name", "last_name" %></th>
<th><%= sortable "Registration Date", "created_at" %></th>
<th></th>
<th></th>
</tr>
<% for person in @favorite_people %>
<tr>
<td>
<%= link_to crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) do %>
<span>
<% if person['picture_uri'] != nil %>
<%= image_tag @host + person['picture_uri'], class: 'thumb'%>
<% else %>
<%= show_svg('account_circle-black-48dp.svg')%>
<% end %>
</span>
<% end %>
</td>
<td>
<%= person['first_name'] %>
</td>
<td>
<%= person['last_name'] %>
</td>
<td>
<%= person['created_at'] %>
</td>
<td>
<%= 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>
</tr>
<% end %>
</table>
</div>
<% else %>
No favorite people added yet!
<% end %>