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

51 lines
1.9 KiB
Plaintext
Raw Normal View History

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