link entire notification, except read-unread toggler

This commit is contained in:
Devin Howard 2016-11-28 13:06:08 -05:00
parent 689a965f9d
commit 1fabfd832b

View file

@ -8,12 +8,14 @@
<% @notifications.each do |notification| %>
<% receipt = @receipts.find_by(notification_id: notification.id) %>
<li class="notification <%= receipt.is_read? ? 'read' : 'unread' %>" id="notification-<%= notification.id %>">
<div class="notification-subject">
<%= link_to notification.subject, notification_path(notification.id) %>
</div>
<div class="notification-body">
<%= notification.body.truncate(70) %>
</div>
<%= link_to notification_path(notification.id) do %>
<div class="notification-subject">
<%= notification.subject %>
</div>
<div class="notification-body">
<%= notification.body.truncate(70) %>
</div>
<% end %>
<div class="notification-read-unread">
<% if receipt.is_read? %>
<%= link_to 'mark as unread', mark_unread_notification_path(notification.id), remote: true, method: :put %>