destroy notifications when marked as read
This commit is contained in:
8
app/views/notifications/_notification.html.erb
Normal file
8
app/views/notifications/_notification.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<li id="<%= dom_id(notification) %>" class="notification">
|
||||
<%= link_to notification do %>
|
||||
<time><%= l notification.timestamp, format: :datetime %></time> •
|
||||
<span><%= notification.username %> </span>
|
||||
<span><%= t("notifications.index.#{notification_action(notification)}") %></span>
|
||||
<span><%= notification.notifiable.commentable.title %></span>
|
||||
<% end %>
|
||||
</li>
|
||||
@@ -1,11 +1,14 @@
|
||||
<div class="row">
|
||||
<ul>
|
||||
<% @notifications.each do |notification| %>
|
||||
<li>
|
||||
<time><%= l notification.timestamp, format: :datetime %></time> •
|
||||
<%= 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 %>
|
||||
Reference in New Issue
Block a user