mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:23:13 +08:00
d69c5eebcf
* UI: Mass grant a badge from the admin ui * Send the uploaded CSV and badge ID to the backend * Read the CSV and grant badge in batches * UX: Communicate the result to the user * Don't award if badge is disabled * Create a 'send_notification' method to remove duplicated code, slightly shrink badge image. Replace router transition with href. * Dynamically discover current route
19 lines
544 B
JavaScript
19 lines
544 B
JavaScript
import Controller from "@ember/controller";
|
|
import { inject as service } from "@ember/service";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
export default Controller.extend({
|
|
routing: service("-routing"),
|
|
|
|
@discourseComputed("routing.currentRouteName")
|
|
selectedRoute() {
|
|
const currentRoute = this.routing.currentRouteName;
|
|
const indexRoute = "adminBadges.index";
|
|
if (currentRoute === indexRoute) {
|
|
return "adminBadges.show";
|
|
} else {
|
|
return this.routing.currentRouteName;
|
|
}
|
|
}
|
|
});
|