mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 16:34:23 +08:00
ae79ba1447
Example: ```hbs <DBreadcrumbItem @path="/admin/plugins/{{@plugin.name}}" @label={{@plugin.nameTitleized}} /> ``` Using `@path` instead of `@route`+`@model` combo makes it impossible to pass temporarily unresolvable routes. This fixes a bug with navigating from a model-based route to a parent route.
56 lines
1.7 KiB
Plaintext
56 lines
1.7 KiB
Plaintext
import Component from "@glimmer/component";
|
|
import { service } from "@ember/service";
|
|
import DBreadcrumbsContainer from "discourse/components/d-breadcrumbs-container";
|
|
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
|
|
import i18n from "discourse-common/helpers/i18n";
|
|
import AdminPluginConfigArea from "./admin-plugin-config-area";
|
|
import AdminPluginConfigMetadata from "./admin-plugin-config-metadata";
|
|
import AdminPluginConfigTopNav from "./admin-plugin-config-top-nav";
|
|
|
|
export default class AdminPluginConfigPage extends Component {
|
|
@service currentUser;
|
|
@service adminPluginNavManager;
|
|
|
|
get mainAreaClasses() {
|
|
let classes = ["admin-plugin-config-page__main-area"];
|
|
|
|
if (this.adminPluginNavManager.isSidebarMode) {
|
|
classes.push("-with-inner-sidebar");
|
|
} else {
|
|
classes.push("-without-inner-sidebar");
|
|
}
|
|
|
|
return classes.join(" ");
|
|
}
|
|
|
|
<template>
|
|
<div class="admin-plugin-config-page">
|
|
<DBreadcrumbsContainer />
|
|
|
|
<DBreadcrumbsItem @path="/admin" @label={{i18n "admin_title"}} />
|
|
<DBreadcrumbsItem
|
|
@path="/admin/plugins"
|
|
@label={{i18n "admin.plugins.title"}}
|
|
/>
|
|
<DBreadcrumbsItem
|
|
@path="/admin/plugins/{{@plugin.name}}"
|
|
@label={{@plugin.nameTitleized}}
|
|
/>
|
|
|
|
<AdminPluginConfigMetadata @plugin={{@plugin}} />
|
|
|
|
{{#if this.adminPluginNavManager.isTopMode}}
|
|
<AdminPluginConfigTopNav />
|
|
{{/if}}
|
|
|
|
<div class="admin-plugin-config-page__content">
|
|
<div class={{this.mainAreaClasses}}>
|
|
<AdminPluginConfigArea>
|
|
{{yield}}
|
|
</AdminPluginConfigArea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
}
|