mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
86b55b0f81
refs https://github.com/TryGhost/Team/issues/1037 Adds new free tier card with option to add custom description and benefits for free tier, behind the tiers beta flag. Also: - updates formatting of tier prices - changes "Free" section to "Default" - updates price formatting of membership tiers in admin - updates currency code handling for product card - updates default paid product handling Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com> Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
38 lines
937 B
JavaScript
38 lines
937 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {getSymbol} from 'ghost-admin/utils/currency';
|
|
import {inject as service} from '@ember/service';
|
|
import {tracked} from '@glimmer/tracking';
|
|
export default class extends Component {
|
|
@service membersUtils;
|
|
@service ghostPaths;
|
|
@service ajax;
|
|
@service store;
|
|
@service config;
|
|
|
|
@tracked showProductModal = false;
|
|
@tracked productModel = null;
|
|
|
|
get product() {
|
|
return this.args.product;
|
|
}
|
|
|
|
get isPaidProduct() {
|
|
return this.product.type === 'paid';
|
|
}
|
|
|
|
get hasCurrencySymbol() {
|
|
const currencySymbol = getSymbol(this.product?.monthlyPrice?.currency);
|
|
return currencySymbol?.length !== 3;
|
|
}
|
|
|
|
get isFreeProduct() {
|
|
return this.product.type === 'free';
|
|
}
|
|
|
|
@action
|
|
async openEditProduct(product) {
|
|
this.args.openEditProduct(product);
|
|
}
|
|
}
|