2020-02-03 08:22:14 -05:00
|
|
|
import DropdownSelectBoxRowComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-row";
|
2020-05-13 16:23:41 -04:00
|
|
|
import I18n from "I18n";
|
2020-02-03 08:22:14 -05:00
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import { escapeExpression } from "discourse/lib/utilities";
|
|
|
|
import { readOnly } from "@ember/object/computed";
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
export default DropdownSelectBoxRowComponent.extend({
|
|
|
|
classNames: ["notifications-button-row"],
|
|
|
|
i18nPrefix: readOnly("selectKit.options.i18nPrefix"),
|
|
|
|
i18nPostfix: readOnly("selectKit.options.i18nPostfix"),
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
label: computed("_start", function () {
|
|
|
|
return escapeExpression(I18n.t(`${this._start}.title`));
|
|
|
|
}),
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
title: readOnly("label"),
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
icons: computed("title", "item.icon", function () {
|
|
|
|
return [escapeExpression(this.item.icon)];
|
|
|
|
}),
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
description: computed("_start", function () {
|
2019-01-16 04:27:27 -05:00
|
|
|
if (this.site && this.site.mobileView) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
return escapeExpression(I18n.t(`${this._start}.description`));
|
|
|
|
}),
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
_start: computed("i18nPrefix", "i18nPostfix", "rowName", function () {
|
|
|
|
return `${this.i18nPrefix}.${this.rowName}${this.i18nPostfix}`;
|
|
|
|
}),
|
2017-10-19 15:51:08 -04:00
|
|
|
});
|