link entire notification, except read-unread toggler
This commit is contained in:
parent
689a965f9d
commit
1fabfd832b
1 changed files with 8 additions and 6 deletions
|
@ -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 %>">
|
||||||
|
<%= link_to notification_path(notification.id) do %>
|
||||||
<div class="notification-subject">
|
<div class="notification-subject">
|
||||||
<%= link_to notification.subject, notification_path(notification.id) %>
|
<%= notification.subject %>
|
||||||
</div>
|
</div>
|
||||||
<div class="notification-body">
|
<div class="notification-body">
|
||||||
<%= notification.body.truncate(70) %>
|
<%= notification.body.truncate(70) %>
|
||||||
</div>
|
</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 %>
|
||||||
|
|
Loading…
Add table
Reference in a new issue