Add pagination to price, cost history grids for product view

This commit is contained in:
Lance Edgar 2020-08-17 21:38:12 -05:00
parent a038f2a98d
commit b5028ab2d0
3 changed files with 11 additions and 4 deletions

View file

@ -985,6 +985,9 @@ class Grid(object):
context['empty_labels'] = empty_labels
if 'grid_columns' not in context:
context['grid_columns'] = self.get_buefy_columns()
context.setdefault('paginated', False)
if context['paginated']:
context.setdefault('per_page', 20)
# locate the 'view' action
# TODO: this should be easier, and/or moved elsewhere?

View file

@ -5,6 +5,10 @@
striped
hoverable
narrowed
% if paginated:
paginated
per-page="${per_page}"
% endif
% if vshow is not Undefined and vshow:
v-show="${vshow}"
% endif

View file

@ -380,7 +380,7 @@
</p>
</header>
<section class="modal-card-body">
${regular_price_history_grid.render_buefy_table_element(data_prop='regularPriceHistoryData', loading='regularPriceHistoryLoading')|n}
${regular_price_history_grid.render_buefy_table_element(data_prop='regularPriceHistoryData', loading='regularPriceHistoryLoading', paginated=True, per_page=10)|n}
</section>
<footer class="modal-card-foot">
<b-button @click="showingPriceHistory_regular = false">
@ -399,7 +399,7 @@
</p>
</header>
<section class="modal-card-body">
${current_price_history_grid.render_buefy_table_element(data_prop='currentPriceHistoryData', loading='currentPriceHistoryLoading')|n}
${current_price_history_grid.render_buefy_table_element(data_prop='currentPriceHistoryData', loading='currentPriceHistoryLoading', paginated=True, per_page=10)|n}
</section>
<footer class="modal-card-foot">
<b-button @click="showingPriceHistory_current = false">
@ -418,7 +418,7 @@
</p>
</header>
<section class="modal-card-body">
${suggested_price_history_grid.render_buefy_table_element(data_prop='suggestedPriceHistoryData', loading='suggestedPriceHistoryLoading')|n}
${suggested_price_history_grid.render_buefy_table_element(data_prop='suggestedPriceHistoryData', loading='suggestedPriceHistoryLoading', paginated=True, per_page=10)|n}
</section>
<footer class="modal-card-foot">
<b-button @click="showingPriceHistory_suggested = false">
@ -437,7 +437,7 @@
</p>
</header>
<section class="modal-card-body">
${cost_history_grid.render_buefy_table_element(data_prop='costHistoryData', loading='costHistoryLoading')|n}
${cost_history_grid.render_buefy_table_element(data_prop='costHistoryData', loading='costHistoryLoading', paginated=True, per_page=10)|n}
</section>
<footer class="modal-card-foot">
<b-button @click="showingCostHistory = false">