mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
FEATURE: JSON editor for theme settings (#21647)
provide the ability to edit theme settings in the json editor, and also copy them as a text file so they can be pasted into another instance. Reference: /t/65023
This commit is contained in:
@ -15,6 +15,7 @@ import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { url } from "discourse/lib/computed";
|
||||
import ThemeSettingsEditor from "admin/components/theme-settings-editor";
|
||||
import ThemeUploadAddModal from "../components/theme-upload-add";
|
||||
|
||||
const THEME_UPLOAD_VAR = 2;
|
||||
@ -251,6 +252,11 @@ export default class AdminCustomizeThemesShowController extends Controller {
|
||||
return userId > 0 && !defaultTheme;
|
||||
}
|
||||
|
||||
@action
|
||||
refreshModel() {
|
||||
this.send("routeRefreshModel");
|
||||
}
|
||||
|
||||
@action
|
||||
updateToLatest() {
|
||||
this.set("updatingRemote", true);
|
||||
@ -396,6 +402,16 @@ export default class AdminCustomizeThemesShowController extends Controller {
|
||||
});
|
||||
}
|
||||
|
||||
@action
|
||||
showThemeSettingsEditor() {
|
||||
this.dialog.alert({
|
||||
title: "Edit Settings",
|
||||
bodyComponent: ThemeSettingsEditor,
|
||||
bodyComponentModel: { model: this.model, controller: this },
|
||||
class: "theme-settings-editor-dialog",
|
||||
});
|
||||
}
|
||||
|
||||
@action
|
||||
switchType() {
|
||||
const relatives = this.get("model.component")
|
||||
|
Reference in New Issue
Block a user