mirror of https://github.com/jlelse/GoBlog
Show private and unlisted posts in indices when logged in (#26)
This commit is contained in:
parent
548ba794aa
commit
b72089bc4a
3
posts.go
3
posts.go
|
@ -283,6 +283,9 @@ func (a *goBlog) serveIndex(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
if len(statusse) == 0 {
|
if len(statusse) == 0 {
|
||||||
statusse = []postStatus{statusPublished}
|
statusse = []postStatus{statusPublished}
|
||||||
|
if a.isLoggedIn(r) {
|
||||||
|
statusse = append(statusse, statusPrivate, statusUnlisted)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
p := paginator.New(&postPaginationAdapter{config: &postsRequestConfig{
|
p := paginator.New(&postPaginationAdapter{config: &postsRequestConfig{
|
||||||
blog: blog,
|
blog: blog,
|
||||||
|
|
Loading…
Reference in New Issue