2020-02-03 21:22:14 +08:00
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import { readOnly } from "@ember/object/computed";
|
2023-10-11 02:38:59 +08:00
|
|
|
import { escapeExpression } from "discourse/lib/utilities";
|
2023-10-18 18:07:09 +08:00
|
|
|
import I18n from "discourse-i18n";
|
2023-10-11 02:38:59 +08:00
|
|
|
import DropdownSelectBoxRowComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-row";
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
export default DropdownSelectBoxRowComponent.extend({
|
|
|
|
classNames: ["notifications-button-row"],
|
|
|
|
i18nPrefix: readOnly("selectKit.options.i18nPrefix"),
|
|
|
|
i18nPostfix: readOnly("selectKit.options.i18nPostfix"),
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
label: computed("_start", function () {
|
|
|
|
return escapeExpression(I18n.t(`${this._start}.title`));
|
|
|
|
}),
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2023-10-03 01:54:59 +08:00
|
|
|
icons: computed("item.icon", function () {
|
2020-02-03 21:22:14 +08:00
|
|
|
return [escapeExpression(this.item.icon)];
|
|
|
|
}),
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
description: computed("_start", function () {
|
2019-01-16 17:27:27 +08:00
|
|
|
if (this.site && this.site.mobileView) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
return escapeExpression(I18n.t(`${this._start}.description`));
|
|
|
|
}),
|
2017-10-20 03:51:08 +08:00
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
_start: computed("i18nPrefix", "i18nPostfix", "rowName", function () {
|
|
|
|
return `${this.i18nPrefix}.${this.rowName}${this.i18nPostfix}`;
|
|
|
|
}),
|
2017-10-20 03:51:08 +08:00
|
|
|
});
|