Add list of posts to pools

This commit is contained in:
Ruin0x11
2020-05-04 00:09:33 -07:00
parent d59ecb8e23
commit e6bf102bc0
29 changed files with 267 additions and 117 deletions

View File

@ -221,20 +221,20 @@ function makeTagLink(name, includeHash, includeCount, tag) {
misc.escapeHtml(text));
}
function makePoolLink(pool, includeHash, includeCount, name) {
const category = pool.category;
function makePoolLink(id, includeHash, includeCount, pool, name) {
const category = pool ? pool.category : 'unknown';
let text = name ? name : pool.names[0];
if (includeHash === true) {
text = '#' + text;
}
if (includeCount === true) {
text += ' (' + pool.postCount + ')';
text += ' (' + (pool ? pool.postCount : 0) + ')';
}
return api.hasPrivilege('pools:view') ?
makeElement(
'a',
{
href: uri.formatClientLink('pool', pool.id),
href: uri.formatClientLink('pool', id),
class: misc.makeCssName(category, 'pool'),
},
misc.escapeHtml(text)) :