mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 14:00:06 +02:00
See #432: added tag search in sidebar
This commit is contained in:
parent
d808a1f1ac
commit
e21e0e50d1
2 changed files with 31 additions and 12 deletions
|
@ -32,6 +32,7 @@ export default {
|
|||
let artistLabel = this.$pgettext('*/*/*/Noun', 'Artist')
|
||||
let albumLabel = this.$pgettext('*/*/*', 'Album')
|
||||
let trackLabel = this.$pgettext('*/*/*/Noun', 'Track')
|
||||
let tagLabel = this.$pgettext('*/*/*/Noun', 'Tag')
|
||||
let self = this
|
||||
var searchQuery;
|
||||
|
||||
|
@ -75,6 +76,9 @@ export default {
|
|||
},
|
||||
getDescription (r) {
|
||||
return ''
|
||||
},
|
||||
getId (t) {
|
||||
return t.id
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -86,6 +90,9 @@ export default {
|
|||
},
|
||||
getDescription (r) {
|
||||
return ''
|
||||
},
|
||||
getId (t) {
|
||||
return t.id
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -97,6 +104,23 @@ export default {
|
|||
},
|
||||
getDescription (r) {
|
||||
return ''
|
||||
},
|
||||
getId (t) {
|
||||
return t.id
|
||||
}
|
||||
},
|
||||
{
|
||||
code: 'tags',
|
||||
route: 'library.tags.detail',
|
||||
name: tagLabel,
|
||||
getTitle (r) {
|
||||
return r.name
|
||||
},
|
||||
getDescription (r) {
|
||||
return ''
|
||||
},
|
||||
getId (t) {
|
||||
return t.name
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -106,13 +130,14 @@ export default {
|
|||
results: []
|
||||
}
|
||||
initialResponse[category.code].forEach(result => {
|
||||
let id = category.getId(result)
|
||||
results[category.code].results.push({
|
||||
title: category.getTitle(result),
|
||||
id: result.id,
|
||||
id,
|
||||
routerUrl: {
|
||||
name: category.route,
|
||||
params: {
|
||||
id: result.id
|
||||
id
|
||||
}
|
||||
},
|
||||
description: category.getDescription(result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue