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"+feedPath, a.serveUnlisted)
|
||||
r.Get("/unlisted"+paginationPath, a.serveUnlisted)
|
||||
r.Get("/scheduled", a.serveScheduled)
|
||||
r.Get("/scheduled"+feedPath, a.serveScheduled)
|
||||
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) {
|
||||
var year, month, day int
|
||||
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/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/scheduled" }}">{{ string .Blog.Lang "scheduledposts" }}</a></p>
|
||||
|
||||
<h2>{{ string .Blog.Lang "upload" }}</h2>
|
||||
<form class="fw p" method="post" enctype="multipart/form-data">
|
||||
|
|
|
@ -43,6 +43,7 @@ prev: "Zurück"
|
|||
privateposts: "Private Posts"
|
||||
publishedon: "Veröffentlicht am"
|
||||
replyto: "Antwort an"
|
||||
scheduledposts: "Geplante Posts"
|
||||
search: "Suchen"
|
||||
send: "Senden (zur Überprüfung)"
|
||||
share: "Online teilen"
|
||||
|
|
|
@ -54,6 +54,7 @@ privateposts: "Private posts"
|
|||
publishedon: "Published on"
|
||||
replyto: "Reply to"
|
||||
reverify: "Reverify"
|
||||
scheduledposts: "Scheduled posts"
|
||||
scopes: "Scopes"
|
||||
search: "Search"
|
||||
send: "Send (to review)"
|
||||
|
|
|
@ -54,6 +54,7 @@ privateposts: "Posts privados"
|
|||
publishedon: "Publicado em"
|
||||
replyto: "Responder para"
|
||||
reverify: "Reverificar"
|
||||
scheduledposts: "Posts programados"
|
||||
scopes: "Scopes"
|
||||
search: "Busca"
|
||||
send: "Enviar (para revisão)"
|
||||
|
|
Loading…
Reference in New Issue