mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 17:48:30 +08:00
We recently added a new themes and components page. We didn't port over the code that enables the Install theme button on Meta. It works by looking for certain query parameters and opening a special version of the install modal. This PR is a lift-and-shift of that code from the old themes page.
25 lines
611 B
JavaScript
Vendored
25 lines
611 B
JavaScript
Vendored
import DiscourseRoute from "discourse/routes/discourse";
|
|
import { i18n } from "discourse-i18n";
|
|
|
|
export default class AdminConfigThemesAndComponentsThemesRoute extends DiscourseRoute {
|
|
queryParams = {
|
|
repoUrl: { replace: true },
|
|
repoName: { replace: true },
|
|
};
|
|
|
|
titleToken() {
|
|
return i18n("admin.config_areas.themes_and_components.themes.title");
|
|
}
|
|
|
|
async model(params) {
|
|
return {
|
|
themes: (
|
|
await this.store.findAll("theme", {
|
|
useConfigAreaEndpoint: true,
|
|
})
|
|
).content,
|
|
repoUrl: params.repoUrl,
|
|
repoName: params.repoName,
|
|
};
|
|
}
|
|
}
|