FIX: Ensure clicking a card loads the user page (#8)
This commit is contained in:
parent
02e70aad1c
commit
d7d4687caf
|
@ -1,8 +1,9 @@
|
||||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import User from "discourse/models/user";
|
import User from "discourse/models/user";
|
||||||
import EmberObject from "@ember/object";
|
import EmberObject, { action } from "@ember/object";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
import DiscourseURL, { userPath } from "discourse/lib/url";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "user-card-directory",
|
name: "user-card-directory",
|
||||||
|
@ -107,6 +108,11 @@ export default {
|
||||||
|
|
||||||
return userCardInfos;
|
return userCardInfos;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@action
|
||||||
|
userCardShowUser(user) {
|
||||||
|
DiscourseURL.routeTo(userPath(user.username_lower));
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
visible=true
|
visible=true
|
||||||
loading=userCard.loading
|
loading=userCard.loading
|
||||||
username=userCard.user.username
|
username=userCard.user.username
|
||||||
|
showUser=this.userCardShowUser
|
||||||
}}
|
}}
|
||||||
{{#if (theme-setting "show_stats")}}
|
{{#if (theme-setting "show_stats")}}
|
||||||
<div class="user-card-directory-footer">
|
<div class="user-card-directory-footer">
|
||||||
|
|
Loading…
Reference in New Issue