Compare commits
3 commits
v1.6.8-aio
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| cadf30b704 | |||
| 0e9cc76fef | |||
| b4ca9fe65d |
3 changed files with 22 additions and 18 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"id": "events",
|
"id": "events",
|
||||||
"version": "1.6.8-aio.3",
|
"version": "1.6.8-aio.4",
|
||||||
"name": "Events",
|
"name": "Events",
|
||||||
"repo": "https://git.atitlan.io/aiolabs/events",
|
"repo": "https://git.atitlan.io/aiolabs/events",
|
||||||
"short_description": "Sell and register event tickets",
|
"short_description": "Sell and register event tickets",
|
||||||
|
|
|
||||||
|
|
@ -414,6 +414,26 @@ window.PageEvents = {
|
||||||
this.ticketImageUploadTarget = null
|
this.ticketImageUploadTarget = null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
waveSummary(eventId, wave) {
|
||||||
|
// Built here, not in the template. Vue resolves template expressions
|
||||||
|
// against the component instance, where the `LNbits` global is NOT
|
||||||
|
// in scope — upstream's v1.6.8 chip called `LNbits.utils` inline and
|
||||||
|
// threw "Cannot read properties of undefined (reading 'utils')",
|
||||||
|
// which killed the whole v-for and left the wave list looking empty.
|
||||||
|
// No other template in this extension touches `LNbits` directly.
|
||||||
|
const price = this.isFiatCurrency(wave.currency)
|
||||||
|
? LNbits.utils.formatCurrency(
|
||||||
|
Number(wave.price_per_ticket || 0).toFixed(2),
|
||||||
|
wave.currency
|
||||||
|
)
|
||||||
|
: `${wave.price_per_ticket} sats`
|
||||||
|
// Wave dates can carry a time (closing_date defaults from
|
||||||
|
// event_end_date); show the day only.
|
||||||
|
const opens = String(wave.opening_date || '').slice(0, 10)
|
||||||
|
const closes = String(wave.closing_date || '').slice(0, 10)
|
||||||
|
const sold = this.soldTicketsForWave(eventId, wave.id)
|
||||||
|
return `${wave.title} - ${opens} to ${closes} - ${price} - ${wave.amount_tickets} tickets - ${sold} sold`
|
||||||
|
},
|
||||||
soldTicketsForWave(eventId, waveId) {
|
soldTicketsForWave(eventId, waveId) {
|
||||||
return this.allPaidTickets.filter(
|
return this.allPaidTickets.filter(
|
||||||
ticket =>
|
ticket =>
|
||||||
|
|
|
||||||
|
|
@ -271,23 +271,7 @@
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
style="white-space: normal; line-height: 1.3"
|
style="white-space: normal; line-height: 1.3"
|
||||||
v-text="
|
v-text="waveSummary(props.row.id, wave)"
|
||||||
`${wave.title} - ${wave.opening_date} to ${
|
|
||||||
wave.closing_date
|
|
||||||
} - ${
|
|
||||||
isFiatCurrency(wave.currency)
|
|
||||||
? LNbits.utils.formatCurrency(
|
|
||||||
Number(
|
|
||||||
wave.price_per_ticket || 0
|
|
||||||
).toFixed(2),
|
|
||||||
wave.currency
|
|
||||||
)
|
|
||||||
: `${wave.price_per_ticket} sats`
|
|
||||||
} - ${wave.amount_tickets} tickets - ${soldTicketsForWave(
|
|
||||||
props.row.id,
|
|
||||||
wave.id
|
|
||||||
)} sold`
|
|
||||||
"
|
|
||||||
></span>
|
></span>
|
||||||
</q-chip>
|
</q-chip>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue