link to user admin
This commit is contained in:
parent
8aed6b8d30
commit
5fdd81ac77
|
@ -4,15 +4,15 @@ import { ajax } from "discourse/lib/ajax";
|
|||
|
||||
const AdminSubscription = Discourse.Model.extend({
|
||||
@computed("metadata")
|
||||
user(metadata) {
|
||||
console.log(metadata);
|
||||
if (metadata.user_id && metadata.username) {
|
||||
return EmberObject.create({
|
||||
id: metadata.user_id,
|
||||
username: metadata.username
|
||||
});
|
||||
}
|
||||
return false;
|
||||
metadataUserExists(metadata) {
|
||||
return metadata.user_id && metadata.username;
|
||||
},
|
||||
|
||||
@computed("metadata")
|
||||
subscriptionUserPath(metadata) {
|
||||
return Discourse.getURL(
|
||||
`/admin/users/${metadata.user_id}/${metadata.username}`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
{{#each model as |subscription|}}
|
||||
<tr>
|
||||
<td>
|
||||
{{#if subscription.user}}
|
||||
{{#link-to 'adminUser' subscription.user}}
|
||||
{{subscription.user.username}}
|
||||
{{/link-to}}
|
||||
{{#if subscription.metadataUserExists}}
|
||||
<a href="{{unbound subscription.subscriptionUserPath}}">
|
||||
{{subscription.metadata.username}}
|
||||
</a>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{subscription.customer}}</td>
|
||||
|
|
Loading…
Reference in New Issue