mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 08:16:00 +08:00

This PR is a first step towards private groups. It redesigns settings/members area of a channel and also drops the "about" page which is now mixed into settings. This commit is also: - introducing chat-form, a small DSL to create forms, ideally I would want something in core for this - introducing a DToggleSwitch page object component to simplify testing toggles - migrating various components to gjs
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
import Component from "@glimmer/component";
|
|
import I18n from "I18n";
|
|
import { inject as service } from "@ember/service";
|
|
|
|
export default class ChatRetentionReminderText extends Component {
|
|
<template>
|
|
<span class="chat-retention-reminder-text">
|
|
{{this.text}}
|
|
</span>
|
|
</template>
|
|
|
|
@service siteSettings;
|
|
|
|
get text() {
|
|
if (this.args.channel.isDirectMessageChannel) {
|
|
if (this.#countForChannelType > 0) {
|
|
return I18n.t("chat.retention_reminders.dm", {
|
|
count: this.siteSettings.chat_dm_retention_days,
|
|
});
|
|
} else {
|
|
return I18n.t("chat.retention_reminders.dm_none");
|
|
}
|
|
} else {
|
|
if (this.#countForChannelType > 0) {
|
|
return I18n.t("chat.retention_reminders.public", {
|
|
count: this.siteSettings.chat_channel_retention_days,
|
|
});
|
|
} else {
|
|
return I18n.t("chat.retention_reminders.public_none");
|
|
}
|
|
}
|
|
}
|
|
|
|
get #countForChannelType() {
|
|
return this.args.channel.isDirectMessageChannel
|
|
? this.siteSettings.chat_dm_retention_days
|
|
: this.siteSettings.chat_channel_retention_days;
|
|
}
|
|
}
|