* Refactoring to add helper method Prior to this commit, we made view level calls to service modules. This refactor provides convenience methods on the model. Furthermore, it addresses a few Rubocop violations that "come along for the ride." * Ensuring cached entity squaks like User * Fixing broken spec * Fixing typo
23 lines
923 B
Text
23 lines
923 B
Text
<% @notifications.each do |notification| %>
|
|
<div
|
|
class="mb-2 spec-notification <%= "unseen" unless notification.read? %>"
|
|
data-notification-id="<%= notification.id %>">
|
|
<%= render notification.notifiable_type.downcase.to_s, notification: notification %>
|
|
</div>
|
|
|
|
<% rescue => e %>
|
|
|
|
<% Honeybadger.notify(e, context: { notification_id: notification.id }) %>
|
|
|
|
<div class="align-center p-9 py-10 color-base-80 crayons-card mb-2">
|
|
<h2 class="fw-bold fs-l"><%= t("views.notifications.error.subtitle") %></h2>
|
|
<p class="color-base-60 pt-2"><%= t("views.notifications.error.desc") %></p>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if @notifications.any? %>
|
|
<% sub_path = params[:org_id].present? ? "#{params[:filter]}/#{params[:org_id]}" : params[:filter].to_s %>
|
|
<div
|
|
class="notifications-paginator"
|
|
data-pagination-path="/notifications/<%= sub_path %>?offset=<%= @notifications.last.id %>"></div>
|
|
<% end %>
|