This commit is contained in:
bel
2022-02-16 07:57:47 -07:00
parent 24acc02dc7
commit 09532849d4
3 changed files with 72 additions and 57 deletions

View File

@@ -200,7 +200,6 @@ func (server *Server) putContentHandler(filePath string, w http.ResponseWriter,
}
func (server *Server) uiSearchHandler(w http.ResponseWriter, r *http.Request) error {
r.URL.Path = strings.TrimPrefix(r.URL.Path, "/ui/files")
t, err := server.uiSubTemplates()
if err != nil {
return err
@@ -261,11 +260,11 @@ func (server *Server) uiFilesHandler(w http.ResponseWriter, r *http.Request) err
leaf.Title = "My New File"
}
data := map[string]interface{}{
"This": map[string]string{
"This": map[string]interface{}{
"Title": leaf.Title,
"Content": leaf.Content,
"ID": r.URL.Path,
"PID": strings.TrimPrefix(path.Dir(r.URL.Path), "/"),
"ID": id,
"PID": id.Pop(),
"PTitle": parent.Title,
},
"Tree": string(branchesJSON),