mobile: tag Qty/Avg cells in JS-rendered portfolio table

The portfolio table is rendered client-side in portfolio.js (not by
the partials/portfolio.html Jinja template, which is unused for this
view). The previous commit's mobile-hide class made it into the
template but never reached the actual DOM. Adding the class to the
JS-emitted <th> and <td> strings so .dense .mobile-hide { display:
none } actually picks them up at ≤480px.
This commit is contained in:
Giorgio Gilestro 2026-05-28 19:13:52 +02:00
parent 6459e8c43d
commit 1a20f0a15b

View file

@ -303,8 +303,8 @@
return '<tr>' + return '<tr>' +
'<td class="label">' + esc(p.yahoo_ticker) + '</td>' + '<td class="label">' + esc(p.yahoo_ticker) + '</td>' +
'<td>' + esc(p.name || '') + '</td>' + '<td>' + esc(p.name || '') + '</td>' +
'<td class="num">' + fmt(p.qty, { maximumFractionDigits: 6 }) + '</td>' + '<td class="num mobile-hide">' + fmt(p.qty, { maximumFractionDigits: 6 }) + '</td>' +
'<td class="num neu">' + fmt(p.avg_cost) + '</td>' + '<td class="num neu mobile-hide">' + fmt(p.avg_cost) + '</td>' +
'<td class="num">' + lastDisplay + fxBadge + '</td>' + '<td class="num">' + lastDisplay + fxBadge + '</td>' +
'<td class="num ' + cls(p._ppl) + '">' + signed(p._ppl) + '</td>' + '<td class="num ' + cls(p._ppl) + '">' + signed(p._ppl) + '</td>' +
'<td class="num ' + cls(p._ppl_pct) + '">' + pct(p._ppl_pct) + '</td>' + '<td class="num ' + cls(p._ppl_pct) + '">' + pct(p._ppl_pct) + '</td>' +
@ -365,7 +365,7 @@
'<table class="dense">' + '<table class="dense">' +
'<thead><tr>' + '<thead><tr>' +
'<th>Ticker</th><th>Name</th>' + '<th>Ticker</th><th>Name</th>' +
'<th class="num">Qty</th><th class="num">Avg</th>' + '<th class="num mobile-hide">Qty</th><th class="num mobile-hide">Avg</th>' +
'<th class="num">Last</th><th class="num">P/L</th>' + '<th class="num">Last</th><th class="num">P/L</th>' +
'<th class="num">%</th>' + '<th class="num">%</th>' +
'<th></th>' + '<th></th>' +