mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-22 02:34:05 +08:00
This commit removes the color palette dropdown from the theme page and replaces it with a new "Colors" tab where the theme's color palette can be edited directly in that tab on the theme page. With this change, a theme's color palette is strongly tied to its theme and can't be linked to other themes and it can't be selected by users without using the theme as well. All of the changes are behind a feature flag. To enable it, turn on the `use_overhauled_theme_color_palette` setting. Co-authored-by: Ella <ella.estigoy@gmail.com>
54 lines
1.2 KiB
Text
Vendored
54 lines
1.2 KiB
Text
Vendored
import Component from "@glimmer/component";
|
|
import { action } from "@ember/object";
|
|
import { service } from "@ember/service";
|
|
import { gt } from "truth-helpers";
|
|
import { i18n } from "discourse-i18n";
|
|
import ChangesBanner from "admin/components/changes-banner";
|
|
|
|
export default class AdminSiteSettingsChangesBanner extends Component {
|
|
@service siteSettingChangeTracker;
|
|
|
|
@action
|
|
async save() {
|
|
await this.siteSettingChangeTracker.save();
|
|
}
|
|
|
|
@action
|
|
discard() {
|
|
this.siteSettingChangeTracker.discard();
|
|
}
|
|
|
|
get dirtyCount() {
|
|
return this.siteSettingChangeTracker.count;
|
|
}
|
|
|
|
get bannerLabel() {
|
|
return i18n("admin.site_settings.dirty_banner", {
|
|
count: this.dirtyCount,
|
|
});
|
|
}
|
|
|
|
get saveLabel() {
|
|
return i18n("admin.site_settings.save", {
|
|
count: this.dirtyCount,
|
|
});
|
|
}
|
|
|
|
get discardLabel() {
|
|
return i18n("admin.site_settings.discard", {
|
|
count: this.dirtyCount,
|
|
});
|
|
}
|
|
|
|
<template>
|
|
{{#if (gt this.dirtyCount 0)}}
|
|
<ChangesBanner
|
|
@bannerLabel={{this.bannerLabel}}
|
|
@saveLabel={{this.saveLabel}}
|
|
@discardLabel={{this.discardLabel}}
|
|
@save={{this.save}}
|
|
@discard={{this.discard}}
|
|
/>
|
|
{{/if}}
|
|
</template>
|
|
}
|