Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 01:10:28 +01:00
move subscription container to Glimmer
Dieser Commit ist enthalten in:
Ursprung
0b2e66ba0e
Commit
e43fbd0b50
4 geänderte Dateien mit 40 neuen und 39 gelöschten Zeilen
|
@ -0,0 +1,14 @@
|
|||
<div class="wizard-subscription-container {{if this.subscription.subscribed "subscribed"}}">
|
||||
<div class="subscription-header">
|
||||
<h4>{{i18n "admin.wizard.subscription.title"}}</h4>
|
||||
|
||||
<a href={{subscriptionLink}} title={{i18n subscribedTitle}}>
|
||||
{{d-icon subscribedIcon}}
|
||||
{{i18n subscribedLabel}}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="subscription-settings">
|
||||
{{yield}}
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,26 @@
|
|||
import Component from '@glimmer/component';
|
||||
import { computed } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class WizardSubscriptionContainer extends Component {
|
||||
@service subscription;
|
||||
|
||||
@computed("subscription.subscribed")
|
||||
get subscribedIcon() {
|
||||
return this.subscription.subscribed ? "check" : "times";
|
||||
};
|
||||
|
||||
@computed("subscription.subscribed")
|
||||
get subscribedLabel() {
|
||||
return `admin.wizard.subscription.${
|
||||
this.subscription.subscribed ? "subscribed" : "not_subscribed"
|
||||
}.label`;
|
||||
};
|
||||
|
||||
@computed("subscription.subscribed")
|
||||
get subscribedTitle() {
|
||||
return `admin.wizard.subscription.${
|
||||
this.subscription.subscribed ? "subscribed" : "not_subscribed"
|
||||
}.title`;
|
||||
};
|
||||
};
|
|
@ -1,27 +0,0 @@
|
|||
import Component from "@ember/component";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default Component.extend({
|
||||
classNameBindings: [":wizard-subscription-container", "subscribed"],
|
||||
subscription: service(),
|
||||
|
||||
@discourseComputed("subscription.subscribed")
|
||||
subscribedIcon(subscribed) {
|
||||
return subscribed ? "check" : "times";
|
||||
},
|
||||
|
||||
@discourseComputed("subscription.subscribed")
|
||||
subscribedLabel(subscribed) {
|
||||
return `admin.wizard.subscription.${
|
||||
subscribed ? "subscribed" : "not_subscribed"
|
||||
}.label`;
|
||||
},
|
||||
|
||||
@discourseComputed("subscription.subscribed")
|
||||
subscribedTitle(subscribed) {
|
||||
return `admin.wizard.subscription.${
|
||||
subscribed ? "subscribed" : "not_subscribed"
|
||||
}.title`;
|
||||
},
|
||||
});
|
|
@ -1,12 +0,0 @@
|
|||
<div class="subscription-header">
|
||||
<h4>{{i18n "admin.wizard.subscription.title"}}</h4>
|
||||
|
||||
<a href={{subscriptionLink}} title={{i18n subscribedTitle}}>
|
||||
{{d-icon subscribedIcon}}
|
||||
{{i18n subscribedLabel}}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="subscription-settings">
|
||||
{{yield}}
|
||||
</div>
|
Laden …
In neuem Issue referenzieren