diff --git a/server/public/ui/files.ctmpl b/server/public/ui/files.ctmpl
index 611a14a..6d7b86f 100644
--- a/server/public/ui/files.ctmpl
+++ b/server/public/ui/files.ctmpl
@@ -11,7 +11,13 @@
{{ template "_filetree" . }}
- {{ template "_editor" . }}
+ {{ if .This.ReadOnly }}
+
+ {{ .This.Content }}
+
+ {{ else }}
+ {{ template "_editor" . }}
+ {{ end }}
diff --git a/server/public/ui/render.go b/server/public/ui/render.go
index d97926e..1e3d1cd 100644
--- a/server/public/ui/render.go
+++ b/server/public/ui/render.go
@@ -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":{}}
}
}`,
}
diff --git a/server/public/ui/search.ctmpl b/server/public/ui/search.ctmpl
index 7323f72..4dc9cb3 100644
--- a/server/public/ui/search.ctmpl
+++ b/server/public/ui/search.ctmpl
@@ -2,7 +2,7 @@
- {{ .This.Title }}
+ Search
{{ template "_import" }}