From df56060f994735b78c38535997d735d9b6d446cb Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Fri, 9 Aug 2019 13:53:41 -0400 Subject: [PATCH] Add DisableDrafts option and adjust nav This shows Drafts in the SimpleNav menu, when both enabled. It also hides Drafts in the non-SimpleNav menu when disabled. Ref T679 --- config/config.go | 5 ++++- templates/base.tmpl | 1 + templates/user/include/header.tmpl | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index ae6af04..84bae86 100644 --- a/config/config.go +++ b/config/config.go @@ -70,7 +70,10 @@ type ( Landing string `ini:"landing"` SimpleNav bool `ini:"simple_nav"` WFModesty bool `ini:"wf_modesty"` - Chorus bool `ini:"chorus"` + + // Site functionality + Chorus bool `ini:"chorus"` + DisableDrafts bool `ini:"disable_drafts"` // Users SingleUser bool `ini:"single_user"` diff --git a/templates/base.tmpl b/templates/base.tmpl index dac1692..920a36a 100644 --- a/templates/base.tmpl +++ b/templates/base.tmpl @@ -43,6 +43,7 @@ {{ if not .SingleUser }} {{if gt .MaxBlogs 1}}Blogs{{end}} {{if and (and .Chorus (eq .MaxBlogs 1)) .Username}}My Posts{{end}} + {{if not .DisableDrafts}}Drafts{{end}} {{if and (and .LocalTimeline .CanViewReader) (not .Chorus)}}Reader{{end}} {{if and (and .Chorus .OpenRegistration) (not .Username)}}Sign up{{end}} {{if not .Username}}Log in{{else if .SimpleNav}}Log out{{end}} diff --git a/templates/user/include/header.tmpl b/templates/user/include/header.tmpl index 07808b0..8322193 100644 --- a/templates/user/include/header.tmpl +++ b/templates/user/include/header.tmpl @@ -52,13 +52,14 @@ {{ if not .SingleUser }} {{if gt .MaxBlogs 1}}Blogs{{end}} {{if and (and .Chorus (eq .MaxBlogs 1)) .Username}}My Posts{{end}} + {{if not .DisableDrafts}}Drafts{{end}} {{if and (and .LocalTimeline .CanViewReader) (not .Chorus)}}Reader{{end}} {{if and (and .Chorus .OpenRegistration) (not .Username)}}Sign up{{end}} {{if .Username}}Log out{{else}}Log in{{end}} {{ end }} {{else}} Blogs - Drafts + {{if not .DisableDrafts}}Drafts{{end}} {{end}}