2024-03-13 11:15:12 +08:00
|
|
|
import Component from "@glimmer/component";
|
|
|
|
import { LinkTo } from "@ember/routing";
|
2024-07-25 21:09:06 +08:00
|
|
|
import { service } from "@ember/service";
|
2024-03-13 11:15:12 +08:00
|
|
|
import concatClass from "discourse/helpers/concat-class";
|
|
|
|
import I18n from "discourse-i18n";
|
|
|
|
|
|
|
|
export default class AdminPluginConfigArea extends Component {
|
2024-03-21 11:42:06 +08:00
|
|
|
@service adminPluginNavManager;
|
|
|
|
|
2024-03-13 11:15:12 +08:00
|
|
|
linkText(navLink) {
|
|
|
|
if (navLink.label) {
|
|
|
|
return I18n.t(navLink.label);
|
|
|
|
} else {
|
|
|
|
return navLink.text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<template>
|
2024-03-21 11:42:06 +08:00
|
|
|
{{#if this.adminPluginNavManager.isSidebarMode}}
|
2024-03-13 11:15:12 +08:00
|
|
|
<nav class="admin-nav admin-plugin-inner-sidebar-nav pull-left">
|
|
|
|
<ul class="nav nav-stacked">
|
2024-03-21 11:42:06 +08:00
|
|
|
{{#each
|
|
|
|
this.adminPluginNavManager.currentConfigNav.links
|
|
|
|
as |navLink|
|
|
|
|
}}
|
2024-03-13 11:15:12 +08:00
|
|
|
<li
|
|
|
|
class={{concatClass
|
|
|
|
"admin-plugin-inner-sidebar-nav__item"
|
|
|
|
navLink.route
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<LinkTo
|
|
|
|
@route={{navLink.route}}
|
|
|
|
@model={{navLink.model}}
|
|
|
|
title={{this.linkText navLink}}
|
|
|
|
>
|
|
|
|
{{this.linkText navLink}}
|
|
|
|
</LinkTo>
|
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{{/if}}
|
|
|
|
<section class="admin-plugin-config-area">
|
|
|
|
{{yield}}
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
}
|