diff --git a/httpRouters.go b/httpRouters.go index 1589699..58d744f 100644 --- a/httpRouters.go +++ b/httpRouters.go @@ -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) } } diff --git a/posts.go b/posts.go index 2381e09..660adab 100644 --- a/posts.go +++ b/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" { diff --git a/templates/editor.gohtml b/templates/editor.gohtml index 9124786..0b9df28 100644 --- a/templates/editor.gohtml +++ b/templates/editor.gohtml @@ -30,6 +30,7 @@
{{ string .Blog.Lang "drafts" }}
{{ string .Blog.Lang "privateposts" }}
{{ string .Blog.Lang "unlistedposts" }}
+{{ string .Blog.Lang "scheduledposts" }}