{# Positions tabs (ยง3.3 of UI/UX redesign spec). Caller passes `selected_view` (defaults to 'all') and any current query-string scope (`period`, `account`) so links preserve filter state across tab switches. #} {% set _v = selected_view|default('all') %}
{% for tab in [ ('all', 'All', positions_count|default('')), ('stocks', 'Stocks', stocks_count|default('')), ('options', 'Options', options_count|default('')), ('at-loss', 'At a loss', at_loss_count|default('')), ('closed', 'Closed', ''), ('plan', 'Plan', target_count|default('')), ] %} {% set key, label, count = tab %} {{ label }}{% if count %}{{ count }}{% endif %} {% endfor %}