Implement pagination in Moderation Panel view

This commit is contained in:
Karina Kwiatek 2022-01-03 23:23:12 +01:00
parent 2cab96b9af
commit c19b2df93c
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,6 @@
- @reports.each do |r| #reports
= render 'moderation/moderationbox', report: r - @reports.each do |r|
= render 'moderation/moderationbox', report: r
- unless @reports.count.zero? - unless @reports.count.zero?
= render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @reports_last_id, permitted_params: %i[type] = render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @reports_last_id, permitted_params: %i[type]

View File

@ -0,0 +1,6 @@
$('#reports').append('<% @reports.each do |report| %><%= j render "moderation/moderationbox", report: report %><% end %>');
<% if @more_data_available %>
$('#pagination').html('<%= j render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @reports_last_id, permitted_params: %i[type] %>');
<% else %>
$('#pagination, #load-more-btn').remove();
<% end %>