aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/gallery.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/public/gallery.js b/public/gallery.js
index 99bfe0b..299d372 100644
--- a/public/gallery.js
+++ b/public/gallery.js
@@ -237,8 +237,13 @@ let TagsList = {
return (tags.length == 0)
? "No tags"
- : m("ul", tags.map(([name, count]) =>
- m("li", `${name} ×${count}`)))
+ : m("ul", tags.map(([name, count]) => m("li", [
+ m(m.route.Link, {
+ href: `/search/:key`,
+ params: {key: `${vnode.attrs.space}:${name}`},
+ }, ` ${name}`),
+ ` ×${count}`,
+ ])))
},
}
@@ -255,12 +260,12 @@ let TagsView = {
let children = (names.length == 0)
? "No namespaces"
- : names.map(name => {
- const ns = TagsModel.namespaces[name]
+ : names.map(space => {
+ const ns = TagsModel.namespaces[space]
return [
- m("h2", name),
+ m("h2", space),
ns.description ? m("p", ns.description) : [],
- m(TagsList, {tags: ns.tags}),
+ m(TagsList, {space, tags: ns.tags}),
]
})
return m('.tags[tabindex=0]', {}, children)