2016-11-16 23:04:30 -05:00
|
|
|
<% content_for :title, 'Notifications | Metamaps' %>
|
|
|
|
<% content_for :mobile_title, 'Notifications' %>
|
|
|
|
|
|
|
|
<div id="yield">
|
2016-11-24 17:31:58 -05:00
|
|
|
<div class="centerContent notificationsPage">
|
2016-12-12 16:07:34 -05:00
|
|
|
<header class="page-header">
|
2016-12-15 23:57:37 -05:00
|
|
|
<h2 class="title">Notifications</h4>
|
2016-12-12 16:07:34 -05:00
|
|
|
</header>
|
2016-11-24 15:36:48 -05:00
|
|
|
<ul class="notifications">
|
2016-11-16 23:04:30 -05:00
|
|
|
<% @notifications.each do |notification| %>
|
2016-11-16 23:50:47 -05:00
|
|
|
<% receipt = @receipts.find_by(notification_id: notification.id) %>
|
2016-11-25 11:39:10 -05:00
|
|
|
<li class="notification <%= receipt.is_read? ? 'read' : 'unread' %>" id="notification-<%= notification.id %>">
|
2016-11-28 13:06:08 -05:00
|
|
|
<%= link_to notification_path(notification.id) do %>
|
2016-12-15 23:57:37 -05:00
|
|
|
<div class="notification-actor">
|
|
|
|
<%= image_tag notification.sender.image(:thirtytwo) %>
|
2016-11-28 13:06:08 -05:00
|
|
|
</div>
|
|
|
|
<div class="notification-body">
|
2016-12-15 23:57:37 -05:00
|
|
|
<div class="in-bold"><%= notification.sender.name %></div>
|
|
|
|
<%= raw NotificationService.text_for_notification(notification) %>
|
2016-11-28 13:06:08 -05:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-11-25 11:39:10 -05:00
|
|
|
<div class="notification-read-unread">
|
2016-11-16 23:50:47 -05:00
|
|
|
<% if receipt.is_read? %>
|
2016-11-28 12:54:33 -05:00
|
|
|
<%= link_to 'mark as unread', mark_unread_notification_path(notification.id), remote: true, method: :put %>
|
2016-11-16 23:50:47 -05:00
|
|
|
<% else %>
|
2016-11-28 12:54:33 -05:00
|
|
|
<%= link_to 'mark as read', mark_read_notification_path(notification.id), remote: true, method: :put %>
|
2016-11-16 23:50:47 -05:00
|
|
|
<% end %>
|
2016-11-25 11:39:10 -05:00
|
|
|
</div>
|
2016-12-15 23:57:37 -05:00
|
|
|
<div class="notification-date">
|
|
|
|
<%= notification.created_at.strftime("%b %d") %>
|
|
|
|
</div>
|
2016-12-12 17:55:42 -05:00
|
|
|
<div class="clearfloat"></div>
|
2016-11-16 23:04:30 -05:00
|
|
|
</li>
|
|
|
|
<% end %>
|
2016-11-28 17:37:27 -05:00
|
|
|
<% if @notifications.count == 0 %>
|
2016-12-13 09:30:25 -05:00
|
|
|
<div class="emptyInbox">
|
2016-12-15 17:34:42 -05:00
|
|
|
You have no notifications. More time for dancing.
|
2016-12-13 09:30:25 -05:00
|
|
|
</div>
|
2016-11-28 17:37:27 -05:00
|
|
|
<% end %>
|
2016-11-16 23:04:30 -05:00
|
|
|
</ul>
|
|
|
|
</div>
|
2016-12-11 17:29:48 -05:00
|
|
|
|
2016-12-12 10:37:46 -05:00
|
|
|
<% if @notifications.total_pages > 1 %>
|
2016-12-12 17:55:42 -05:00
|
|
|
<div class="centerContent withPadding pagination">
|
2016-12-12 10:37:46 -05:00
|
|
|
<%= paginate @notifications %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-11-16 23:04:30 -05:00
|
|
|
</div>
|
2016-11-24 17:31:58 -05:00
|
|
|
|
|
|
|
<%= render partial: 'notifications/header' %>
|