{# Lot ladder. Consumes `lot_rows` from _pane_lot_info() (Task 2). Layout: sorted by date desc by default; client-side Alpine sort on column headers lets the user flip by date / qty / basis / unrealized / status. Collapses to "N lots" toggle when N > 5. Each row: date · qty · adj basis · unrealized · status pill. Click on a lot opens the ticker lots view in a new tab. Status values: "ST" (short-term), "LT" (long-term), "TACKED" (IRC §1223(4)), "WS" (lot cost basis inflated by §1091(d) disallowed-loss roll-in). Status precedence: TACKED > WS > LT > ST. When a lot is both TACKED and WS-implicated, TACKED wins (holding-period concern is more material). Cross-account mode (cross_account=True): lot rows are grouped by account with a small section header per account. The per-row HTML is factored into the `lot_row` macro to avoid duplication between the flat-list and grouped branches. #} {% macro lot_row(row, sym) %} {{ row.date.isoformat() }} {{ fmt_quantity(row.qty) }} sh {{ fmt_currency(row.adj_basis) }} {% if row.unrealized is not none %} {{ fmt_currency(row.unrealized) }} {% else %} — {% endif %} {{ row.status }} {% endmacro %} {% if lot_rows %} {% set _sorted = lot_rows | sort(attribute='date', reverse=True) %} {% set _collapsed = _sorted | length > 5 %}