metamaps--metamaps/app/views/notifications/index.html.erb
2016-12-11 17:48:48 -05:00

29 lines
1.1 KiB
Plaintext

<% content_for :title, 'Notifications | Metamaps' %>
<% content_for :mobile_title, 'Notifications' %>
<div id="yield">
<div class="centerContent">
<h4>Notifications</h4>
<ul class="notifications">
<% @notifications.each do |notification| %>
<% receipt = @receipts.find_by(notification_id: notification.id) %>
<li class="notification" id="notification-<%= notification.id %>">
<strong class="notification-subject">
<%= link_to notification.subject, notification_path(notification.id) %>
</strong>
<span class="notification-body">
<%= notification.body.truncate(140) %>
</span>
<span class="notification-read-unread">
<% if receipt.is_read? %>
<%= link_to '(read)', mark_unread_notification_path(notification.id), remote: true, method: :put %>
<% else %>
<%= link_to '(unread)', mark_read_notification_path(notification.id), remote: true, method: :put %>
<% end %>
</span>
</li>
<% end %>
</ul>
</div>
</div>