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

27 lines
960 B
Plaintext

<% content_for :title, 'Notifications | Metamaps' %>
<% content_for :mobile_title, 'Notifications' %>
<div id="yield">
<div class="centerContent">
<h4>Notifications</h4>
<ul>
<% @notifications.each do |notification| %>
<% receipt = @receipts.find_by(notification_id: notification.id) %>
<li>
<strong>
<%= link_to notification.subject, notification_path(notification.id) %>
</strong>
<%= notification.body.truncate(140) %>
<span id="notification-<%= notification.id %>" class="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>