Retrospring/app/views/notifications/index.js.erb

9 lines
542 B
Plaintext

$('#notifications').append('<% @notifications.each do |notification|
%><li class="card"><div class="card-body"><div class="media"><%= j render "notifications/type/#{notification.target_type.downcase}", notification: notification
%></div></div></li><% end %>');
<% if @more_data_available %>
$('#pagination').html('<%= j render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @notifications_last_id, permitted_params: %i[type] %>');
<% else %>
$('#pagination, #load-more-btn').remove();
<% end %>