if read only then dump content for ui files

master
Bel LaPointe 2022-02-17 11:43:34 -07:00
parent 0fe427242b
commit 20c1b738a6
3 changed files with 30 additions and 23 deletions

View File

@ -11,7 +11,13 @@
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
{{ template "_filetree" . }}
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
{{ template "_editor" . }}
{{ if .This.ReadOnly }}
<div id="readonly"></div>
{{ .This.Content }}
</script>
{{ else }}
{{ template "_editor" . }}
{{ end }}
</div>
</div>
</div>

View File

@ -37,18 +37,19 @@ func main() {
}
data := map[string]interface{}{
"This": map[string]interface{}{
"ID": "id00/id11",
"Title": "title id11",
"PID": "id00",
"PTitle": "title id00",
"ID": "id00/id11",
"Title": "title id11",
"ReadOnly": false,
"PID": "id00",
"PTitle": "title id00",
"Content": `# hello
## world
| this | is | my | table |
| ---- | ---| ---| ----- |
| hey |
| ya | hey | ya |
| this | is | my | table |
| ---- | --- | --- | ----- |
| hey | ya | hey | ya |
| a | b | c | d |
* and
* a bulleted
@ -93,25 +94,25 @@ newlines
{Title: "title id00 / title id10 / title id20", ID: "id00/id10/id20"},
},
"Tree": `{
"Leaf": {"Meta":{"Title": ""}},
"Leaf": {"Meta":{"Title": "","ReadOnly":false}},
"Branches": {
"id00": {
"Leaf": {"Meta":{"Title": "title id00"}},
"Leaf": {"Meta":{"Title": "title id00","ReadOnly":false}},
"Branches": {
"id10": {"Leaf":{"Meta":{"Title":"title id10"}},"Branches":{
"id20": {"Leaf":{"Meta":{"Title":"title id20"}},"Branches":{}}
"id10": {"Leaf":{"Meta":{"Title":"title id10","ReadOnly":false}},"Branches":{
"id20": {"Leaf":{"Meta":{"Title":"title id20","ReadOnly":false}},"Branches":{}}
}},
"id11": {"Leaf":{"Meta":{"Title":"title id11"}},"Branches":{}}
"id11": {"Leaf":{"Meta":{"Title":"title id11","ReadOnly":false}},"Branches":{}}
}
},
"id01": {"Leaf":{"Meta":{"Title":"title id01"}},"Branches":{}},
"id02": {"Leaf":{"Meta":{"Title":"title id02"}},"Branches":{}},
"id03": {"Leaf":{"Meta":{"Title":"title id03"}},"Branches":{}},
"id04": {"Leaf":{"Meta":{"Title":"title id04"}},"Branches":{}},
"id04": {"Leaf":{"Meta":{"Title":"title id04"}},"Branches":{}},
"id05": {"Leaf":{"Meta":{"Title":"title id05"}},"Branches":{}},
"id06": {"Leaf":{"Meta":{"Title":"title id06"}},"Branches":{}},
"id07": {"Leaf":{"Meta":{"Title":"title id07 but it's really really really long"}},"Branches":{}}
"id01": {"Leaf":{"Meta":{"Title":"title id01","ReadOnly":false}},"Branches":{}},
"id02": {"Leaf":{"Meta":{"Title":"title id02","ReadOnly":false}},"Branches":{}},
"id03": {"Leaf":{"Meta":{"Title":"title id03","ReadOnly":false}},"Branches":{}},
"id04": {"Leaf":{"Meta":{"Title":"title id04","ReadOnly":false}},"Branches":{}},
"id04": {"Leaf":{"Meta":{"Title":"title id04","ReadOnly":false}},"Branches":{}},
"id05": {"Leaf":{"Meta":{"Title":"title id05","ReadOnly":false}},"Branches":{}},
"id06": {"Leaf":{"Meta":{"Title":"title id06","ReadOnly":false}},"Branches":{}},
"id07": {"Leaf":{"Meta":{"Title":"title id07 but it's really really really long","ReadOnly":false}},"Branches":{}}
}
}`,
}

View File

@ -2,7 +2,7 @@
<!DOCTYPE html>
<html>
<header>
<title>{{ .This.Title }}</title>
<title>Search</title>
{{ template "_import" }}
</header>
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">