Ghost/ghost/admin/app/controllers/settings/tiers.js
Hannah Wolfe affe6743e5 Renamed products to tiers (#2372)
refs: https://github.com/TryGhost/Team/issues/1145

- this should allow us to remove the /products endpoint in v5

It avoids:

- `kg-product-card`, that really is meant to say product
- `product-cadence` on offers

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-05-11 22:41:54 +05:30

37 lines
962 B
JavaScript

import Controller from '@ember/controller';
import {action} from '@ember/object';
import {htmlSafe} from '@ember/template';
import {inject as service} from '@ember/service';
import {tracked} from '@glimmer/tracking';
export default class TiersController extends Controller {
@service settings;
@service config;
@tracked iconStyle = '';
@tracked showFreeMembershipModal = false;
constructor() {
super(...arguments);
this.iconStyle = this.setIconStyle();
}
get tiers() {
return this.model.sortBy('name');
}
setIconStyle() {
let icon = this.config.get('icon');
if (icon) {
return htmlSafe(`background-image: url(${icon})`);
}
icon = 'https://static.ghost.org/v4.0.0/images/ghost-orb-2.png';
return htmlSafe(`background-image: url(${icon})`);
}
@action
closeFreeMembershipModal() {
this.showFreeMembershipModal = false;
}
}