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

29 lines
1.1 KiB
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>
2016-11-24 20:36:48 +00:00
<ul class="notifications">
2016-11-17 04:04:30 +00:00
<% @notifications.each do |notification| %>
2016-11-17 04:50:47 +00:00
<% receipt = @receipts.find_by(notification_id: notification.id) %>
2016-11-24 20:36:48 +00:00
<li class="notification" id="notification-<%= notification.id %>">
<strong class="notification-subject">
2016-11-17 04:04:30 +00:00
<%= link_to notification.subject, notification_path(notification.id) %>
</strong>
2016-11-24 20:36:48 +00:00
<span class="notification-body">
<%= notification.body.truncate(140) %>
</span>
<span class="notification-read-unread">
2016-11-17 04:50:47 +00:00
<% 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>