pagebuilder

package
v0.0.0-...-73c3907 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2023 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddContainerDialogEvent          = "page_builder_AddContainerDialogEvent"
	AddContainerEvent                = "page_builder_AddContainerEvent"
	DeleteContainerConfirmationEvent = "page_builder_DeleteContainerConfirmationEvent"
	DeleteContainerEvent             = "page_builder_DeleteContainerEvent"
	MoveContainerEvent               = "page_builder_MoveContainerEvent"
	ToggleContainerVisibilityEvent   = "page_builder_ToggleContainerVisibilityEvent"
	MarkAsSharedContainerEvent       = "page_builder_MarkAsSharedContainerEvent"
	RenameCotainerDialogEvent        = "page_builder_RenameContainerDialogEvent"
	RenameContainerEvent             = "page_builder_RenameContainerEvent"
)
View Source
const FreeStyleKey = "FreeStyle"
View Source
const I18nPageBuilderKey i18n.ModuleKey = "I18nPageBuilderKey"

Variables

View Source
var Messages_en_US = &Messages{
	Category:                       "Category",
	EditPageContent:                "Edit Page Content",
	Preview:                        "Preview",
	Containers:                     "Containers",
	AddContainers:                  "Add Containers",
	New:                            "New",
	Shared:                         "Shared",
	Select:                         "Select",
	SelectedTemplateLabel:          "Template",
	CreateFromTemplate:             "Create From Template",
	RelatedOnlinePages:             "Related Online Pages",
	RepublishAllRelatedOnlinePages: "Republish All",
	Unnamed:                        "Unnamed",
	NotDescribed:                   "Not Described",
	Blank:                          "Blank",
	NewPage:                        "New Page",
}
View Source
var Messages_ja_JP = &Messages{
	Category:                       "カテゴリー",
	EditPageContent:                "ページコンテナを編集する",
	Preview:                        "プレビュー",
	Containers:                     "コンテナ",
	AddContainers:                  "コンテナを追加する",
	New:                            "新規",
	Shared:                         "共有",
	Select:                         "選択する",
	SelectedTemplateLabel:          "テンプレート",
	CreateFromTemplate:             "テンプレートから新規作成する",
	RelatedOnlinePages:             "関連オンラインページ",
	RepublishAllRelatedOnlinePages: "すべて再公開",
	Unnamed:                        "名前なし",
	NotDescribed:                   "記述されていません",
	Blank:                          "空白",
	NewPage:                        "新しいページ",
}
View Source
var Messages_zh_CN = &Messages{
	Category:                       "目录",
	EditPageContent:                "编辑页面内容",
	Preview:                        "预览",
	Containers:                     "组件",
	AddContainers:                  "增加组件",
	New:                            "新增",
	Shared:                         "公用的",
	Select:                         "选择",
	SelectedTemplateLabel:          "模板",
	CreateFromTemplate:             "从模板中创建",
	RelatedOnlinePages:             "相关在线页面",
	RepublishAllRelatedOnlinePages: "重新发布所有页面",
	Unnamed:                        "未命名",
	NotDescribed:                   "未描述",
	Blank:                          "空白",
	NewPage:                        "新页面",
}

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func New

func New(db *gorm.DB, i18nB *i18n.Builder) *Builder

func (*Builder) AddContainer

func (b *Builder) AddContainer(ctx *web.EventContext) (r web.EventResponse, err error)

func (*Builder) AddContainerDialog

func (b *Builder) AddContainerDialog(ctx *web.EventContext) (r web.EventResponse, err error)

func (*Builder) AddContainerToPage

func (b *Builder) AddContainerToPage(pageID int, pageVersion, locale, containerName string) (modelID uint, err error)

func (*Builder) AddSharedContainerToPage

func (b *Builder) AddSharedContainerToPage(pageID int, pageVersion, locale, containerName string, modelID uint) (err error)

func (*Builder) ConfigCategory

func (b *Builder) ConfigCategory(pb *presets.Builder, db *gorm.DB) (pm *presets.ModelBuilder)

