1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 07:09:43 +02:00

set page sequence based on page type

This commit is contained in:
Harvey Kandola 2016-11-10 15:06:59 -08:00
parent f2734edfae
commit c3b13f1626
11 changed files with 42 additions and 35 deletions

View file

@ -194,12 +194,25 @@ type Page struct {
func (p *Page) SetDefaults() {
if len(p.ContentType) == 0 {
p.ContentType = "wysiwyg"
p.PageType = "section"
}
if p.IsTabType() {
p.Sequence = 0
}
p.Title = strings.TrimSpace(p.Title)
}
// IsSectionType tells us that page is "words"
func (p *Page) IsSectionType() bool {
return p.PageType == "section"
}
// IsTabType tells us that page is "SaaS data embed"
func (p *Page) IsTabType() bool {
return p.PageType == "tab"
}
// PageMeta holds raw page data that is used to
// render the actual page data.
type PageMeta struct {