Skip to content

Commit

Permalink
Merge pull request #2741 from samvera/data-sort
Browse files Browse the repository at this point in the history
Add `data-sort` attributes to dataTables rows to support date sort
  • Loading branch information
Thomas Johnson authored Mar 2, 2018
2 parents 881e0a3 + dd0331c commit 8db029f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/views/hyrax/notifications/_notifications.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<tbody>
<% messages.each do |msg| %>
<tr>
<td>
<td data-sort="<%= msg.last_message.created_at.getutc.iso8601(5) %>">
<relative-time datetime="<%= msg.last_message.created_at.getutc.iso8601 %>" title="<%= msg.last_message.created_at.to_formatted_s(:standard) %>">
<%= msg.last_message.created_at.to_formatted_s(:long_ordinal) %>
</relative-time>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/transfers/_received.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<% unless req.sending_user.blank? %>
<tr>
<td> <%= show_transfer_request_title(req) %> </td>
<td>
<td data-sort="<%= req.created_at.getutc.iso8601(5) %>">
<relative-time datetime="<%= req.created_at.getutc.iso8601 %>" title="<%= req.created_at.to_formatted_s(:standard) %>">
<%= req.created_at.to_formatted_s(:long_ordinal) %>
</relative-time>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/transfers/_sent.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<% unless req.receiving_user.blank? %>
<tr>
<td> <%= show_transfer_request_title(req) %> </td>
<td>
<td data-sort="<%= req.created_at.getutc.iso8601(5) %>">
<relative-time datetime="<%= req.created_at.getutc.iso8601 %>" title="<%= req.created_at.to_formatted_s(:standard) %>">
<%= req.created_at.to_formatted_s(:long_ordinal) %>
</relative-time>
Expand Down
4 changes: 2 additions & 2 deletions app/views/hyrax/users/_activity_log.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<% next if event[:action].blank? or event[:timestamp].blank? %>
<tr>
<td><%= event[:action].html_safe %></td>
<td>
<% time = Time.zone.at(event[:timestamp].to_i) %>
<% time = Time.zone.at(event[:timestamp].to_i) %>
<td data-sort="<%= time.getutc.iso8601(5) %>">
<relative-time datetime="<%= time.getutc.iso8601 %>" title="<%= time.to_formatted_s(:standard) %>">
<%= time.to_formatted_s(:long_ordinal) %>
</relative-time>
Expand Down

0 comments on commit 8db029f

Please sign in to comment.