first attempt of making favorite people view sortable
This commit is contained in:
parent
dd7ac8e64f
commit
83d4368af7
@ -22,4 +22,8 @@
|
||||
a:hover, a:active {
|
||||
background-color: #009688;
|
||||
}
|
||||
}
|
||||
|
||||
.thumb {
|
||||
width: 3em;
|
||||
}
|
||||
@ -1,7 +1,8 @@
|
||||
class FavoritesController < ApplicationController
|
||||
|
||||
def people
|
||||
@favoritePeople = FavoritePerson.where('user_id': current_user.id)
|
||||
@favorite_people = FavoritePerson.where('user_id': current_user.id)
|
||||
.order(params[:sort])
|
||||
@host = 'https://tiss.tuwien.ac.at'
|
||||
end
|
||||
|
||||
|
||||
@ -1,25 +1,56 @@
|
||||
<%= render(:partial => "nav")%>
|
||||
<%= render(:partial => "nav") %>
|
||||
|
||||
<h1>Favorite People</h1>
|
||||
|
||||
<ul class="people-list">
|
||||
<% @favoritePeople.each do |person| %>
|
||||
<li class="person">
|
||||
<%= link_to crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) do %>
|
||||
<span class="list-link">
|
||||
<span class="person-icon">
|
||||
<!--<ul class="people-list">-->
|
||||
<%# @favorite_people.each do |person| %>
|
||||
<!-- <li class="person">-->
|
||||
<%#= link_to crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) do %>
|
||||
<!-- <span class="list-link">-->
|
||||
<!-- <span class="person-icon">-->
|
||||
<%# if person['picture_uri'] != nil %>
|
||||
<%#= image_tag @host + person['picture_uri'] %>
|
||||
<%# else %>
|
||||
<%#= show_svg('account_circle-black-48dp.svg') %>
|
||||
<%# end %>
|
||||
<!-- </span>-->
|
||||
<!-- <span class="person-name">-->
|
||||
<%#= person['first_name'] %>
|
||||
<%#= person['last_name'] %>
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
<%# end %>
|
||||
<!-- </li>-->
|
||||
<%# end %>
|
||||
<!--</ul>-->
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Thumb</th>
|
||||
<th><%= link_to "First Name", :sort => "first_name" %></th>
|
||||
<th><%= link_to "Last Name", :sort => "last_name" %></th>
|
||||
<th><%= link_to "Registration Date", :sort => "created_at" %></th>
|
||||
</tr>
|
||||
<% for person in @favorite_people %>
|
||||
<tr>
|
||||
<td>
|
||||
<span>
|
||||
<% if person['picture_uri'] != nil %>
|
||||
<%= image_tag @host + person['picture_uri'] %>
|
||||
<%= image_tag @host + person['picture_uri'], class: 'thumb'%>
|
||||
<% else %>
|
||||
<%= show_svg('account_circle-black-48dp.svg') %>
|
||||
<%= show_svg('account_circle-black-48dp.svg')%>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="person-name">
|
||||
<%= person['first_name'] %>
|
||||
<%= person['last_name'] %>
|
||||
</span>
|
||||
</span>
|
||||
<% end %>
|
||||
</li>
|
||||
</td>
|
||||
<td>
|
||||
<%= person['first_name'] %>
|
||||
</td>
|
||||
<td>
|
||||
<%= person['last_name'] %>
|
||||
</td>
|
||||
<td>
|
||||
<%= person['created_at'] %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</ul>
|
||||
</table>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user