metamaps--metamaps/app/views/notifications/index.html.erb

27 lines
960 B
Text
Raw Normal View History

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