cms

package
v0.0.0-...-f3ad2b4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(backend db.Backend, app kit.App, integerIds bool)

func BuildMigrations

func BuildMigrations(b db.MigrationBackend, app kit.App) []db.Migration

Types

type BaseTag

type BaseTag struct {
	Tag   string `db:"required;max:100;index;unique-with:Group"`
	Group string `db:"required;max:100;index"`
}

func (*BaseTag) Collection

func (t *BaseTag) Collection() string

type Comment

type Comment struct {
	db.TimeStampedModel
	Type    string `db:"required;max:200;"`
	Title   string `db:"max:255"`
	Comment string `db:"required"`
}

func (*Comment) Collection

func (c *Comment) Collection() string

type CommentIntId

type CommentIntId struct {
	db.IntIdModel
	Comment
}

type CommentResource

type CommentResource struct {
}

type CommentStrId

type CommentStrId struct {
	db.StrIdModel
	Comment
}

type Location

type Location struct {
	Name        string `db:"max:200"`
	Description string `db:"max:1000"`
	Comments    string `db:"max:1000"`

	Country      string `db:"min:2;max:2;"`
	PostalCode   string `db:"max:100;"`
	State        string `db:"max:100;"`
	Locality     string `db:"max:255;"`
	Street       string `db:"max:500"`
	StreetNumber string `db:"max:100"`
	Top          string `db:"max:100"`

	FormattedAddress string `db:"max:300":`

	Point *db.Point
}

func (*Location) Collection

func (a *Location) Collection() string

type LocationIntId

type LocationIntId struct {
	db.IntIdModel
	Location
}

type LocationStrId

type LocationStrId struct {
	db.StrIdModel
	Location
}
type Menu struct {
	// Internal identifier for the menu
	Name string `db:"required;unique;index;max:200;`

	// Language this menu is in.
	Language string `db:"required;min:2;max:2"`

	// Readable title for the menu.
	Title string `db:"required;max:250"`

	// Optional menu description.
	Description string `db:"max:500"`
}
func (m *Menu) Collection() string
type MenuIntId struct {
	db.IntIdModel
	Menu

	TranslatedMenu   *MenuIntId
	TranslatedMenuId uint64

	Items []*MenuItemIntId `db:"belongs-to:Id:MenuId"`
}
func (i MenuIntId) BeforeDelete(b db.Backend) error
type MenuItem struct {
	// Internal name for the menu item.
	Name string `db:"required;max:200;unique-with:MenuId"`

	// Optinal description for admins.
	Description string

	// Enabled specifies if the item should be shown.
	Enabled bool

	// Whether this item does not actually link to anything but acts as a placeholder.
	IsPlaceholder bool

	// The title that should be rendered.
	Title string `db:"required;max:250"`

	// Url this item links to.
	Url string `db:"max:2000"`

	// Route for this item.
	// Use this instead of url if you use a routing system.
	Route string `db:"max:100"`
	// Route arguments, separated by ;.
	RouteArgs string `db:"max:1000"`

	// Used for sorting.
	Weight int `db:"required"`
}
func (i *MenuItem) Collection() string
type MenuItemIntId struct {
	db.IntIdModel
	MenuItem

	Menu   *MenuIntId
	MenuId uint64 `db:"required"`

	Parent   *MenuItemIntId
	ParentId uint64

	Children []*MenuItemIntId `db:"belongs-to:Id:ParentId"`
}
type MenuItemResource struct {
	resources.AdminResource
}
type MenuItemStrId struct {
	db.StrIdModel
	MenuItem

	Menu   *MenuStrId
	MenuId string `db:"max:200;required"`

	Parent   *MenuItemStrId
	ParentId string `db:"max:200"`

	Children []*MenuItemStrId `db:"belongs-to:Id:ParentId"`
}
type MenuResource struct {
	resources.AdminResource
}
type MenuStrId struct {
	db.StrIdModel
	Menu

	TranslatedMenu   *MenuStrId
	TranslatedMenuId string `db:"max:200"`

	Items []*MenuItemStrId `db:"belongs-to:Id:MenuId"`
}
func (i MenuStrId) BeforeDelete(b db.Backend) error

