UI - Watch list - Dont show restock column if theres no restock on that pager/page

This commit is contained in:
dgtlmoon
2026-09-17 09:26:13 +02:00
parent e121c607cf
commit e4476dcd3e
2 changed files with 14 additions and 2 deletions
@@ -109,7 +109,7 @@
</td>
{%- if any_has_restock_price_processor -%}
<td class="restock-and-price">
<td class="restock-and-price col-restock-price">
{%- if watch['processor'] == 'restock_diff' -%}
{#- @todo - this could be injected somehow watch.extra_row_info or something -#}
<div class="restock-info-wrap">
@@ -339,7 +339,7 @@ window.watchOverviewI18n = {
<th><!-- processor/mode --></th>
<th id="th-webpage"><a class="{{ 'active '+link_order if sort_attribute == 'label' else 'inactive' }}" href="{{url_for('watchlist.index', sort='label', order=link_order, **active_filters)}}">{{ _('Web page') }} <span class='arrow {{link_order}}'></span></a></th>
{%- if any_has_restock_price_processor -%}
<th>{{ _('Restock & Price') }}</th>
<th class="col-restock-price">{{ _('Restock & Price') }}</th>
{%- endif -%}
<th id="h-lastchecked"><a class="{{ 'active '+link_order if sort_attribute == 'last_checked' else 'inactive' }}" href="{{url_for('watchlist.index', sort='last_checked', order=link_order, **active_filters)}}"><span class="hide-on-mobile">{{ _('Checked') }}</span><span class="hide-on-desktop">{{ _('Checked') }}</span> <span class='arrow {{link_order}}'></span></a></th>
<th id="h-lastchanged"><a class="{{ 'active '+link_order if sort_attribute == 'last_changed' else 'inactive' }}" href="{{url_for('watchlist.index', sort='last_changed', order=link_order, **active_filters)}}"><span class="hide-on-mobile">{{ _('Changed') }}</span><span class="hide-on-desktop">{{ _('Changed') }}</span> <span class='arrow {{link_order}}'></span></a></th>
@@ -353,12 +353,24 @@ window.watchOverviewI18n = {
</tr>
{%- endif -%}
{%- set ns = namespace(any_in_page_had_restock=false) -%}
{%- for watch in (watches|sort(attribute=sort_attribute, reverse=sort_order == 'asc'))|pagination_slice(skip=pagination.skip) -%}
{%- include "watch-overview-single-row.html" -%}
{%- if watch['processor'] == 'restock_diff' -%}
{%- set ns.any_in_page_had_restock = true -%}
{%- endif -%}
{%- endfor -%}
</tbody>
</table>
</div>
{%- if not ns.any_in_page_had_restock %}
<style>
.col-restock-price {
display: none;
}
</style>
{%- endif %}
{{ pagination.links }}
</div>
</form>