Skip to content

Commit

Permalink
Show newest messages first (#92)
Browse files Browse the repository at this point in the history
* Show newest messages first

* Remove test messages
  • Loading branch information
lfarrell authored and bbpennel committed Aug 10, 2018
1 parent 61c3016 commit a887851
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions app/views/hyrax/notifications/_notifications.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<%# [hyc-override] Overriding partial in hyrax gem to sort messages ascending instead of descending %>
<% if messages.present? %>
<div class="table-responsive">
<table class="table table-striped datatable">
<thead>
<tr>
<th><%= t('hyrax.mailbox.date') %></th>
<th><%= t('hyrax.mailbox.subject') %></th>
<th><%= t('hyrax.mailbox.message') %></th>
<th><span class="sr-only"><%= t('hyrax.mailbox.delete') %></span></th>
</tr>
</thead>
<tbody>
<% messages.each do |msg| %>
<tr>
<td>
<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>
</td>
<td><%= msg.last_message.subject.html_safe %></td>
<td><%= msg.last_message.body.html_safe %></td>
<td>
<%= link_to hyrax.notification_path(msg.id),
class: "itemicon itemtrash",
title: t('hyrax.mailbox.delete'),
method: :delete do %>
<span class="sr-only"><%= I18n.t('hyrax.dashboard.delete_notification') %></span>
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% else %>
<p><%= t('hyrax.mailbox.empty') %></p>
<% end %>

0 comments on commit a887851

Please sign in to comment.