mirror of
https://github.com/discourse/discourse.git
synced 2024-12-09 21:03:43 +08:00
914f93b896
* Simplify config nav link generation to always inject the Settings tab * Auto-redirect to the first non-settings config link (if there is one) when the user lands on /admin/plugins/:plugin_id * Add `extras` to admin plugin serializer so plugins can add more data on first load * Add PikadayCalendar page object for system specs, extracted from the CalendarDateTimePicker to make it more generic.
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
import Component from "@glimmer/component";
|
|
import { inject as service } from "@ember/service";
|
|
import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";
|
|
import NavItem from "discourse/components/nav-item";
|
|
import i18n from "discourse-common/helpers/i18n";
|
|
|
|
export default class AdminPluginConfigTopNav extends Component {
|
|
@service adminPluginNavManager;
|
|
|
|
linkText(navLink) {
|
|
if (navLink.label) {
|
|
return i18n(navLink.label);
|
|
} else {
|
|
return navLink.text;
|
|
}
|
|
}
|
|
|
|
<template>
|
|
<div class="admin-controls">
|
|
<HorizontalOverflowNav
|
|
class="nav-pills action-list main-nav nav plugin-nav"
|
|
>
|
|
{{#each this.adminPluginNavManager.currentConfigNav.links as |navLink|}}
|
|
<NavItem
|
|
@route={{navLink.route}}
|
|
@i18nLabel={{this.linkText navLink}}
|
|
title={{this.linkText navLink}}
|
|
class="admin-plugin-config-page__top-nav-item"
|
|
>
|
|
{{this.linkText navLink}}
|
|
</NavItem>
|
|
{{/each}}
|
|
</HorizontalOverflowNav>
|
|
</div>
|
|
</template>
|
|
}
|