This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/user-card.js.es6
Jarek Radosz ef6b7bd776
DEV: Use aliased inject imports (#9086)
This is a common Ember idiom for easier differentiation between controller and service imports.
2020-03-06 11:41:41 -05:00

24 lines
592 B
JavaScript

import { inject as service } from "@ember/service";
import Controller, { inject as controller } from "@ember/controller";
import DiscourseURL, { userPath, groupPath } from "discourse/lib/url";
export default Controller.extend({
topic: controller(),
router: service(),
actions: {
togglePosts(user) {
const topicController = this.topic;
topicController.send("toggleParticipant", user);
},
showUser(user) {
DiscourseURL.routeTo(userPath(user.username_lower));
},
showGroup(group) {
DiscourseURL.routeTo(groupPath(group.name));
}
}
});