Skip to content

Commit

Permalink
Adding missing paginator when listing all stock locations
Browse files Browse the repository at this point in the history
Current implementation only list all stock locations limited
by the defaulted per page value, but there's no way to navigate
to multiple pages.
  • Loading branch information
softr8 committed May 6, 2020
1 parent 7e05824 commit 3348622
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 3348622

Please sign in to comment.