mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-21 00:18:33 +08:00
For historical reasons, Discourse has a customized Ember resolver. This had a much more fuzzy implementation of 'normalize' and 'findTemplate' functions. This leniency meant that our file naming hasn't always matched Ember conventions. Standardizing our naming will make things easier to understand for developers, and will make adoption of newer ecosystem tooling easier (e.g. route-based bundle splitting in Embroider/vite) This commit adds deprecations to the resolver when this leniency is used, and uses a fully bespoke codemod to rename all of the affected routes/controllers/templates in the Discourse core repository. Backwards-compatibility is maintained for anyone looking up the old names in the resolver.
99 lines
3.3 KiB
Text
Vendored
99 lines
3.3 KiB
Text
Vendored
import RouteTemplate from "ember-route-template";
|
|
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
|
|
import DPageHeader from "discourse/components/d-page-header";
|
|
import NavItem from "discourse/components/nav-item";
|
|
import routeAction from "discourse/helpers/route-action";
|
|
import { i18n } from "discourse-i18n";
|
|
|
|
export default RouteTemplate(
|
|
<template>
|
|
<div class="admin-users admin-config-page">
|
|
<DPageHeader
|
|
@titleLabel={{i18n "admin.config.users.title"}}
|
|
@descriptionLabel={{i18n "admin.config.users.header_description"}}
|
|
@learnMoreUrl="https://meta.discourse.org/t/accessing-a-user-s-admin-page/311859"
|
|
>
|
|
<:breadcrumbs>
|
|
<DBreadcrumbsItem @path="/admin" @label={{i18n "admin_title"}} />
|
|
<DBreadcrumbsItem
|
|
@path="/admin/users/list"
|
|
@label={{i18n "admin.config.users.title"}}
|
|
/>
|
|
</:breadcrumbs>
|
|
<:actions as |actions|>
|
|
{{#if @controller.currentUser.can_invite_to_forum}}
|
|
<actions.Primary
|
|
@action={{routeAction "sendInvites"}}
|
|
@title="admin.invite.button_title"
|
|
@label="admin.invite.button_text"
|
|
class="admin-users__header-send-invites"
|
|
/>
|
|
{{/if}}
|
|
|
|
{{#if @controller.currentUser.admin}}
|
|
<actions.Primary
|
|
@action={{routeAction "exportUsers"}}
|
|
@title="admin.export_csv.button_title.user"
|
|
@label="admin.export_csv.button_text"
|
|
class="admin-users__header-export-users"
|
|
/>
|
|
{{/if}}
|
|
</:actions>
|
|
<:tabs>
|
|
<NavItem
|
|
@route="adminUsers.settings"
|
|
@label="settings"
|
|
class="admin-users-tabs__settings"
|
|
/>
|
|
<NavItem
|
|
@route="adminUsersList.show"
|
|
@routeParam="active"
|
|
@label="admin.users.nav.active"
|
|
class="admin-users-tabs__active"
|
|
/>
|
|
<NavItem
|
|
@route="adminUsersList.show"
|
|
@routeParam="new"
|
|
@label="admin.users.nav.new"
|
|
class="admin-users-tabs__new"
|
|
/>
|
|
<NavItem
|
|
@route="adminUsersList.show"
|
|
@routeParam="staff"
|
|
@label="admin.users.nav.staff"
|
|
class="admin-users-tabs__staff"
|
|
/>
|
|
<NavItem
|
|
@route="adminUsersList.show"
|
|
@routeParam="suspended"
|
|
@label="admin.users.nav.suspended"
|
|
class="admin-users-tabs__suspended"
|
|
/>
|
|
<NavItem
|
|
@route="adminUsersList.show"
|
|
@routeParam="silenced"
|
|
@label="admin.users.nav.silenced"
|
|
class="admin-users-tabs__silenced"
|
|
/>
|
|
<NavItem
|
|
@route="adminUsersList.show"
|
|
@routeParam="staged"
|
|
@label="admin.users.nav.staged"
|
|
class="admin-users-tabs__staged"
|
|
/>
|
|
<NavItem
|
|
@route="adminGroups.index"
|
|
@label="groups.index.title"
|
|
class="admin-users-tabs__groups"
|
|
/>
|
|
</:tabs>
|
|
</DPageHeader>
|
|
<div class="admin-container admin-config-page__main-area">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-container admin-config-page__main-area">
|
|
{{outlet}}
|
|
</div>
|
|
</template>
|
|
);
|