Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/app.js
Show First 20 Lines • Show All 258 Lines • ▼ Show 20 Lines | methods: { | ||||
link.download = filename | link.download = filename | ||||
link.click() | link.click() | ||||
}) | }) | ||||
}, | }, | ||||
price(price, currency) { | price(price, currency) { | ||||
// TODO: Set locale argument according to the currently used locale | // TODO: Set locale argument according to the currently used locale | ||||
return ((price || 0) / 100).toLocaleString('de-DE', { style: 'currency', currency: currency || 'CHF' }) | return ((price || 0) / 100).toLocaleString('de-DE', { style: 'currency', currency: currency || 'CHF' }) | ||||
}, | }, | ||||
priceLabel(cost, discount) { | priceLabel(cost, discount, currency) { | ||||
let index = '' | let index = '' | ||||
if (discount) { | if (discount) { | ||||
cost = Math.floor(cost * ((100 - discount) / 100)) | cost = Math.floor(cost * ((100 - discount) / 100)) | ||||
index = '\u00B9' | index = '\u00B9' | ||||
} | } | ||||
return this.price(cost) + '/' + this.$t('wallet.month') + index | return this.price(cost, currency) + '/' + this.$t('wallet.month') + index | ||||
}, | }, | ||||
clickRecord(event) { | clickRecord(event) { | ||||
if (!/^(a|button|svg|path)$/i.test(event.target.nodeName)) { | if (!/^(a|button|svg|path)$/i.test(event.target.nodeName)) { | ||||
$(event.target).closest('tr').find('a').trigger('click') | $(event.target).closest('tr').find('a').trigger('click') | ||||
} | } | ||||
}, | }, | ||||
domainStatusClass(domain) { | domainStatusClass(domain) { | ||||
if (domain.isDeleted) { | if (domain.isDeleted) { | ||||
▲ Show 20 Lines • Show All 242 Lines • Show Last 20 Lines |