Add page for all songs
This commit is contained in:
parent
fda41d1bdd
commit
008ec35176
23
karaokatalog/ui/static/components/pages/All.js
Normal file
23
karaokatalog/ui/static/components/pages/All.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import Base from "./Base.js"
|
||||||
|
import SongList from "../pieces/SongList.js"
|
||||||
|
import Song from "../../model/Song.js"
|
||||||
|
import search from "../../model/search.js"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
oncreate() {
|
||||||
|
document.title = "Alle Songs · Karaokatalog"
|
||||||
|
},
|
||||||
|
oninit() {
|
||||||
|
Song.load()
|
||||||
|
},
|
||||||
|
view() {
|
||||||
|
const songs = search.apply(Song.all)
|
||||||
|
const message = !songs ? "Lade Songs..." : songs.length === 0 ? "Keine Songs gefunden." : null
|
||||||
|
|
||||||
|
return m(
|
||||||
|
Base,
|
||||||
|
message && m("p", message),
|
||||||
|
songs && m(SongList, { songs })
|
||||||
|
)
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user