destroy notifications when marked as read

This commit is contained in:
rgarcia
2016-01-07 12:02:01 +01:00
parent b5e9113718
commit e2f419e625
12 changed files with 120 additions and 84 deletions

View File

@@ -0,0 +1,8 @@
<li id="<%= dom_id(notification) %>" class="notification">
<%= link_to notification do %>
<time><%= l notification.timestamp, format: :datetime %></time>&nbsp;&bull;&nbsp;
<span><%= notification.username %> </span>
<span><%= t("notifications.index.#{notification_action(notification)}") %></span>
<span><%= notification.notifiable.commentable.title %></span>
<% end %>
</li>

View File

@@ -1,11 +1,14 @@
<div class="row">
<ul>
<% @notifications.each do |notification| %>
<li>
<time><%= l notification.timestamp, format: :datetime %></time>&nbsp;&bull;&nbsp;
<%= notification.username %> <%= notification_text_for(notification) %>
<%= link_to notification.notifiable.commentable.title, notification.notifiable.commentable %>
</li>
<% end %>
</ul>
</div>
<% if @notifications.empty? %>
<div><%= t("notifications.index.empty_notifications") %></div>
<% else %>
<div class="row">
<ul>
<%= render @notifications %>
</ul>
<div>
<%= link_to t("notifications.index.mark_all_as_read"),
mark_all_as_read_notifications_path, method: :put %>
</div>
</div>
<% end %>