if read only then dump content for ui files
parent
0fe427242b
commit
20c1b738a6
|
|
@ -11,7 +11,13 @@
|
||||||
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
<div class="columns thic_flex tb_buffer" style="height: calc(100% - 4rem);">
|
||||||
{{ template "_filetree" . }}
|
{{ template "_filetree" . }}
|
||||||
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
<div class="thic_flex lr_fullscreen" style="margin-left: 1em; width: 5px;">
|
||||||
|
{{ if .This.ReadOnly }}
|
||||||
|
<div id="readonly"></div>
|
||||||
|
{{ .This.Content }}
|
||||||
|
</script>
|
||||||
|
{{ else }}
|
||||||
{{ template "_editor" . }}
|
{{ template "_editor" . }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ func main() {
|
||||||
"This": map[string]interface{}{
|
"This": map[string]interface{}{
|
||||||
"ID": "id00/id11",
|
"ID": "id00/id11",
|
||||||
"Title": "title id11",
|
"Title": "title id11",
|
||||||
|
"ReadOnly": false,
|
||||||
"PID": "id00",
|
"PID": "id00",
|
||||||
"PTitle": "title id00",
|
"PTitle": "title id00",
|
||||||
"Content": `# hello
|
"Content": `# hello
|
||||||
|
|
@ -46,9 +47,9 @@ func main() {
|
||||||
## world
|
## world
|
||||||
|
|
||||||
| this | is | my | table |
|
| this | is | my | table |
|
||||||
| ---- | ---| ---| ----- |
|
| ---- | --- | --- | ----- |
|
||||||
| hey |
|
| hey | ya | hey | ya |
|
||||||
| ya | hey | ya |
|
| a | b | c | d |
|
||||||
|
|
||||||
* and
|
* and
|
||||||
* a bulleted
|
* a bulleted
|
||||||
|
|
@ -93,25 +94,25 @@ newlines
|
||||||
{Title: "title id00 / title id10 / title id20", ID: "id00/id10/id20"},
|
{Title: "title id00 / title id10 / title id20", ID: "id00/id10/id20"},
|
||||||
},
|
},
|
||||||
"Tree": `{
|
"Tree": `{
|
||||||
"Leaf": {"Meta":{"Title": ""}},
|
"Leaf": {"Meta":{"Title": "","ReadOnly":false}},
|
||||||
"Branches": {
|
"Branches": {
|
||||||
"id00": {
|
"id00": {
|
||||||
"Leaf": {"Meta":{"Title": "title id00"}},
|
"Leaf": {"Meta":{"Title": "title id00","ReadOnly":false}},
|
||||||
"Branches": {
|
"Branches": {
|
||||||
"id10": {"Leaf":{"Meta":{"Title":"title id10"}},"Branches":{
|
"id10": {"Leaf":{"Meta":{"Title":"title id10","ReadOnly":false}},"Branches":{
|
||||||
"id20": {"Leaf":{"Meta":{"Title":"title id20"}},"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":{}},
|
"id01": {"Leaf":{"Meta":{"Title":"title id01","ReadOnly":false}},"Branches":{}},
|
||||||
"id02": {"Leaf":{"Meta":{"Title":"title id02"}},"Branches":{}},
|
"id02": {"Leaf":{"Meta":{"Title":"title id02","ReadOnly":false}},"Branches":{}},
|
||||||
"id03": {"Leaf":{"Meta":{"Title":"title id03"}},"Branches":{}},
|
"id03": {"Leaf":{"Meta":{"Title":"title id03","ReadOnly":false}},"Branches":{}},
|
||||||
"id04": {"Leaf":{"Meta":{"Title":"title id04"}},"Branches":{}},
|
"id04": {"Leaf":{"Meta":{"Title":"title id04","ReadOnly":false}},"Branches":{}},
|
||||||
"id04": {"Leaf":{"Meta":{"Title":"title id04"}},"Branches":{}},
|
"id04": {"Leaf":{"Meta":{"Title":"title id04","ReadOnly":false}},"Branches":{}},
|
||||||
"id05": {"Leaf":{"Meta":{"Title":"title id05"}},"Branches":{}},
|
"id05": {"Leaf":{"Meta":{"Title":"title id05","ReadOnly":false}},"Branches":{}},
|
||||||
"id06": {"Leaf":{"Meta":{"Title":"title id06"}},"Branches":{}},
|
"id06": {"Leaf":{"Meta":{"Title":"title id06","ReadOnly":false}},"Branches":{}},
|
||||||
"id07": {"Leaf":{"Meta":{"Title":"title id07 but it's really really really long"}},"Branches":{}}
|
"id07": {"Leaf":{"Meta":{"Title":"title id07 but it's really really really long","ReadOnly":false}},"Branches":{}}
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<header>
|
<header>
|
||||||
<title>{{ .This.Title }}</title>
|
<title>Search</title>
|
||||||
{{ template "_import" }}
|
{{ template "_import" }}
|
||||||
</header>
|
</header>
|
||||||
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
<body class="fullscreen tb_fullscreen lr_fullscreen" style="position: absolute">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue