mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 17:35:16 +08:00
40cb46631f
* Nest admin badges controller and route files * Use standard file names for admin-badges * Update resolver to allow standardized file structure for admin * Add adminBadges.index controller for property tracking * Modernize admin badges controller * Modernize admin-badges route * Add admin-badges index route * Modernize admin-badges.show controller and route * Modernize admin-badges.award controller and route * Convert BadgeButton to a Glimmer component
24 lines
606 B
JavaScript
24 lines
606 B
JavaScript
import Controller from "@ember/controller";
|
|
import { inject as service } from "@ember/service";
|
|
import { tracked } from "@glimmer/tracking";
|
|
|
|
export default class AdminBadgesController extends Controller {
|
|
@service router;
|
|
|
|
// Set by the route
|
|
@tracked badgeGroupings;
|
|
@tracked badgeTypes;
|
|
@tracked protectedSystemFields;
|
|
@tracked badgeTriggers;
|
|
|
|
get selectedRoute() {
|
|
const currentRoute = this.router.currentRouteName;
|
|
const indexRoute = "adminBadges.index";
|
|
if (currentRoute === indexRoute) {
|
|
return "adminBadges.show";
|
|
} else {
|
|
return currentRoute;
|
|
}
|
|
}
|
|
}
|