mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
DEV: Convert activation-controls to gjs (#25344)
This commit is contained in:
parent
749b490188
commit
3fc06e4345
|
@ -0,0 +1,35 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { inject as service } from "@ember/service";
|
||||
import DButton from "discourse/components/d-button";
|
||||
|
||||
export default class ActivationControls extends Component {
|
||||
@service siteSettings;
|
||||
|
||||
get canEditEmail() {
|
||||
return (
|
||||
this.siteSettings.enable_local_logins || this.siteSettings.email_editable
|
||||
);
|
||||
}
|
||||
|
||||
<template>
|
||||
<div class="activation-controls">
|
||||
{{#unless this.siteSettings.must_approve_users}}
|
||||
<DButton
|
||||
@action={{@sendActivationEmail}}
|
||||
@label="login.resend_title"
|
||||
@icon="envelope"
|
||||
class="btn-primary resend"
|
||||
/>
|
||||
{{/unless}}
|
||||
|
||||
{{#if this.canEditEmail}}
|
||||
<DButton
|
||||
@action={{@editActivationEmail}}
|
||||
@label="login.change_email"
|
||||
@icon="pencil-alt"
|
||||
class="edit-email"
|
||||
/>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{{#unless this.siteSettings.must_approve_users}}
|
||||
<DButton
|
||||
@action={{this.sendActivationEmail}}
|
||||
@label="login.resend_title"
|
||||
@icon="envelope"
|
||||
class="btn-primary resend"
|
||||
/>
|
||||
{{/unless}}
|
||||
|
||||
{{#if this.canEditEmail}}
|
||||
<DButton
|
||||
@action={{this.editActivationEmail}}
|
||||
@label="login.change_email"
|
||||
@icon="pencil-alt"
|
||||
class="edit-email"
|
||||
/>
|
||||
{{/if}}
|
|
@ -1,10 +0,0 @@
|
|||
import Component from "@ember/component";
|
||||
import { or } from "@ember/object/computed";
|
||||
|
||||
export default Component.extend({
|
||||
classNames: "activation-controls",
|
||||
canEditEmail: or(
|
||||
"siteSettings.enable_local_logins",
|
||||
"siteSettings.email_editable"
|
||||
),
|
||||
});
|
Loading…
Reference in New Issue
Block a user