mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
85b8fea262
Refactors three wizard steps (colors, fonts, homepage style) into one new step called Styling.
26 lines
652 B
JavaScript
26 lines
652 B
JavaScript
import Controller from "@ember/controller";
|
|
import { dasherize } from "@ember/string";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
export default Controller.extend({
|
|
currentStepId: null,
|
|
|
|
@discourseComputed("currentStepId")
|
|
showCanvas(currentStepId) {
|
|
return currentStepId === "finished";
|
|
},
|
|
|
|
@discourseComputed("model")
|
|
fontClasses(model) {
|
|
const fontsStep = model.steps.findBy("id", "styling");
|
|
if (!fontsStep) {
|
|
return [];
|
|
}
|
|
|
|
const fontField = fontsStep.get("fieldsById.body_font");
|
|
return fontField.choices.map(
|
|
(choice) => `body-font-${dasherize(choice.id)}`
|
|
);
|
|
},
|
|
});
|