type Page

type Page struct {
	// CreatedAt and UpdatedAt.
	db.TimeStampedModel

	Published   bool
	PublishedAt time.Time

	// Internal title.
	Name string `db:"required;max:200"`

	// Type of the page, like "blog post"
	Type string `db:"required;max:200"`

	Language string `db:"required;min:2;max:2"`

	// Public title.
	Title string `db:"required;max:200"`

	// Slug.
	Slug string `db:"required;max:250"`

	// Summary for lists.
	ListSummary string

	// Summary for top of the page, seo, etc.
	Summary string

	// Layout to use to display the page.
	Layout string `db:"max:255"`

	// The actual content.
	Content string `db:"required;"`
}

func (Page) Collection

func (p Page) Collection() string

type PageComponent

type PageComponent struct {
	// Component type.
	Type string `db:"max:255;required"`

	// Explicative name for the content.
	Name string `db:"required"`

	// Data for the component.
	Data string `db:""`

	// Weight for sorting.
	Weight int

	// Whether to show the component.
	Enabled bool
}

func (PageComponent) Collection

func (PageComponent) Collection() string

type PageComponentIntId

type PageComponentIntId struct {
	db.IntIdModel
	PageComponent

	PageId uint64 `db:"required"`

	Files []*files.FileIntId `db:"m2m:pages_component_files"`
}

type PageComponentStrId

type PageComponentStrId struct {
	db.StrIdModel
	PageComponent

	PageId string `db:"required"`

	Files []*files.FileStrId `db:"m2m:pages_component_files"`
}

type PageIntId

type PageIntId struct {
	db.IntIdModel
	users.IntUserModel
	Page

	MenuItem   *MenuItemIntId
	MenuItemId uint64

	TranslatedPage   *PageIntId
	TranslatedPageId string `db:"max:200"`

	Files []*files.FileIntId `db:"m2m:pages_files"`

	// Tags.
	Tags []*TagIntId `db:"m2m:pages_tags"`

	// Components.
	Components []*PageComponentIntId `db:"belongs-to:Id:PageId"`
}

func (PageIntId) BeforeDelete

func (p PageIntId) BeforeDelete(b db.Backend) error

type PageResource

type PageResource struct {
	resources.UserResource
}

func (PageResource) AllowFind

func (PageResource) AllowFind(res kit.Resource, obj kit.Model, user kit.User) bool

func (PageResource) ApiAlterQuery

func (PageResource) ApiAlterQuery(res kit.Resource, query db.Query, r kit.Request) apperror.Error

func (PageResource) BeforeDelete

func (PageResource) BeforeDelete(res kit.Resource, obj kit.Model, user kit.User) apperror.Error

func (PageResource) BeforeUpdate

func (PageResource) BeforeUpdate(res kit.Resource, obj, oldobj kit.Model, user kit.User) apperror.Error

func (PageResource) Methods

func (PageResource) Methods(res kit.Resource) []kit.Method

type PageStrId

type PageStrId struct {
	db.StrIdModel
	users.StrUserModel
	Page

	MenuItem   *MenuItemStrId
	MenuItemId string `db:"max:200"`

	TranslatedPage   *PageStrId
	TranslatedPageId string `db:"max:200"`

	Files []*files.FileStrId `db:"m2m:pages_files"`

	// Tags.
	Tags []*TagStrId `db:"m2m:pages_tags"`

	// Components.
	Components []*PageComponentStrId `db:"belongs-to:Id:PageId"`
}

func (PageStrId) BeforeDelete

func (p PageStrId) BeforeDelete(b db.Backend) error

type TagIntId

type TagIntId struct {
	db.IntIdModel
	BaseTag
}

type TagStrId

type TagStrId struct {
	db.StrIdModel
	BaseTag
}

Jump to

Keyboard shortcuts

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