mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: allow disabling theme components (#7812)
This allows you to temporarily disable components without having to remove them from a theme. This feature is very handy when doing quick fix engineering.
This commit is contained in:
@ -2,6 +2,8 @@ import {
|
||||
default as computed,
|
||||
observes
|
||||
} from "ember-addons/ember-computed-decorators";
|
||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||
import { escape } from "pretty-text/sanitizer";
|
||||
|
||||
const MAX_COMPONENTS = 4;
|
||||
|
||||
@ -64,7 +66,10 @@ export default Ember.Component.extend({
|
||||
children = this.childrenExpanded
|
||||
? children
|
||||
: children.slice(0, MAX_COMPONENTS);
|
||||
return children.map(t => t.get("name"));
|
||||
return children.map(t => {
|
||||
const name = escape(t.name);
|
||||
return t.enabled ? name : `${iconHTML("ban")} ${name}`;
|
||||
});
|
||||
},
|
||||
|
||||
@computed("children")
|
||||
|
Reference in New Issue
Block a user