func (*Builder) ConfigDemoContainer

func (b *Builder) ConfigDemoContainer(pb *presets.Builder, db *gorm.DB) (pm *presets.ModelBuilder)

func (*Builder) ConfigSharedContainer

func (b *Builder) ConfigSharedContainer(pb *presets.Builder, db *gorm.DB) (pm *presets.ModelBuilder)

func (*Builder) ConfigTemplate

func (b *Builder) ConfigTemplate(pb *presets.Builder, db *gorm.DB) (pm *presets.ModelBuilder)

func (*Builder) Configure

func (b *Builder) Configure(pb *presets.Builder, db *gorm.DB, l10nB *l10n.Builder, activityB *activity.ActivityBuilder) (pm *presets.ModelBuilder)

func (*Builder) ContainerByName

func (b *Builder) ContainerByName(name string) (r *ContainerBuilder)

func (*Builder) DeleteContainer

func (b *Builder) DeleteContainer(ctx *web.EventContext) (r web.EventResponse, err error)

func (*Builder) DeleteContainerConfirmation

func (b *Builder) DeleteContainerConfirmation(ctx *web.EventContext) (r web.EventResponse, err error)

func (*Builder) Editor

func (b *Builder) Editor(ctx *web.EventContext) (r web.PageResponse, err error)

func (*Builder) GetPresetsBuilder

func (b *Builder) GetPresetsBuilder() (r *presets.Builder)

func (*Builder) Images

func (b *Builder) Images(v http.Handler, imagesPrefix string) (r *Builder)

func (*Builder) MarkAsSharedContainer

func (b *Builder) MarkAsSharedContainer(ctx *web.EventContext) (r web.EventResponse, err error)

func (*Builder) MoveContainer

func (b *Builder) MoveContainer(ctx *web.EventContext) (r web.EventResponse, err error)

func (*Builder) PageLayout

func (b *Builder) PageLayout(v PageLayoutFunc) (r *Builder)

func (*Builder) PageStyle

func (b *Builder) PageStyle(v h.HTMLComponent) (r *Builder)

func (*Builder) Prefix

func (b *Builder) Prefix(v string) (r *Builder)

func (*Builder) Preview

func (b *Builder) Preview(ctx *web.EventContext) (r web.PageResponse, err error)

func (*Builder) RegisterContainer

func (b *Builder) RegisterContainer(name string) (r *ContainerBuilder)

func (*Builder) RenameContainer

func (b *Builder) RenameContainer(ctx *web.EventContext) (r web.EventResponse, err error)

func (*Builder) RenameContainerDialog

func (b *Builder) RenameContainerDialog(ctx *web.EventContext) (r web.EventResponse, err error)

func (*Builder) ServeHTTP

func (b *Builder) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Builder) ToggleContainerVisibility

func (b *Builder) ToggleContainerVisibility(ctx *web.EventContext) (r web.EventResponse, err error)

type Category

type Category struct {
	gorm.Model
	Name        string
	Path        string
	Description string

	IndentLevel int `gorm:"-"`
}

func (*Category) TableName

func (*Category) TableName() string

type Container

type Container struct {
	gorm.Model
	PageID       uint
	PageVersion  string
	ModelName    string
	ModelID      uint
	DisplayOrder float64
	Shared       bool
	Hidden       bool
	DisplayName  string

	l10n.Locale
}

func (*Container) PrimaryColumnValuesBySlug

func (this *Container) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*Container) PrimarySlug

func (this *Container) PrimarySlug() string

func (*Container) TableName

func (*Container) TableName() string

type ContainerBuilder

type ContainerBuilder struct {
	// contains filtered or unexported fields
}

func (*ContainerBuilder) Cover

func (*ContainerBuilder) Editing

func (b *ContainerBuilder) Editing(vs ...interface{}) *presets.EditingBuilder

func (*ContainerBuilder) GetModelBuilder

