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({
@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}`
);
}
});

View File

@ -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>