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