aboutsummaryrefslogtreecommitdiff
path: root/client/js/util/views.js
diff options
context:
space:
mode:
authorrr-2017-10-01 21:46:53 +0200
committerrr-2017-10-01 21:48:00 +0200
commit1c4c5c5f91dbce7234796daddbb74923638659e7 (patch)
tree1e621ec97c8455613303df066e4d74612f6f1dd0 /client/js/util/views.js
parent253e28c1b5e6757057c0dd36a11fd5063e07ff79 (diff)
remove tags.json
Diffstat (limited to 'client/js/util/views.js')
-rw-r--r--client/js/util/views.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/js/util/views.js b/client/js/util/views.js
index db5ae4b..b0b7cce 100644
--- a/client/js/util/views.js
+++ b/client/js/util/views.js
@@ -3,7 +3,6 @@
require('../util/polyfill.js');
const api = require('../api.js');
const templates = require('../templates.js');
-const tags = require('../tags.js');
const domParser = new DOMParser();
const misc = require('./misc.js');
const uri = require('./uri.js');
@@ -194,13 +193,15 @@ function makePostLink(id, includeHash) {
misc.escapeHtml(text);
}
-function makeTagLink(name, includeHash) {
- const tag = tags.getTagByName(name);
+function makeTagLink(name, includeHash, includeCount, tag) {
const category = tag ? tag.category : 'unknown';
let text = name;
if (includeHash === true) {
text = '#' + text;
}
+ if (includeCount === true) {
+ text += ' (' + (tag ? tag.postCount : 0) + ')';
+ }
return api.hasPrivilege('tags:view') ?
makeElement(
'a',

© 2015 - 2026 Jakob L. Kreuze