diff --git a/pkg/core/permission.go b/pkg/core/permission.go
index 93efd48..547cbc1 100644
--- a/pkg/core/permission.go
+++ b/pkg/core/permission.go
@@ -55,7 +55,7 @@ func WritePerm(username, section string, p *Page) bool {
func writePerm(username string, p *Page) bool {
switch p.Perm {
case Public, Internal:
- if p.Owner == "" {
+ if p.Owner == WikiSection {
return username != ""
}
return username == p.Owner
diff --git a/pkg/db/page.go b/pkg/db/page.go
index eb46bde..ce1b708 100644
--- a/pkg/db/page.go
+++ b/pkg/db/page.go
@@ -60,9 +60,13 @@ func (db *DB) CreatePage(title, section, markdown, username string, p core.Permi
err = errInvalidPermission
return
}
- if section == core.WikiSection && p == core.Private {
- err = errPrivateWikiPage
- return
+ owner := username
+ if section == core.WikiSection {
+ owner = core.WikiSection
+ if p == core.Private {
+ err = errPrivateWikiPage
+ return
+ }
}
st := render.StoreTitle(section, title)
if _, err = db.getPage(st, username); err != nil && err != store.ErrKeyNotFound {
@@ -74,7 +78,7 @@ func (db *DB) CreatePage(title, section, markdown, username string, p core.Permi
StoreTitle: st,
Markdown: markdown,
Created: created(username),
- Owner: username,
+ Owner: owner,
Perm: p,
}
//search := render.Render(page)
diff --git a/pkg/server/templates.go b/pkg/server/templates.go
index 66b8f3a..6decf95 100644
--- a/pkg/server/templates.go
+++ b/pkg/server/templates.go
@@ -18,23 +18,40 @@ const (
{{.BodyTitle}}
+{{if .Data}}
-
+{{$idx0 := index .Data 0}}
+{{$owner := $idx0.Owner}}
+
{{$owner}}
+
+
+{{range $item := .Data}}
+{{if ne $owner $item.Owner}}
+{{$owner := $item.Owner}}
+
+
+
+{{$owner}}
+
+
+{{end}}
{{end}}`
index = `
GoWiki | {{.Title}}
-
+
-
+
GoWiki
@@ -55,14 +72,14 @@ const (
-
+
Created by: {{.Data.Created}}
{{if .Data.Updated}}
Updated by: {{.Data.Updated}}
@@ -231,11 +248,11 @@ const (
-
+
{{.Data.PageIndex}}
-
-
+
+
{{if .Key}}
+
+
+
+
Share Link
{{else}}
@@ -333,7 +354,7 @@ const (
-
+
Created by: {{.Data.Created}}
{{if .Data.Updated}}
Updated by: {{.Data.Updated}}
@@ -342,11 +363,11 @@ const (
-
+
{{.Data.PageIndex}}
-
-
+
@@ -375,7 +396,7 @@ const (
-
+
{{range $item := .Data}}
{{$item.Title}}
{{$item.Text}}
@@ -470,13 +491,13 @@ const (
{{if .Admin}}
-
{{end}}
-
+
{{if .Data}}
@@ -654,6 +675,10 @@ textarea,input,select {
color: #e2e2e2 !important;
background-color: #444444 !important;
}
+input.menu {
+ color: #e2e2e2 !important;
+ background-color: #222222 !important;
+}
.menu-search-bar {
padding-top: 4px;
}
diff --git a/templates/all.html b/templates/all.html
index 80fed8e..d978b4c 100644
--- a/templates/all.html
+++ b/templates/all.html
@@ -4,11 +4,28 @@
{{.BodyTitle}}
+{{if .Data}}
-
+{{$idx0 := index .Data 0}}
+{{$owner := $idx0.Owner}}
+
{{$owner}}
+
+
+
+{{range $item := .Data}}
+{{if ne $owner $item.Owner}}
+{{$owner := $item.Owner}}
+
+
+
+{{$owner}}
+
+
{{end}}
+{{end}}
diff --git a/templates/custom.css b/templates/custom.css
index fbfae1b..33d0cab 100644
--- a/templates/custom.css
+++ b/templates/custom.css
@@ -94,6 +94,10 @@ textarea,input,select {
color: #e2e2e2 !important;
background-color: #444444 !important;
}
+input.menu {
+ color: #e2e2e2 !important;
+ background-color: #222222 !important;
+}
.menu-search-bar {
padding-top: 4px;
}
diff --git a/templates/index.html b/templates/index.html
index aaeed3f..4a0eef6 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -3,10 +3,10 @@
GoWiki | {{.Title}}
-
+
-
+
GoWiki
-
+
Created by: {{.Data.Created}}
{{if .Data.Updated}}
Updated by: {{.Data.Updated}}
@@ -14,11 +14,11 @@
-
+
{{.Data.PageIndex}}
-
-
+
+
Markdown
{{if .Login}}
Edit
diff --git a/templates/pageShare.html b/templates/pageShare.html
index 05edd70..e53af8d 100644
--- a/templates/pageShare.html
+++ b/templates/pageShare.html
@@ -8,13 +8,17 @@
{{if .Key}}
+
+
+
+
Share Link
{{else}}
diff --git a/templates/pageView.html b/templates/pageView.html
index f623a32..a305cf7 100644
--- a/templates/pageView.html
+++ b/templates/pageView.html
@@ -5,7 +5,7 @@
-
+
Created by: {{.Data.Created}}
{{if .Data.Updated}}
Updated by: {{.Data.Updated}}
@@ -14,11 +14,11 @@
-
+
{{.Data.PageIndex}}
-
-
+
diff --git a/templates/search.html b/templates/search.html
index f242d07..3a42deb 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -20,7 +20,7 @@
-
+
{{range $item := .Data}}
{{$item.Title}}
{{$item.Text}}
diff --git a/templates/user.html b/templates/user.html
index e45bca6..b094ced 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -6,13 +6,13 @@
{{if .Admin}}