Both tiles were hardcoded. Parse the quantity strings (6 × ½ kg, 3 kg,
~700g, 2 stk.) live: Kødportioner = total Kød & fisk weight / 500g;
Aftensmadsdage = meat portions + pasta/tortelloni packs. Recomputed on
load and whenever a quantity changes, so the trip's food volume is
visible while editing. Defaults now read ~30 portions / ~36 dinners.
Estimeret total was a hardcoded ~4.400. Make it dynamic: every list row
(fixed catalog, added extras, picked Lübeck offers) carries data-est in DKK,
and recalcAll sums them, so the tile updates live when you add/remove items
or pick/unpick offers. 'Faktisk betalt' was already live; the Aftensmadsdage
and Kødportioner tiles stay as illustrative figures.
Ticking an offer already adds it to the shopping list instantly (it shows in
the Lübeck-tilbud section), but that wasn't visible. Add a fixed 'N valgt ·
Gå til seddel' button that appears once anything is selected, so the link
between the checklist and the list is obvious and you can jump straight to it.
2026-10-30 12:41:28 +01:00
2 changed files with 75 additions and 11 deletions
style="display:none;position:fixed;right:14px;bottom:14px;z-index:9999;padding:11px 18px;border-radius:24px;background:#2d6a4f;color:#fff;text-decoration:none;font:600 14px/1 var(--sans);box-shadow:0 3px 12px rgba(0,0,0,.28)">🛒 <bid="golist-n">0</b> valgt · Gå til seddel →</a>
<script>
letpickCount={{picked_count}};
// Picking is instant — a tick adds the offer to the shopping list right away
// (it shows in the "Lübeck-tilbud" section there). This just mirrors the count
// and the "go to list" button.
functionupdatePick(){
document.getElementById('pick-count').textContent=pickCount+' på seddel';
document.getElementById('pick-count').textContent=pickCount+' på seddel';
updatePick();
}
}
@@ -166,6 +179,8 @@ async function refreshOffers() {
btn.textContent='⟳ Opdater';btn.disabled=false;
}
}
updatePick();
</script>
</body>
</html>
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.