Add proper user path
This commit is contained in:
parent
a353eed1c3
commit
b98e603e59
|
|
@ -1,6 +1,7 @@
|
||||||
import { createWidget } from 'discourse/widgets/widget';
|
import { createWidget } from 'discourse/widgets/widget';
|
||||||
import { h } from 'virtual-dom';
|
import { h } from 'virtual-dom';
|
||||||
import { avatarFor } from 'discourse/widgets/post';
|
import { avatarFor } from 'discourse/widgets/post';
|
||||||
|
import { userPath } from "discourse/lib/url";
|
||||||
|
|
||||||
function donationDisplay(amount, type) {
|
function donationDisplay(amount, type) {
|
||||||
return h(`div.donations-${type}`, [
|
return h(`div.donations-${type}`, [
|
||||||
|
|
@ -77,13 +78,17 @@ createWidget('category-header-widget', {
|
||||||
users.push(h('div.donations-backers', [
|
users.push(h('div.donations-backers', [
|
||||||
h('div.donations-backers-title', I18n.t('discourse_donations.cause.backers.label')),
|
h('div.donations-backers-title', I18n.t('discourse_donations.cause.backers.label')),
|
||||||
category.donations_backers.map(user => {
|
category.donations_backers.map(user => {
|
||||||
return avatarFor('medium', {
|
if (user) {
|
||||||
template: user.avatar_template,
|
return avatarFor('medium', {
|
||||||
username: user.username,
|
template: user.avatar_template,
|
||||||
name: user.name,
|
username: user.username,
|
||||||
url: user.usernameUrl,
|
name: user.name,
|
||||||
className: "backer-avatar"
|
url: userPath(user.username),
|
||||||
});
|
className: "backer-avatar"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
]));
|
]));
|
||||||
};
|
};
|
||||||
|
|
@ -100,7 +105,7 @@ createWidget('category-header-widget', {
|
||||||
template: user.avatar_template,
|
template: user.avatar_template,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
url: user.usernameUrl,
|
url: userPath(user.username),
|
||||||
className: "maintainer-avatar"
|
className: "maintainer-avatar"
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue