diff options
| author | rr- | 2017-10-01 21:46:53 +0200 |
|---|---|---|
| committer | rr- | 2017-10-01 21:48:00 +0200 |
| commit | 1c4c5c5f91dbce7234796daddbb74923638659e7 (patch) | |
| tree | 1e621ec97c8455613303df066e4d74612f6f1dd0 /client/js/util/views.js | |
| parent | 253e28c1b5e6757057c0dd36a11fd5063e07ff79 (diff) | |
remove tags.json
Diffstat (limited to 'client/js/util/views.js')
| -rw-r--r-- | client/js/util/views.js | 7 |
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', |