From d945fe936d250877e141fce748783d4fc7d591de Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Sat, 23 Dec 2023 07:59:19 +0100 Subject: WIP: Orphans --- public/gallery.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'public') diff --git a/public/gallery.js b/public/gallery.js index 970a3bf..222bde5 100644 --- a/public/gallery.js +++ b/public/gallery.js @@ -363,6 +363,44 @@ let Duplicates = { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +let OrphansModel = { + entries: [], + + async reload() { + this.entries = await call('orphans', {}) + }, +} + +let OrphansList = { + // See BrowseView. + oncreate(vnode) { vnode.dom.focus() }, + + view(vnode) { + let children = (DuplicatesModel.entries.length == 0) + ? "No orphans" + : OrphansModel.entries.map(group => + m('.row', "TODO")) + return m('.orphans[tabindex=0]', {}, children) + }, +} + +let Orphans = { + oninit(vnode) { + OrphansModel.reload() + }, + + view(vnode) { + return m('.container', {}, [ + m('.header', {}, [ + "Orphans", + ]), + m('.body', {}, m(OrphansList)), + ]) + }, +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + window.addEventListener('load', () => { m.route(document.body, "/browse/", { // The path doesn't need to be escaped, perhaps change that (":key..."). @@ -371,6 +409,7 @@ window.addEventListener('load', () => { "/view/:key": View, "/similar/:key": Similar, "/duplicates": Duplicates, + "/orphans": Orphans, "/tags": undefined, "/tags/:space": undefined, -- cgit v1.2.3-70-g09d2