From e025f3835a8be2cb7f5dab3a1475dc30eb7c36bc Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Wed, 16 Feb 2022 08:22:03 -0700 Subject: [PATCH] highlight current path in tree --- spike/review/reinvent/ezmded/server/server.go | 4 ++-- spike/review/reinvent/ezmded/server/todo.yaml | 6 +++--- spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spike/review/reinvent/ezmded/server/server.go b/spike/review/reinvent/ezmded/server/server.go index 3beabfd..ef75a9f 100644 --- a/spike/review/reinvent/ezmded/server/server.go +++ b/spike/review/reinvent/ezmded/server/server.go @@ -275,8 +275,8 @@ func (server *Server) uiFilesHandler(w http.ResponseWriter, r *http.Request) err "This": map[string]interface{}{ "Title": leaf.Title, "Content": leaf.Content, - "ID": id, - "PID": id.Pop(), + "ID": id.String(), + "PID": id.Pop().String(), "PTitle": parent.Title, }, "Tree": string(branchesJSON), diff --git a/spike/review/reinvent/ezmded/server/todo.yaml b/spike/review/reinvent/ezmded/server/todo.yaml index 90ca4d6..c6e1892 100644 --- a/spike/review/reinvent/ezmded/server/todo.yaml +++ b/spike/review/reinvent/ezmded/server/todo.yaml @@ -1,7 +1,4 @@ todo: -- convert hardcore to IDs are / so things can ignore this fact rather than partially [] and partially modified in frontend -- highlight current page -- search page tree is empty - hide checkbox for tree - delete button does nothing - do not rewrite .md title vs. link cause hrefs to ./gobs.md wont work @@ -17,6 +14,8 @@ todo: - ui; last updated; 2022.02.01T12:34:56 - mark generated via meta so other files in the dir can be created, deleted, replaced safely done: +- search page tree is empty +- highlight current page - fix links - rewrite anchors (maybe gitlab already works :^)) - link to original in generated/scraped @@ -28,3 +27,4 @@ done: - only 1 pid link in tree as title - fix images - breadcrumb; https://concisecss.com/documentation/ui +- convert hardcore to IDs are / so things can ignore this fact rather than partially [] and partially modified in frontend diff --git a/spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl b/spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl index 9f3f9b8..649ecd4 100644 --- a/spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl +++ b/spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl @@ -42,10 +42,10 @@ const name=`filetree-leaf-${nameSafeId}` const parentname=`filetree-leaf-${parentNameSafeId}` const title=id ? branch.Leaf.Title : "ROOT" - const isLive = `{{ .This.ID }}` + const isLive = '{{ .This.ID }}'.slice(0, id.length) == id return `
- + ` }