Skip to content

Commit

Permalink
Merge pull request #3600 from softr8/backend_admin_stock_location_pag…
Browse files Browse the repository at this point in the history
…ination

Adding missing paginator when listing all stock locations
  • Loading branch information
aldesantis committed May 6, 2020
2 parents 3a2cee4 + ca9a589 commit c4efd0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def set_country
flash[:error] = t('spree.stock_locations_need_a_default_country')
redirect_to(admin_stock_locations_path) && return
end

def collection
super.page(params[:page]).per(Spree::Config[:admin_products_per_page])
end
end
end
end
2 changes: 2 additions & 0 deletions backend/app/views/spree/admin/stock_locations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<% end %>
<% if @stock_locations.any? %>
<%= paginate @stock_locations, theme: "solidus_admin" %>
<table class="index sortable" id='listing_stock_locations' data-hook data-sortable-link="<%= update_positions_admin_stock_locations_url %>">
<colgroup>
<col style="width: 10%">
Expand Down Expand Up @@ -69,6 +70,7 @@
<% end %>
</tbody>
</table>
<%= paginate @stock_locations, theme: "solidus_admin" %>
<% else %>
<div class="no-objects-found">
<%= render 'spree/admin/shared/no_objects_found',
Expand Down

0 comments on commit c4efd0a

Please sign in to comment.