Implement pagination in Moderation Panel view
This commit is contained in:
parent
2cab96b9af
commit
c19b2df93c
|
@ -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]
|
||||||
|
|
|
@ -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 %>
|
Loading…
Reference in New Issue