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

47 lines
1.7 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">
2016-11-24 22:31:58 +00:00
<div class="centerContent notificationsPage">
<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) %>
<li class="notification <%= receipt.is_read? ? 'read' : 'unread' %>" id="notification-<%= notification.id %>">
<%= 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) %>
</div>
<% end %>
<div class="notification-read-unread">
2016-11-17 04:50:47 +00:00
<% if receipt.is_read? %>
<%= link_to 'mark as unread', mark_unread_notification_path(notification.id), remote: true, method: :put %>
2016-11-17 04:50:47 +00:00
<% else %>
<%= link_to 'mark as read', mark_read_notification_path(notification.id), remote: true, method: :put %>
2016-11-17 04:50:47 +00:00
<% end %>
</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">
2016-12-15 22:34:42 +00:00
You have no notifications. More time for dancing.
2016-12-13 14:30:25 +00:00
</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-11-17 04:04:30 +00:00
</div>
2016-11-24 22:31:58 +00:00
<%= render partial: 'notifications/header' %>