aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-25 09:58:11 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-25 09:58:11 +0100
commitb1857cbe0437060faa1fc5aa64bc4676a34acd78 (patch)
treec05b647c39a8677c7a26d4c7b46f9cc510530d64 /public
parent234c13ca9a4f111382b9167e647f6ca05da8f1d1 (diff)
downloadgallery-b1857cbe0437060faa1fc5aa64bc4676a34acd78.tar.gz
gallery-b1857cbe0437060faa1fc5aa64bc4676a34acd78.tar.xz
gallery-b1857cbe0437060faa1fc5aa64bc4676a34acd78.zip
Clickable tags in Tags
Diffstat (limited to 'public')
-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)