From b11ef548b652db54c7b1e11f3d7a9511c9522c81 Mon Sep 17 00:00:00 2001 From: Pfingstfrosch Date: Sat, 16 May 2020 15:06:42 +0200 Subject: [PATCH] style the table --- app/assets/stylesheets/favorites.scss | 21 +++++++ app/views/favorites/people.html.erb | 80 +++++++++++++++------------ 2 files changed, 67 insertions(+), 34 deletions(-) diff --git a/app/assets/stylesheets/favorites.scss b/app/assets/stylesheets/favorites.scss index c3f5840..f500a8d 100644 --- a/app/assets/stylesheets/favorites.scss +++ b/app/assets/stylesheets/favorites.scss @@ -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"); + } } \ No newline at end of file diff --git a/app/views/favorites/people.html.erb b/app/views/favorites/people.html.erb index 5e5de03..c0db7db 100644 --- a/app/views/favorites/people.html.erb +++ b/app/views/favorites/people.html.erb @@ -24,37 +24,49 @@ <%# end %> - - - - - - - - - <% for person in @favorite_people %> - - - - - - - - <% end %> -
Thumb<%= sortable "First Name", "first_name" %><%= sortable "Last Name", "last_name" %><%= sortable "Registration Date", "created_at" %>Del
- - <% if person['picture_uri'] != nil %> - <%= image_tag @host + person['picture_uri'], class: 'thumb'%> - <% else %> - <%= show_svg('account_circle-black-48dp.svg')%> - <% end %> - - - <%= person['first_name'] %> - - <%= person['last_name'] %> - - <%= person['created_at'] %> - - <%= link_to "X", {:action => "delete_person", :tiss_id => person['tiss_id']}, :method => 'delete' %> -
+<% if !@favorite_people[0].blank? %> +
+ + + + + + + + + + <% for person in @favorite_people %> + + + + + + + + + <% end %> +
<%= sortable "First Name", "first_name" %><%= sortable "Last Name", "last_name" %><%= sortable "Registration Date", "created_at" %>
+ <%= link_to crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) do %> + + <% if person['picture_uri'] != nil %> + <%= image_tag @host + person['picture_uri'], class: 'thumb'%> + <% else %> + <%= show_svg('account_circle-black-48dp.svg')%> + <% end %> + + <% end %> + + <%= person['first_name'] %> + + <%= person['last_name'] %> + + <%= person['created_at'] %> + + <%= button_to 'Details', crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) %> + + <%= button_to "Delete", {:action => "delete_person", :tiss_id => person['tiss_id']}, :method => 'delete' %> +
+
+<% else %> + No favorite people added yet! +<% end %> \ No newline at end of file