Documentation ¶
Overview ¶
templ: version: v0.2.707
Index ¶
- Constants
- Variables
- func AncestorNodes(q models.Querier, ctx context.Context, p string, depth int) ([]models.PageNode, error)
- func CountNodesByType(q models.Querier, ctx context.Context, contentType string) (int64, error)
- func CreateChildNode(q models.DBQuerier, ctx context.Context, parent, child *models.PageNode) error
- func CreateRootNode(q models.Querier, ctx context.Context, node *models.PageNode) error
- func CreateTable(db *sql.DB) error
- func DeleteNode(q models.DBQuerier, ctx context.Context, id int64, path string, depth int64) error
- func DeletePage(q models.DBQuerier, ctx context.Context, p DeletablePage) (err error)
- func FixTree(querySet models.DBQuerier, ctx context.Context) error
- func MoveNode(q models.DBQuerier, ctx context.Context, node *models.PageNode, ...) error
- func ParentNode(q models.Querier, ctx context.Context, path string, depth int) (v models.PageNode, err error)
- func PrepareQuerySet(ctx context.Context, db *sql.DB) (models.DBQuerier, error)
- func PrintTree(node *Node, depth int)
- func PublishNode(q models.Querier, ctx context.Context, node *models.PageNode) error
- func Register(definition *PageDefinition)
- func SavePage(q models.DBQuerier, ctx context.Context, parent *models.PageNode, ...) error
- func Serve(allowedMethods ...string) http.Handler
- func SetPrefix(prefix string)
- func UnpublishNode(q models.DBQuerier, ctx context.Context, node *models.PageNode, ...) error
- func UpdateNode(q models.Querier, ctx context.Context, node *models.PageNode) error
- func UpdatePage(q models.DBQuerier, ctx context.Context, p SaveablePage) error
- type BaseSignal
- type DeletablePage
- type ItemsList
- type MenuHeader
- type Node
- type Page
- type PageAppConfig
- type PageBaseKeyGetter
- type PageContextGetter
- type PageDefinition
- func DefinitionForObject(page Page) *PageDefinition
- func DefinitionForType(typeName string) *PageDefinition
- func FilterCreatableDefinitions(definitions []*PageDefinition) []*PageDefinition
- func ListDefinitions() []*PageDefinition
- func ListDefinitionsForType(typeName string) []*PageDefinition
- func ListRootDefinitions() []*PageDefinition
- type PageMovedSignal
- type PageNodeSignal
- type PageRenderView
- type PageServeView
- type PageSignal
- type PageTemplateGetter
- type PageTemplateRenderView
- type PageTemplateView
- type PageView
- type PageViewHandler
- type PagesMenuItem
- type Querier
- type SaveablePage
Constants ¶
View Source
const ( AdminPagesAppName = "pages" AdminPagesModelPath = "Page" )
View Source
const ( ErrPathLengthTooShort errs.Error = "path is too short" ErrPathLengthExceeded errs.Error = "path length exceeded" ErrInvalidPathLength errs.Error = "invalid path length" ErrTooLittleAncestors errs.Error = "too little ancestors provided" ErrTooManyAncestors errs.Error = "too many ancestors provided" ErrContentTypeInvalid errs.Error = "content type is invalid" ErrPageIsRoot errs.Error = "page is root" )
View Source
const ( STEP_LEN = 3 ALPHABET = "0123456789" )
Variables ¶
View Source
var ( SignalRootCreated = signalRegistry.Get("pages.root_page_created") // Node is the root node, PageID is zero. SignalChildCreated = signalRegistry.Get("pages.child_page_created") // Node is the child being created, PageID is the parent node's ID. SignalNodeUpdated = signalRegistry.Get("pages.node_updated") // Node is the node being updated, PageID is the parent node's ID. SignalNodeBeforeDelete = signalRegistry.Get("pages.node_before_delete") // Node is the node being deleted, PageID is the parent node's ID. SignalNodeMoved = signalMoveRegistry.Get("pages.node_moved") // Node is the node being moved, Parent is the new parent, OldParent is the old parent. )
View Source
var QuerySet func() models.DBQuerier
Will get set by django_app.go.(NewAppConfig)
Functions ¶
func AncestorNodes ¶
func CountNodesByType ¶ added in v1.6.6
func CreateChildNode ¶
func CreateRootNode ¶
func CreateTable ¶
func DeleteNode ¶
func DeletePage ¶
func ParentNode ¶
func PrepareQuerySet ¶
func PublishNode ¶
func Register ¶
func Register(definition *PageDefinition)
func UnpublishNode ¶
func UpdateNode ¶
func UpdatePage ¶
Types ¶
type BaseSignal ¶
type ItemsList ¶
func (ItemsList) MarshalJSON ¶
type MenuHeader ¶
type Node ¶
func NewNodeTree ¶
type PageAppConfig ¶
type PageAppConfig struct { *apps.DBRequiredAppConfig // contains filtered or unexported fields }
func App ¶
func App() *PageAppConfig
func NewAppConfig ¶
func NewAppConfig() *PageAppConfig
func (*PageAppConfig) QuerySet ¶
func (p *PageAppConfig) QuerySet() models.DBQuerier
type PageBaseKeyGetter ¶
type PageContextGetter ¶
type PageDefinition ¶
type PageDefinition struct { *contenttypes.ContentTypeDefinition ServePage func() PageView AddPanels func(r *http.Request, page Page) []admin.Panel EditPanels func(r *http.Request, page Page) []admin.Panel GetForID func(ctx context.Context, ref models.PageNode, id int64) (Page, error) OnReferenceUpdate func(ctx context.Context, ref models.PageNode, id int64) error OnReferenceBeforeDelete func(ctx context.Context, ref models.PageNode, id int64) error MaxNum int DissalowCreate bool DisallowRoot bool ParentPageTypes []string ChildPageTypes []string // contains filtered or unexported fields }
func DefinitionForObject ¶
func DefinitionForObject(page Page) *PageDefinition
func DefinitionForType ¶
func DefinitionForType(typeName string) *PageDefinition
func FilterCreatableDefinitions ¶ added in v1.6.6
func FilterCreatableDefinitions(definitions []*PageDefinition) []*PageDefinition
func ListDefinitions ¶
func ListDefinitions() []*PageDefinition
func ListDefinitionsForType ¶ added in v1.6.6
func ListDefinitionsForType(typeName string) []*PageDefinition
func ListRootDefinitions ¶ added in v1.6.6
func ListRootDefinitions() []*PageDefinition
func (*PageDefinition) AppLabel ¶
func (p *PageDefinition) AppLabel() string
func (*PageDefinition) ContentType ¶
func (p *PageDefinition) ContentType() contenttypes.ContentType
func (*PageDefinition) Description ¶
func (p *PageDefinition) Description() string
func (*PageDefinition) Label ¶
func (p *PageDefinition) Label() string
func (*PageDefinition) Model ¶
func (p *PageDefinition) Model() string
func (*PageDefinition) PageView ¶
func (p *PageDefinition) PageView() PageView
type PageMovedSignal ¶
type PageNodeSignal ¶
type PageNodeSignal struct { BaseSignal // The current node, a child node or parent node depending on the signal. Node *models.PageNode // The current page ID, the parent page ID or a child's page ID depending on the signal. PageID int64 }
type PageRenderView ¶
type PageServeView ¶
type PageServeView struct{}
Register to the page definition.
func (*PageServeView) ServeXXX ¶
func (v *PageServeView) ServeXXX(w http.ResponseWriter, req *http.Request)
func (*PageServeView) TakeControl ¶
func (v *PageServeView) TakeControl(w http.ResponseWriter, req *http.Request)
type PageSignal ¶
type PageSignal struct { BaseSignal Page Page }
type PageTemplateGetter ¶
type PageTemplateRenderView ¶
type PageTemplateRenderView interface { PageTemplateView Render(w http.ResponseWriter, req *http.Request, template string, page Page, context ctx.Context) error }
type PageTemplateView ¶
type PageTemplateView interface { PageContextGetter PageTemplateGetter }
type PageView ¶
type PageView interface { // ServePage is a method that will never get called. // It acts like the views.ServeXXX method. ServePage() }
type PageViewHandler ¶
type PageViewHandler interface { views.MethodsView views.ControlledView View() PageView CurrentPage() Page }
A wrapper interface to get the same dynamic functionality as the views.View interface.
This handles "PageView" objects much like the views.Invoke method.
type PagesMenuItem ¶
func (*PagesMenuItem) Component ¶
func (p *PagesMenuItem) Component() templ.Component
Source Files ¶
- django_admin.go
- django_admin_api_menus.go
- django_admin_templ.go
- django_admin_views.go
- django_admin_views_root.go
- django_admin_views_utils.go
- django_app.go
- errors.go
- pages.go
- pages_definitions.go
- pages_fixtree.go
- pages_registry.go
- pages_serve.go
- pages_signals.go
- path_utils.go
- queries.go
- queries_nodes.go
- queries_pages.go
Click to show internal directories.
Click to hide internal directories.