added sorting arrow for favorites view
This commit is contained in:
parent
cfcbf5acdb
commit
ad85619ccc
@ -44,6 +44,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tr:nth-child(odd) {
|
tr:nth-child(odd) {
|
||||||
th, td {
|
th, td {
|
||||||
//padding: 8px;
|
//padding: 8px;
|
||||||
|
|||||||
@ -3,4 +3,15 @@ module FavoritesHelper
|
|||||||
direction = column == sort_column && sort_direction == 'asc' ? 'desc' : 'asc'
|
direction = column == sort_column && sort_direction == 'asc' ? 'desc' : 'asc'
|
||||||
link_to title, :sort => column, :direction => direction
|
link_to title, :sort => column, :direction => direction
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sorting_arrow(column)
|
||||||
|
if sort_column == column
|
||||||
|
direction = column == sort_column && sort_direction == 'asc' ? 'desc' : 'asc'
|
||||||
|
if direction == 'asc'
|
||||||
|
image_tag 'up.png'
|
||||||
|
else
|
||||||
|
image_tag 'down.png'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
4
app/views/favorites/_th.html.erb
Normal file
4
app/views/favorites/_th.html.erb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<th>
|
||||||
|
<%= sortable display, column %>
|
||||||
|
<%= sorting_arrow column %>
|
||||||
|
</th>
|
||||||
@ -6,8 +6,8 @@
|
|||||||
<div class="table_wrapper">
|
<div class="table_wrapper">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= sortable "Title", "title" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "Title", :column => "title"} %>
|
||||||
<th><%= sortable "Registration Date", "created_at" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "Registration Date", :column => "created_at"} %>
|
||||||
</tr>
|
</tr>
|
||||||
<% for course in @favorite_courses %>
|
<% for course in @favorite_courses %>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -2,36 +2,14 @@
|
|||||||
|
|
||||||
<h2>Favorite People</h2>
|
<h2>Favorite People</h2>
|
||||||
|
|
||||||
<!--<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>-->
|
|
||||||
|
|
||||||
<% if !@favorite_people[0].blank? %>
|
<% if !@favorite_people[0].blank? %>
|
||||||
<div class="table_wrapper">
|
<div class="table_wrapper">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th><%= sortable "First Name", "first_name" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "First Name", :column => "first_name"} %>
|
||||||
<th><%= sortable "Last Name", "last_name" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "Last Name", :column => "last_name"} %>
|
||||||
<th><%= sortable "Registration Date", "created_at" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "Registration Date", :column => "created_at"} %>
|
||||||
</tr>
|
</tr>
|
||||||
<% for person in @favorite_people %>
|
<% for person in @favorite_people %>
|
||||||
<tr>
|
<tr>
|
||||||
@ -39,9 +17,9 @@
|
|||||||
<%= link_to crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) do %>
|
<%= 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' %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= show_svg('account_circle-black-48dp.svg')%>
|
<%= show_svg('account_circle-black-48dp.svg') %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
<div class="table_wrapper">
|
<div class="table_wrapper">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= sortable "Title", "title" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "Title", :column => "title"} %>
|
||||||
<th><%= sortable "Registration Date", "created_at" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "Registration Date", :column => "created_at"} %>
|
||||||
</tr>
|
</tr>
|
||||||
<% for project in @favorite_projects %>
|
<% for project in @favorite_projects %>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
<div class="table_wrapper">
|
<div class="table_wrapper">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= sortable "Title", "title" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "Title", :column => "title"} %>
|
||||||
<th><%= sortable "Registration Date", "created_at" %></th>
|
<%= render :partial => "favorites/th", :locals => {:display => "Registration Date", :column => "created_at"} %>
|
||||||
</tr>
|
</tr>
|
||||||
<% for thesis in @favorite_theses %>
|
<% for thesis in @favorite_theses %>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user