Quick notifications fix (#1179)
This commit is contained in:
parent
eccee11106
commit
3b94e1d1a6
3 changed files with 11 additions and 19 deletions
|
|
@ -9,10 +9,10 @@ class NotificationsController < ApplicationController
|
|||
current_user
|
||||
end
|
||||
if params[:page]
|
||||
num = 48
|
||||
num = 45
|
||||
notified_at_offset = Notification.find(params[:page])&.notified_at
|
||||
else
|
||||
num = 12
|
||||
num = 10
|
||||
end
|
||||
if params[:filter].to_s.downcase == "posts"
|
||||
@notifications = Notification.where(user_id: current_user.id, notifiable_type: "Article", action: "Published").
|
||||
|
|
|
|||
|
|
@ -7,4 +7,5 @@
|
|||
</div>
|
||||
<% rescue => e %>
|
||||
<% logger.error("Notifification error - #{e.message} - #{notification.id}") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,12 @@
|
|||
<%# missing cache key %>
|
||||
<% if notification.json_data["reaction"]["aggregated_siblings"].length == 1 %>
|
||||
<% if notification.json_data["reaction"]["category"] != "readinglist" %>
|
||||
<% cache "activity-profile-pic-#{notification.json_data["user"]["id"]}-#{notification.json_data["user"]["profile_image_90"]}" do %>
|
||||
<a href="<%= notification.json_data["user"]["path"] %>" class="small-pic-link-wrapper">
|
||||
<div class="small-pic">
|
||||
<img src="<%= notification.json_data["user"]["profile_image_90"] %>" alt="link to <%= notification.json_data["user"]["username"] %> profile">
|
||||
</div>
|
||||
</a>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% cache "activity-profile-pic-readinglist-icon" do %>
|
||||
<a href="#" class="small-pic-link-wrapper">
|
||||
<div class="small-pic">
|
||||
<img src="<%= asset_path ReactionImage.new("readinglist").path %>" alt="">
|
||||
</div>
|
||||
</a>
|
||||
<% end %>
|
||||
<% siblings = notification.json_data["reaction"]["aggregated_siblings"].select{|n| n["created_at"] > 24.hours.ago } %>
|
||||
<% if siblings.length == 0 %>
|
||||
<% cache "activity-profile-pic-#{notification.json_data["user"]["id"]}-#{notification.json_data["user"]["profile_image_90"]}" do %>
|
||||
<a href="<%= notification.json_data["user"]["path"] %>" class="small-pic-link-wrapper">
|
||||
<div class="small-pic">
|
||||
<img src="<%= notification.json_data["user"]["profile_image_90"] %>" alt="link to <%= notification.json_data["user"]["username"] %> profile">
|
||||
</div>
|
||||
</a>
|
||||
<% end %>
|
||||
<div class="content notification-content reaction-content">
|
||||
<a href="<%= notification.json_data["user"]["path"] %>"><strong><%= notification.json_data["user"]["name"] %></strong></a> reacted to
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue