pagebuilder

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 42 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AddContainerEvent                = "page_builder_AddContainerEvent"
	DeleteContainerConfirmationEvent = "page_builder_DeleteContainerConfirmationEvent"
	DeleteContainerEvent             = "page_builder_DeleteContainerEvent"
	MoveContainerEvent               = "page_builder_MoveContainerEvent"
	MoveUpDownContainerEvent         = "page_builder_MoveUpDownContainerEvent"
	ToggleContainerVisibilityEvent   = "page_builder_ToggleContainerVisibilityEvent"
	MarkAsSharedContainerEvent       = "page_builder_MarkAsSharedContainerEvent"
	RenameContainerDialogEvent       = "page_builder_RenameContainerDialogEvent"
	RenameContainerEvent             = "page_builder_RenameContainerEvent"
	ShowSortedContainerDrawerEvent   = "page_builder_ShowSortedContainerDrawerEvent"
	ReloadRenderPageOrTemplateEvent  = "page_builder_ReloadRenderPageOrTemplateEvent"
	ContainerPreviewEvent            = "page_builder_ContainerPreviewEvent"
	ReplicateContainerEvent          = "page_builder_ReplicateContainerEvent"
	EditContainerEvent               = "page_builder_EditContainerEvent"
	UpdateContainerEvent             = "page_builder_UpdateContainerEvent"

	DevicePhone    = "phone"
	DeviceTablet   = "tablet"
	DeviceComputer = "computer"

	EventUp     = "up"
	EventDown   = "down"
	EventDelete = "delete"
	EventAdd    = "add"
	EventEdit   = "edit"
)
View Source
const (
	ParamPage               = "page"
	ParamPerPage            = "per_page"
	ParamTemplateSelectedID = "select_id"
	ParamSearchKeyword      = "keyword"
)
View Source
const (
	PageTemplateSelectionFiled = "TemplateSelection"

	OpenTemplateDialogEvent     = "page_builder_template_OpenTemplateDialogEvent"
	ReloadSelectedTemplateEvent = "page_builder_template_ReloadSelectedTemplateEvent"
	ReloadTemplateContentEvent  = "page_builder_template_ReloadTemplateContentEvent"

	PageTemplatePortalName         = "PageTemplatePortalName"
	TemplateSelectDialogPortalName = "TemplateSelectDialogPortalName"
	TemplateSelectedPortalName     = "TemplateSelectedPortalName"
)
View Source
const I18nPageBuilderKey i18n.ModuleKey = "I18nPageBuilderKey"
View Source
const (
	PageBuilderPreviewCard = "PageBuilderPreviewCard"
)

Variables

View Source
var Messages_en_US = &Messages{
	Category:                       "Category",
	Preview:                        "Preview",
	Containers:                     "Containers",
	AddContainers:                  "Add Containers",
	New:                            "New",
	Shared:                         "Shared",
	Select:                         "Select",
	SelectedTemplateLabel:          "Template",
	CreateFromTemplate:             "Create From Template",
	ChangeTemplate:                 "Change Template",
	RelatedOnlinePages:             "Related Online Pages",
	RepublishAllRelatedOnlinePages: "Republish All",
	Unnamed:                        "Unnamed",
	NotDescribed:                   "Not Described",
	Blank:                          "Blank",
	BlankPage:                      "Blank Page",
	AddBlankPage:                   "Add Blank Page",
	NewPage:                        "New Page",
	FilterTabAllVersions:           "All Versions",
	FilterTabOnlineVersion:         "Online Versions",
	FilterTabNamedVersions:         "Named Versions",
	PageBuilder:                    "Page Builder",
	PageTemplate:                   "Page Template",
	Rename:                         "Rename",
	Hide:                           "Hide",
	Show:                           "Show",
	PageOverView:                   "Page Overview",

	Others:                    "Others",
	Add:                       "Add",
	AddContainer:              "Add Container",
	BuildYourPages:            "Build your pages",
	BuildYourTemplates:        "Build your templates",
	PlaceAnElementFromLibrary: "Place an element from  library.",
	NewElement:                "New Element",
	Title:                     "Title",
	Slug:                      "Slug",
	EditPage:                  "Edit Page",
	ScheduledAt:               "Scheduled at",
	OnlineHit:                 "The version cannot be edited directly after it is released. Please copy the version and edit it.",
	NoContentHit:              "This page has no content yet, start to edit in page builder",

	InvalidPathMsg:           "Invalid Path",
	InvalidTitleMsg:          "Invalid Title",
	InvalidNameMsg:           "Invalid Name",
	InvalidSlugMsg:           "Invalid Slug",
	ConflictSlugMsg:          "Conflicting Slug",
	ConflictPathMsg:          "Conflicting Path",
	ExistingPathMsg:          "Existing Path",
	UnableDeleteCategoryMsg:  "To delete this category you need to remove all association to products first",
	Versions:                 "versions",
	NewContainer:             "New Container",
	Settings:                 "settings",
	SelectElementMsg:         "Select an element and change the setting here.",
	StartBuildingMsg:         "Start building a page",
	StartBuildingTemplateMsg: "Start building a template",
	StartBuildingSubMsg:      "By Browsing and selecting container from the library",

	ListHeaderID:          "ID",
	ListHeaderTitle:       "Title",
	ListHeaderName:        "Name",
	ListHeaderPath:        "Path",
	ListHeaderDescription: "Description",

	FilterTabAll:       "All",
	FilterTabFilled:    "Filled",
	FilterTabNotFilled: "Not Filled",

	ModalTitleConfirm:          "Confirm",
	ModelLabelPages:            "Pages",
	ModelLabelPage:             "Page",
	ModelLabelSharedContainers: "Shared Containers",
	ModelLabelSharedContainer:  "Shared Container",
	ModelLabelDemoContainers:   "Demo Containers",
	ModelLabelDemoContainer:    "Demo Container",
	ModelLabelTemplates:        "Templates",
	ModelLabelTemplate:         "Template",
	ModelLabelPageCategories:   "Page Categories",
	ModelLabelPageCategory:     "Page Category",
	AreWantDeleteContainer: func(v string) string {
		return fmt.Sprintf("Are you sure you want to delete %v?", v)
	},
	AddPageTemplate:                "Add Page Template",
	Name:                           "Name",
	Description:                    "Description",
	CategoryDeleteConfirmationText: "this will remove all the records in all localized languages",
	TheResourceCanNotBeModified:    "The resource can not be modified",
}
View Source
var Messages_ja_JP = &Messages{
	Category:                       "カテゴリ",
	Preview:                        "プレビュー",
	Containers:                     "コンテナ",
	AddContainers:                  "コンテナの追加",
	New:                            "作成する",
	Shared:                         "共有",
	Select:                         "選択",
	SelectedTemplateLabel:          "テンプレート",
	CreateFromTemplate:             "テンプレートから作成",
	ChangeTemplate:                 "テンプレートの変更",
	RelatedOnlinePages:             "関連するオンラインページ",
	RepublishAllRelatedOnlinePages: "すべてを再公開する",
	Unnamed:                        "名前なし",
	NotDescribed:                   "説明なし",
	Blank:                          "空白",
	BlankPage:                      "空白ページ",
	AddBlankPage:                   "空白ページを追加",
	NewPage:                        "新しいページ",
	FilterTabAllVersions:           "すべてのバージョン",
	FilterTabOnlineVersion:         "オンラインバージョン",
	FilterTabNamedVersions:         "名前付きバージョン",
	Rename:                         "名前の変更",
	Hide:                           "隠す",
	Show:                           "表示",
	PageOverView:                   "ページの概要",
	PageBuilder:                    "ページビルダー",
	PageTemplate:                   "ページテンプレート",

	Others:                    "その他",
	Add:                       "追加",
	AddContainer:              "コンテナの追加",
	BuildYourPages:            "ページの作成",
	BuildYourTemplates:        "テンプレートを作成する",
	PlaceAnElementFromLibrary: "ライブラリからコンテナを配置します。",
	NewElement:                "新しいコンテナ",
	Title:                     "タイトル",
	Slug:                      "スラッグ",
	EditPage:                  "ページの編集",
	ScheduledAt:               "公開開始日時",
	OnlineHit:                 "バージョンはリリース後直接に編集できません。バージョンをコピーして編集してください。",
	NoContentHit:              "このページにはまだコンテンツがありません。ページビルダーで編集を開始してください",

	InvalidPathMsg:           "無効なパス",
	InvalidTitleMsg:          "無効なタイトル",
	InvalidNameMsg:           "無効な名前",
	InvalidSlugMsg:           "無効なスラッグ",
	ConflictSlugMsg:          "競合するスラッグ",
	ConflictPathMsg:          "競合するパス",
	ExistingPathMsg:          "既存のパス",
	UnableDeleteCategoryMsg:  "このカテゴリを削除するには、まず商品との関連付けをすべて削除する必要があります。",
	Versions:                 "バージョン",
	NewContainer:             "新しいコンテナ",
	Settings:                 "設定",
	SelectElementMsg:         "コンテナを選択後、設定変更してください",
	StartBuildingMsg:         "ページの構築を開始します",
	StartBuildingTemplateMsg: "テンプレートの作成を開始する",
	StartBuildingSubMsg:      "ライブラリからコンテナを参照して選択する",

	ListHeaderID:          "ID",
	ListHeaderTitle:       "タイトル",
	ListHeaderName:        "名前",
	ListHeaderPath:        "パス",
	ListHeaderDescription: "説明",

	FilterTabAll:       "すべて",
	FilterTabFilled:    "入力済み",
	FilterTabNotFilled: "未入力",

	ModalTitleConfirm:          "確認",
	ModelLabelPages:            "ページ",
	ModelLabelPage:             "ページ",
	ModelLabelSharedContainers: "共有コンテナ",
	ModelLabelSharedContainer:  "共有コンテナ",
	ModelLabelDemoContainers:   "デモコンテナ",
	ModelLabelDemoContainer:    "デモコンテナ",
	ModelLabelTemplates:        "テンプレート",
	ModelLabelTemplate:         "テンプレート",
	ModelLabelPageCategories:   "ページカテゴリ",
	ModelLabelPageCategory:     "ページカテゴリ",
	AreWantDeleteContainer: func(v string) string {
		return fmt.Sprintf("%v を削除してもよろしいですか?", v)
	},
	AddPageTemplate:                "ページテンプレートを追加",
	Name:                           "名前",
	Description:                    "説明",
	CategoryDeleteConfirmationText: "これは、すべてのローカライズされた言語のすべてのレコードを削除します",
	TheResourceCanNotBeModified:    "このリソースは変更できません",
}
View Source
var Messages_zh_CN = &Messages{
	Category:                       "目录",
	Preview:                        "预览",
	Containers:                     "组件",
	AddContainers:                  "增加组件",
	New:                            "新增",
	Shared:                         "公用的",
	Select:                         "选择",
	SelectedTemplateLabel:          "模板",
	CreateFromTemplate:             "从模板中创建",
	ChangeTemplate:                 "更改模版",
	RelatedOnlinePages:             "相关在线页面",
	RepublishAllRelatedOnlinePages: "重新发布所有页面",
	Unnamed:                        "未命名",
	NotDescribed:                   "未描述",
	Blank:                          "空白",
	BlankPage:                      "空白页",
	AddBlankPage:                   "新增空白页",
	NewPage:                        "新页面",
	FilterTabAllVersions:           "所有版本",
	FilterTabOnlineVersion:         "在线版本",
	FilterTabNamedVersions:         "已命名版本",
	Rename:                         "重命名",
	Hide:                           "隐藏",
	Show:                           "显示",
	PageOverView:                   "页面概览",

	Others:                    "其他",
	Add:                       "新增",
	AddContainer:              "新增组件",
	BuildYourPages:            "构建你的页面",
	BuildYourTemplates:        "构建你的模版",
	PlaceAnElementFromLibrary: "从你的库从选择一个组件",
	NewElement:                "新的组件",
	Title:                     "编辑",
	Slug:                      "Slug",
	EditPage:                  "编辑页面",
	ScheduledAt:               "安排在",
	OnlineHit:                 "这个版本无法在上线后直接编辑.请拷贝这个版本再编辑.",
	NoContentHit:              "这个页面没有内容,在page builder中开始编辑",

	InvalidPathMsg:           "无效的路径",
	InvalidTitleMsg:          "无效的标题",
	InvalidNameMsg:           "无效的名称",
	InvalidSlugMsg:           "无效的Slug",
	ConflictSlugMsg:          "冲突的Slug",
	ConflictPathMsg:          "冲突的路径",
	ExistingPathMsg:          "已存在的路径",
	UnableDeleteCategoryMsg:  "这个分类没办法被删除,因为已被页面使用",
	Versions:                 "版本",
	NewContainer:             "新增组件",
	Settings:                 "设置",
	SelectElementMsg:         "选择一个组件,这里会变成设置",
	StartBuildingMsg:         "开始构建页面",
	StartBuildingTemplateMsg: "开始构建模版",
	StartBuildingSubMsg:      "从库中选择组件",
	PageBuilder:              "页面构建",
	PageTemplate:             "页面模版",

	ListHeaderID:          "ID",
	ListHeaderTitle:       "标题",
	ListHeaderName:        "名称",
	ListHeaderPath:        "路径",
	ListHeaderDescription: "描述",

	FilterTabAll:       "全部",
	FilterTabFilled:    "已填写",
	FilterTabNotFilled: "未填写",

	ModalTitleConfirm:          "确认",
	ModelLabelPages:            "页面管理",
	ModelLabelPage:             "页面",
	ModelLabelSharedContainers: "公用组件",
	ModelLabelSharedContainer:  "公用组件",
	ModelLabelDemoContainers:   "示例组件",
	ModelLabelDemoContainer:    "示例组件",
	ModelLabelTemplates:        "模板页面",
	ModelLabelTemplate:         "模板页面",
	ModelLabelPageCategories:   "目录管理",
	ModelLabelPageCategory:     "目录",
	AreWantDeleteContainer: func(v string) string {
		return fmt.Sprintf("你确定要删除 %v?", v)
	},
	AddPageTemplate: "添加页面模版",
	Name:            "名称",
	Description:     "说明",

	CategoryDeleteConfirmationText: "这将删除所有本地化语言中的所有记录",
	TheResourceCanNotBeModified:    "该资源无法被修改",
}
View Source
var ModelsI18nModulePage_EN = ModelsI18nModulePage{
	PagesPage: "Page",
}
View Source
var ModelsI18nModulePage_JP = ModelsI18nModulePage{
	PagesPage: "ページ",
}
View Source
var ModelsI18nModulePage_Zh = ModelsI18nModulePage{
	PagesPage: "Page",
}
View Source
var PagePermissionRN = func(p *Page) []string {
	rn := []string{"pages", strconv.Itoa(int(p.ID)), p.Version.Version}
	if len(p.LocaleCode) > 0 {
		rn = append(rn, p.LocaleCode)
	}
	return rn
}

Functions

func AutoMigrate added in v3.0.2

func AutoMigrate(db *gorm.DB) (err error)

func NotifTemplateSelected added in v3.0.5

func NotifTemplateSelected(mb *presets.ModelBuilder) string

Types

type Builder

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

func New

func New(prefix string, db *gorm.DB, b *presets.Builder) *Builder

func (*Builder) Activity added in v3.0.1

func (b *Builder) Activity(v *activity.Builder) (r *Builder)

func (*Builder) AutoMigrate added in v3.0.2

func (b *Builder) AutoMigrate() (r *Builder)

func (*Builder) ContainerByName

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

func (*Builder) DefaultDevice

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

func (*Builder) DisabledNormalContainersGroup added in v3.0.4

func (b *Builder) DisabledNormalContainersGroup(v bool) (r *Builder)

func (*Builder) DuplicateBtnColor

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

func (*Builder) Editor

func (b *Builder) Editor(m *ModelBuilder) web.PageFunc

func (*Builder) ExpendContainers added in v3.0.1

func (b *Builder) ExpendContainers(v bool) (r *Builder)

func (*Builder) GetModelBuilder added in v3.1.0

func (b *Builder) GetModelBuilder(mb *presets.ModelBuilder) *ModelBuilder

func (*Builder) GetPageModelBuilder added in v3.1.0

func (b *Builder) GetPageModelBuilder() *ModelBuilder

func (*Builder) GetPageTitle added in v3.0.1

func (b *Builder) GetPageTitle() SubPageTitleFunc

func (*Builder) GetPresetsBuilder

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

func (*Builder) GetTemplateModel added in v3.0.5

func (b *Builder) GetTemplateModel() *presets.ModelBuilder

func (*Builder) Images

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

func (*Builder) Install added in v3.0.1

func (b *Builder) Install(pb *presets.Builder) (err error)

func (*Builder) L10n added in v3.0.1

func (b *Builder) L10n(v *l10n.Builder) (r *Builder)

func (*Builder) Media added in v3.0.1

func (b *Builder) Media(v *media.Builder) (r *Builder)

func (*Builder) Model added in v3.0.1

func (b *Builder) Model(mb *presets.ModelBuilder) (r *ModelBuilder)

func (*Builder) ModelInstall added in v3.0.1

func (b *Builder) ModelInstall(pb *presets.Builder, mb *presets.ModelBuilder) (err error)

func (*Builder) Only added in v3.0.6

func (b *Builder) Only(vs ...string) *Builder

func (*Builder) PageEnabled added in v3.0.2

func (b *Builder) PageEnabled(v bool) (r *Builder)

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) PreviewContainer added in v3.0.2

func (b *Builder) PreviewContainer(v bool) (r *Builder)

func (*Builder) PreviewDevices added in v3.0.1

func (b *Builder) PreviewDevices(devices ...Device) *Builder

func (*Builder) PreviewOpenNewTab added in v3.0.5

func (b *Builder) PreviewOpenNewTab(v bool) (r *Builder)

func (*Builder) PublishBtnColor

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

func (*Builder) Publisher added in v3.0.1

func (b *Builder) Publisher(v *publish.Builder) (r *Builder)

func (*Builder) RegisterContainer

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

func (*Builder) RegisterModelBuilderTemplate added in v3.0.5

func (b *Builder) RegisterModelBuilderTemplate(mb *presets.ModelBuilder, tm *presets.ModelBuilder) *Builder

func (*Builder) RegisterModelContainer added in v3.0.1

func (b *Builder) RegisterModelContainer(name string, mb *presets.ModelBuilder) (r *ContainerBuilder)

func (*Builder) SEO added in v3.0.1

func (b *Builder) SEO(v *seo.Builder) (r *Builder)

func (*Builder) ServeHTTP

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

func (*Builder) SubPageTitle added in v3.0.1

func (b *Builder) SubPageTitle(v SubPageTitleFunc) (r *Builder)

func (*Builder) TemplateEnabled

func (b *Builder) TemplateEnabled(v bool) (r *Builder)

func (*Builder) WrapCategoryInstall added in v3.0.1

func (b *Builder) WrapCategoryInstall(w func(presets.ModelInstallFunc) presets.ModelInstallFunc) (r *Builder)

func (*Builder) WrapPageInstall added in v3.0.1

func (b *Builder) WrapPageInstall(w func(presets.ModelInstallFunc) presets.ModelInstallFunc) (r *Builder)

func (*Builder) WrapPageLayout added in v3.0.2

func (b *Builder) WrapPageLayout(warp func(v PageLayoutFunc) PageLayoutFunc) (r *Builder)

func (*Builder) WrapTemplateInstall added in v3.0.1

func (b *Builder) WrapTemplateInstall(w func(presets.ModelInstallFunc) presets.ModelInstallFunc) (r *Builder)

type Category

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

	IndentLevel int `gorm:"-"`

	l10n.Locale
}

func (*Category) PrimaryColumnValuesBySlug

func (c *Category) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*Category) PrimarySlug

func (c *Category) PrimarySlug() string

func (*Category) TableName

func (*Category) TableName() string

type Container

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

	l10n.Locale
	LocalizeFromModelID uint
}

func (*Container) PrimaryColumnValuesBySlug

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

func (*Container) PrimarySlug

func (c *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) Group added in v3.0.1

func (*ContainerBuilder) Install added in v3.1.0

func (b *ContainerBuilder) Install()

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) OnlyPages added in v3.0.3

func (b *ContainerBuilder) OnlyPages(v bool) *ContainerBuilder

func (*ContainerBuilder) RenderFunc

func (b *ContainerBuilder) RenderFunc(v RenderFunc) *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"`
	ContainerDataID string `json:"container_data_id"`
	URL             string `json:"url"`
	Shared          bool   `json:"shared"`
	Hidden          bool   `json:"hidden"`
	VisibilityIcon  string `json:"visibility_icon"`
	ParamID         string `json:"param_id"`
	Locale          string `json:"locale"`
}

type CtxKeyContainerToPageLayout added in v3.0.6

type CtxKeyContainerToPageLayout struct{}

type DemoContainer

type DemoContainer struct {
	gorm.Model
	ModelName string
	ModelID   uint
	Filled    bool

	l10n.Locale
}

func (*DemoContainer) PrimaryColumnValuesBySlug

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

func (*DemoContainer) PrimarySlug

func (c *DemoContainer) PrimarySlug() string

func (*DemoContainer) TableName

func (*DemoContainer) TableName() string

type Device added in v3.0.1

type Device struct {
	Name     string
	Width    string
	Icon     string
	Disabled bool
}

type Messages

type Messages struct {
	Category                       string
	Preview                        string
	Containers                     string
	AddContainers                  string
	New                            string
	Shared                         string
	Select                         string
	SelectedTemplateLabel          string
	CreateFromTemplate             string
	ChangeTemplate                 string
	RelatedOnlinePages             string
	RepublishAllRelatedOnlinePages string
	Unnamed                        string
	NotDescribed                   string
	Blank                          string
	BlankPage                      string
	AddBlankPage                   string
	NewPage                        string
	FilterTabAllVersions           string
	FilterTabOnlineVersion         string
	FilterTabNamedVersions         string

	Rename                    string
	Hide                      string
	Show                      string
	PageOverView              string
	Others                    string
	Add                       string
	AddContainer              string
	BuildYourPages            string
	BuildYourTemplates        string
	PlaceAnElementFromLibrary string
	NewElement                string
	Title                     string
	Slug                      string
	EditPage                  string
	ScheduledAt               string
	OnlineHit                 string
	NoContentHit              string
	PageBuilder               string
	PageTemplate              string

	InvalidPathMsg           string
	InvalidTitleMsg          string
	InvalidNameMsg           string
	InvalidSlugMsg           string
	ConflictSlugMsg          string
	ConflictPathMsg          string
	ExistingPathMsg          string
	UnableDeleteCategoryMsg  string
	Versions                 string
	NewContainer             string
	Settings                 string
	SelectElementMsg         string
	StartBuildingMsg         string
	StartBuildingTemplateMsg string
	StartBuildingSubMsg      string

	ListHeaderID          string
	ListHeaderTitle       string
	ListHeaderName        string
	ListHeaderPath        string
	ListHeaderDescription string

	FilterTabAll       string
	FilterTabFilled    string
	FilterTabNotFilled string

	ModalTitleConfirm          string
	ModelLabelPages            string
	ModelLabelPage             string
	ModelLabelSharedContainers string
	ModelLabelSharedContainer  string
	ModelLabelDemoContainers   string
	ModelLabelDemoContainer    string
	ModelLabelTemplates        string
	ModelLabelTemplate         string
	ModelLabelPageCategories   string
	ModelLabelPageCategory     string
	AreWantDeleteContainer     func(v string) string
	AddPageTemplate            string
	Name                       string
	Description                string

	CategoryDeleteConfirmationText string
	TheResourceCanNotBeModified    string
}