func (b *ContainerBuilder) GetModelBuilder() *presets.ModelBuilder

func (*ContainerBuilder) Model

func (b *ContainerBuilder) Model(m interface{}) *ContainerBuilder

func (*ContainerBuilder) ModelTypeName

func (b *ContainerBuilder) ModelTypeName() string

func (*ContainerBuilder) NewModel

func (b *ContainerBuilder) NewModel() interface{}

func (*ContainerBuilder) RenderFunc

func (b *ContainerBuilder) RenderFunc(v RenderFunc) *ContainerBuilder

func (*ContainerBuilder) URIName

func (b *ContainerBuilder) URIName(uri string) *ContainerBuilder

type ContainerSorter

type ContainerSorter struct {
	Items []ContainerSorterItem `json:"items"`
}

type ContainerSorterItem

type ContainerSorterItem struct {
	Index          int    `json:"index"`
	Label          string `json:"label"`
	ModelName      string `json:"model_name"`
	ModelID        string `json:"model_id"`
	DisplayName    string `json:"display_name"`
	ContainerID    string `json:"container_id"`
	URL            string `json:"url"`
	Shared         bool   `json:"shared"`
	VisibilityIcon string `json:"visibility_icon"`
	ParamID        string `json:"param_id"`
}

type DemoContainer

type DemoContainer struct {
	gorm.Model
	ModelName string
	ModelID   uint

	l10n.Locale
}

func (*DemoContainer) PrimaryColumnValuesBySlug

func (this *DemoContainer) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*DemoContainer) PrimarySlug

func (this *DemoContainer) PrimarySlug() string

func (*DemoContainer) TableName

func (*DemoContainer) TableName() string

type Messages

type Messages struct {
	Category                       string
	EditPageContent                string
	Preview                        string
	Containers                     string
	AddContainers                  string
	New                            string
	Shared                         string
	Select                         string
	SelectedTemplateLabel          string
	CreateFromTemplate             string
	RelatedOnlinePages             string
	RepublishAllRelatedOnlinePages string
	Unnamed                        string
	NotDescribed                   string
	Blank                          string
	NewPage                        string
}

type Page

type Page struct {
	gorm.Model
	Title      string
	Slug       string
	CategoryID uint

	publish.Status
	publish.Schedule
	publish.Version
	l10n.Locale
}

func (*Page) GetPublishActions

func (p *Page) GetPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*Page) GetUnPublishActions

func (p *Page) GetUnPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*Page) L10nON

func (p *Page) L10nON()

func (*Page) PermissionRN

func (p *Page) PermissionRN() []string

func (*Page) PrimaryColumnValuesBySlug

func (p *Page) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*Page) PrimarySlug

func (p *Page) PrimarySlug() string

func (*Page) TableName

func (*Page) TableName() string

type PageLayoutFunc

type PageLayoutFunc func(body h.HTMLComponent, input *PageLayoutInput, ctx *web.EventContext) h.HTMLComponent

type PageLayoutInput

type PageLayoutInput struct {
	Page              *Page
	SeoTags           template.HTML
	CanonicalLink     template.HTML
	StructuredData    template.HTML
	FreeStyleCss      []string
	FreeStyleTopJs    []string
	FreeStyleBottomJs []string
	Header            h.HTMLComponent
	Footer            h.HTMLComponent
	IsEditor          bool
	EditorCss         []h.HTMLComponent
	IsPreview         bool
	Locale            string
}

type RenderFunc

type RenderFunc func(obj interface{}, input *RenderInput, ctx *web.EventContext) h.HTMLComponent

type RenderInput

type RenderInput struct {
	IsEditor bool
	Device   string
}

type Template

type Template struct {
	gorm.Model
	Name        string
	Description string

	l10n.Locale
}

func (*Template) Page

func (m *Template) Page() *Page

func (*Template) PrimaryColumnValuesBySlug

func (this *Template) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*Template) PrimarySlug

func (this *Template) PrimarySlug() string

func (*Template) TableName

func (*Template) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL