mirror of
https://ghfast.top/https://github.com/discourse/discourse-bcc.git
synced 2026-07-17 11:46:31 +08:00
29 lines
857 B
Text
29 lines
857 B
Text
/* eslint-disable ember/no-classic-components */
|
|
import Component, { Input } from "@ember/component";
|
|
import { computed } from "@ember/object";
|
|
import { tagName } from "@ember-decorators/component";
|
|
import { i18n } from "discourse-i18n";
|
|
|
|
@tagName("")
|
|
export default class BccCheckbox extends Component {
|
|
@computed("creatingPrivateMessage", "targetRecipients", "targetGroups")
|
|
get bccAvailable() {
|
|
return (
|
|
this.currentUser.staff &&
|
|
this.creatingPrivateMessage &&
|
|
((this.targetRecipients || "").split(",").filter(Boolean).length > 1 ||
|
|
this.targetGroups)
|
|
);
|
|
}
|
|
|
|
<template>
|
|
{{#if this.bccAvailable}}
|
|
<div class="bcc-checkbox">
|
|
<label>
|
|
<Input @type="checkbox" @checked={{this.checked}} />
|
|
{{i18n "discourse_bcc.use_bcc"}}
|
|
</label>
|
|
</div>
|
|
{{/if}}
|
|
</template>
|
|
}
|