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({
|
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;
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue