From 94dd573a818053e9c38852dc81d37f2e627dda06 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Mon, 11 Dec 2023 17:48:08 +0000 Subject: [PATCH] Show a tree of wikis and docs in the wiki app. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4674 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/blog.json | 2 +- apps/wiki.json | 2 +- apps/wiki/tf-wiki-app.js | 24 ++++++++++++++++++------ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/apps/blog.json b/apps/blog.json index 0ac94ac76..8e5c70806 100644 --- a/apps/blog.json +++ b/apps/blog.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🪵", - "previous": "&CMKodqxRSDNxt/MMpYRysfN+6ArnEWaHUiE27J6BOIA=.sha256" + "previous": "&YHBylHM7DlDDiGfuNj+g95Bf7NFxTZs/IKG14TbWnhs=.sha256" } \ No newline at end of file diff --git a/apps/wiki.json b/apps/wiki.json index bfabb2ea1..f7504e7ba 100644 --- a/apps/wiki.json +++ b/apps/wiki.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "📝", - "previous": "&mxGlepLtpWc3IOzgZAKI5gz52tGb+r20LA+aI1qZL1g=.sha256" + "previous": "&FapSqeXK/JbtaIuh3Ot6SNJ1hR7kGRqZwiML5t5GdGw=.sha256" } \ No newline at end of file diff --git a/apps/wiki/tf-wiki-app.js b/apps/wiki/tf-wiki-app.js index c339a2399..8ec7a996d 100644 --- a/apps/wiki/tf-wiki-app.js +++ b/apps/wiki/tf-wiki-app.js @@ -278,12 +278,24 @@ class TfCollectionsAppElement extends LitElement { - ${this.wiki_doc && this.wiki_doc.parent === this.wiki?.id ? html` - - ` : undefined} +
+
+ ${Object.values(this.wikis || {}).map(wiki => html` +
self.on_wiki_changed({detail: {value: wiki}})}>${wiki.name}
+
    + ${Object.values(self.wiki_docs || {}).filter(doc => doc.parent === wiki?.id).map(doc => html` +
  • self.on_wiki_doc_changed({detail: {value: doc}})}>${doc.name}
  • + `)} +
+ `)} +
+ ${this.wiki_doc && this.wiki_doc.parent === this.wiki?.id ? html` + + ` : undefined} +
`; } }