2016-11-17 04:04:30 +00:00
|
|
|
<% content_for :title, 'Notifications | Metamaps' %>
|
|
|
|
<% content_for :mobile_title, 'Notifications' %>
|
|
|
|
|
|
|
|
<div id="yield">
|
2016-11-24 22:31:58 +00:00
|
|
|
<div class="centerContent notificationsPage">
|
2016-12-12 21:07:34 +00:00
|
|
|
<header class="page-header">
|
|
|
|
<h2 class="title">My Notifications</h4>
|
|
|
|
</header>
|
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-25 16:39:10 +00:00
|
|
|
<li class="notification <%= receipt.is_read? ? 'read' : 'unread' %>" id="notification-<%= notification.id %>">
|
2016-11-28 18:06:08 +00:00
|
|
|
<%= link_to notification_path(notification.id) do %>
|
|
|
|
<div class="notification-subject">
|
|
|
|
<%= notification.subject %>
|
|
|
|
</div>
|
|
|
|
<div class="notification-body">
|
2016-11-29 17:52:25 +00:00
|
|
|
<%= strip_tags(notification.body).truncate(70) %>
|
2016-11-28 18:06:08 +00:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-11-25 16:39:10 +00:00
|
|
|
<div class="notification-read-unread">
|
2016-11-17 04:50:47 +00:00
|
|
|
<% if receipt.is_read? %>
|
2016-11-28 17:54:33 +00:00
|
|
|
<%= link_to 'mark as unread', mark_unread_notification_path(notification.id), remote: true, method: :put %>
|
2016-11-17 04:50:47 +00:00
|
|
|
<% else %>
|
2016-11-28 17:54:33 +00:00
|
|
|
<%= link_to 'mark as read', mark_read_notification_path(notification.id), remote: true, method: :put %>
|
2016-11-17 04:50:47 +00:00
|
|
|
<% end %>
|
2016-11-25 16:39:10 +00:00
|
|
|
</div>
|
2016-12-12 22:55:42 +00:00
|
|
|
<div class="clearfloat"></div>
|
2016-11-17 04:04:30 +00:00
|
|
|
</li>
|
|
|
|
<% end %>
|
2016-11-28 22:37:27 +00:00
|
|
|
<% if @notifications.count == 0 %>
|
2016-12-13 14:30:25 +00:00
|
|
|
<div class="emptyInbox">
|
|
|
|
You have ZERO unread notifications. Huzzah!
|
|
|
|
</div>
|
2016-11-28 22:37:27 +00:00
|
|
|
<% end %>
|
2016-11-17 04:04:30 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2016-12-11 22:29:48 +00:00
|
|
|
|
2016-12-12 15:37:46 +00:00
|
|
|
<% if @notifications.total_pages > 1 %>
|
2016-12-12 22:55:42 +00:00
|
|
|
<div class="centerContent withPadding pagination">
|
2016-12-12 15:37:46 +00:00
|
|
|
<%= paginate @notifications %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-12-11 22:29:48 +00:00
|
|
|
|
2016-11-25 16:47:29 +00:00
|
|
|
<%= render partial: 'shared/back_to_mapping' %>
|
2016-11-17 04:04:30 +00:00
|
|
|
</div>
|
2016-11-24 22:31:58 +00:00
|
|
|
|
|
|
|
<%= render partial: 'notifications/header' %>
|