link to user admin

This commit is contained in:
Rimian Perkins 2019-11-13 15:27:32 +11:00
parent 8aed6b8d30
commit 5fdd81ac77
2 changed files with 13 additions and 13 deletions

View File

@ -4,15 +4,15 @@ import { ajax } from "discourse/lib/ajax";
const AdminSubscription = Discourse.Model.extend({ const AdminSubscription = Discourse.Model.extend({
@computed("metadata") @computed("metadata")
user(metadata) { metadataUserExists(metadata) {
console.log(metadata); return metadata.user_id && metadata.username;
if (metadata.user_id && metadata.username) { },
return EmberObject.create({
id: metadata.user_id, @computed("metadata")
username: metadata.username subscriptionUserPath(metadata) {
}); return Discourse.getURL(
} `/admin/users/${metadata.user_id}/${metadata.username}`
return false; );
} }
}); });

View File

@ -12,10 +12,10 @@
{{#each model as |subscription|}} {{#each model as |subscription|}}
<tr> <tr>
<td> <td>
{{#if subscription.user}} {{#if subscription.metadataUserExists}}
{{#link-to 'adminUser' subscription.user}} <a href="{{unbound subscription.subscriptionUserPath}}">
{{subscription.user.username}} {{subscription.metadata.username}}
{{/link-to}} </a>
{{/if}} {{/if}}
</td> </td>
<td>{{subscription.customer}}</td> <td>{{subscription.customer}}</td>