type ModelBuilder added in v3.0.1

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

func (*ModelBuilder) ContextValueProvider added in v3.0.1

func (b *ModelBuilder) ContextValueProvider(in context.Context) context.Context

func (*ModelBuilder) EventMiddleware added in v3.2.0

func (b *ModelBuilder) EventMiddleware(v eventMiddlewareFunc) *ModelBuilder

func (*ModelBuilder) ExistedL10n added in v3.0.2

func (b *ModelBuilder) ExistedL10n() bool

func (*ModelBuilder) PreviewHTML added in v3.0.2

func (b *ModelBuilder) PreviewHTML(obj interface{}) (r string)

func (*ModelBuilder) PreviewHref added in v3.0.2

func (b *ModelBuilder) PreviewHref(_ *web.EventContext, ps string) string

func (*ModelBuilder) WrapEventMiddleware added in v3.2.0

func (b *ModelBuilder) WrapEventMiddleware(w func(eventMiddlewareFunc) eventMiddlewareFunc) *ModelBuilder

type ModelsI18nModulePage added in v3.0.5

type ModelsI18nModulePage struct {
	PagesPage string
}

type Page

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

	SEO seo.Setting
	publish.Status
	publish.Schedule
	publish.Version
	l10n.Locale
}

func (*Page) GetCategory

func (p *Page) GetCategory(db *gorm.DB) (category Category, err error)

func (*Page) GetID

func (p *Page) GetID() uint

func (*Page) GetTitle added in v3.0.1

func (p *Page) GetTitle() string

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) PublishUrl added in v3.0.2

func (p *Page) PublishUrl(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (s 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 {
	SeoTags           h.HTMLComponent
	CanonicalLink     h.HTMLComponent
	StructuredData    h.HTMLComponent
	FreeStyleCss      []string
	FreeStyleTopJs    []string
	FreeStyleBottomJs []string
	WrapHead          WrapCompFunc
	WrapBody          WrapCompFunc
	Hreflang          map[string]string
	Header            h.HTMLComponent
	Footer            h.HTMLComponent
	IsEditor          bool
	LocaleCode        string
	EditorCss         []h.HTMLComponent
	IsPreview         bool
}

type PageTitleInterface added in v3.0.1

type PageTitleInterface interface {
	GetTitle() string
}

type RenderFunc

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

type RenderInput

type RenderInput struct {
	IsEditor    bool
	IsReadonly  bool
	Device      string
	ContainerId string
	DisplayName string
	Obj         interface{}
}

type SubPageTitleFunc added in v3.0.1

type SubPageTitleFunc func(ctx *web.EventContext) string

type TagInterface added in v3.1.0

type TagInterface interface {
	SetAttr(k string, v interface{})
}

type Template

type Template struct {
	gorm.Model
	Name        string
	Description string

	l10n.Locale
}

func (*Template) GetDescription added in v3.0.5

func (t *Template) GetDescription(_ *web.EventContext) string

func (*Template) GetID

func (t *Template) GetID() uint

func (*Template) GetName added in v3.0.5

func (t *Template) GetName(_ *web.EventContext) string

func (*Template) PrimaryColumnValuesBySlug

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

func (*Template) PrimarySlug

func (t *Template) PrimarySlug() string

func (*Template) TableName

func (*Template) TableName() string

type TemplateBuilder added in v3.0.5

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

func (*TemplateBuilder) Install added in v3.0.5

func (b *TemplateBuilder) Install()

type TemplateInterface added in v3.0.5

type TemplateInterface interface {
	GetName(ctx *web.EventContext) string
	GetDescription(ctx *web.EventContext) string
}

type TemplateSelected added in v3.0.5

type TemplateSelected struct {
	Slug string `json:"slug"`
}

type WrapCompFunc added in v3.0.2

type WrapCompFunc func(comps h.HTMLComponents) h.HTMLComponents

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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