mirror of https://github.com/jlelse/GoBlog
Show scheduled posts in editor
This commit is contained in:
parent
9ea6104863
commit
52fad57232
|
@ -344,6 +344,8 @@ func (a *goBlog) blogEditorRouter(conf *configBlog) func(r chi.Router) {
|
||||||
r.Get("/unlisted", a.serveUnlisted)
|
r.Get("/unlisted", a.serveUnlisted)
|
||||||
r.Get("/unlisted"+feedPath, a.serveUnlisted)
|
r.Get("/unlisted"+feedPath, a.serveUnlisted)
|
||||||
r.Get("/unlisted"+paginationPath, a.serveUnlisted)
|
r.Get("/unlisted"+paginationPath, a.serveUnlisted)
|
||||||
|
r.Get("/scheduled", a.serveScheduled)
|
||||||
|
r.Get("/scheduled"+feedPath, a.serveScheduled)
|
||||||
r.HandleFunc("/preview", a.serveEditorPreview)
|
r.HandleFunc("/preview", a.serveEditorPreview)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
9
posts.go
9
posts.go
|
@ -149,6 +149,15 @@ func (a *goBlog) serveUnlisted(w http.ResponseWriter, r *http.Request) {
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *goBlog) serveScheduled(w http.ResponseWriter, r *http.Request) {
|
||||||
|
blog := r.Context().Value(blogKey).(string)
|
||||||
|
a.serveIndex(w, r.WithContext(context.WithValue(r.Context(), indexConfigKey, &indexConfig{
|
||||||
|
path: a.getRelativePath(blog, "/editor/scheduled"),
|
||||||
|
title: a.ts.GetTemplateStringVariant(a.cfg.Blogs[blog].Lang, "scheduledposts"),
|
||||||
|
status: statusScheduled,
|
||||||
|
})))
|
||||||
|
}
|
||||||
|
|
||||||
func (a *goBlog) serveDate(w http.ResponseWriter, r *http.Request) {
|
func (a *goBlog) serveDate(w http.ResponseWriter, r *http.Request) {
|
||||||
var year, month, day int
|
var year, month, day int
|
||||||
if ys := chi.URLParam(r, "year"); ys != "" && ys != "x" {
|
if ys := chi.URLParam(r, "year"); ys != "" && ys != "x" {
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
<p><a href="{{ .Blog.RelativePath "/editor/drafts" }}">{{ string .Blog.Lang "drafts" }}</a></p>
|
<p><a href="{{ .Blog.RelativePath "/editor/drafts" }}">{{ string .Blog.Lang "drafts" }}</a></p>
|
||||||
<p><a href="{{ .Blog.RelativePath "/editor/private" }}">{{ string .Blog.Lang "privateposts" }}</a></p>
|
<p><a href="{{ .Blog.RelativePath "/editor/private" }}">{{ string .Blog.Lang "privateposts" }}</a></p>
|
||||||
<p><a href="{{ .Blog.RelativePath "/editor/unlisted" }}">{{ string .Blog.Lang "unlistedposts" }}</a></p>
|
<p><a href="{{ .Blog.RelativePath "/editor/unlisted" }}">{{ string .Blog.Lang "unlistedposts" }}</a></p>
|
||||||
|
<p><a href="{{ .Blog.RelativePath "/editor/scheduled" }}">{{ string .Blog.Lang "scheduledposts" }}</a></p>
|
||||||
|
|
||||||
<h2>{{ string .Blog.Lang "upload" }}</h2>
|
<h2>{{ string .Blog.Lang "upload" }}</h2>
|
||||||
<form class="fw p" method="post" enctype="multipart/form-data">
|
<form class="fw p" method="post" enctype="multipart/form-data">
|
||||||
|
|
|
@ -43,6 +43,7 @@ prev: "Zurück"
|
||||||
privateposts: "Private Posts"
|
privateposts: "Private Posts"
|
||||||
publishedon: "Veröffentlicht am"
|
publishedon: "Veröffentlicht am"
|
||||||
replyto: "Antwort an"
|
replyto: "Antwort an"
|
||||||
|
scheduledposts: "Geplante Posts"
|
||||||
search: "Suchen"
|
search: "Suchen"
|
||||||
send: "Senden (zur Überprüfung)"
|
send: "Senden (zur Überprüfung)"
|
||||||
share: "Online teilen"
|
share: "Online teilen"
|
||||||
|
|
|
@ -54,6 +54,7 @@ privateposts: "Private posts"
|
||||||
publishedon: "Published on"
|
publishedon: "Published on"
|
||||||
replyto: "Reply to"
|
replyto: "Reply to"
|
||||||
reverify: "Reverify"
|
reverify: "Reverify"
|
||||||
|
scheduledposts: "Scheduled posts"
|
||||||
scopes: "Scopes"
|
scopes: "Scopes"
|
||||||
search: "Search"
|
search: "Search"
|
||||||
send: "Send (to review)"
|
send: "Send (to review)"
|
||||||
|
|
|
@ -54,6 +54,7 @@ privateposts: "Posts privados"
|
||||||
publishedon: "Publicado em"
|
publishedon: "Publicado em"
|
||||||
replyto: "Responder para"
|
replyto: "Responder para"
|
||||||
reverify: "Reverificar"
|
reverify: "Reverificar"
|
||||||
|
scheduledposts: "Posts programados"
|
||||||
scopes: "Scopes"
|
scopes: "Scopes"
|
||||||
search: "Busca"
|
search: "Busca"
|
||||||
send: "Enviar (para revisão)"
|
send: "Enviar (para revisão)"
|
||||||
|
|
Loading…
Reference in New Issue