Documentation ¶
Index ¶
- Constants
- type BaseData
- type CategoriesFormTemplate
- type CategoriesListTemplate
- type Category
- type Content
- type ContentFormTemplate
- type ContentListTemplate
- type Event
- type EventsFormTemplate
- type EventsListTemplate
- type LoginFailedTemplate
- type LogoutSuccessfulTemplate
- type Manufacturer
- type ManufacturersFormTemplate
- type ManufacturersImageTemplate
- type ManufacturersListTemplate
- type Message
- type MessageType
- type Product
- type ProductsFormTemplate
- type ProductsImagesTemplate
- type ProductsListTemplate
- type Template
Constants ¶
View Source
const ( MessageTypeError = "danger" MessageTypeSuccess = "success" )
View Source
const TimeFormatDate = "2006-01-02"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseData ¶
func (*BaseData) AddMessage ¶
func (b *BaseData) AddMessage(messageType MessageType, messageFormat string, args ...any)
AddMessage appends a single message to the slice of messages. Message format and arguments are passed to fmt.Sprintf.
func (*BaseData) SetMessages ¶
SetMessages replaces the current slice of messages
type CategoriesFormTemplate ¶
func (CategoriesFormTemplate) GetTemplateName ¶
func (t CategoriesFormTemplate) GetTemplateName() string
type CategoriesListTemplate ¶
func (CategoriesListTemplate) GetTemplateName ¶
func (t CategoriesListTemplate) GetTemplateName() string
type Category ¶
func CategoryFromEntity ¶
type ContentFormTemplate ¶
func (ContentFormTemplate) GetTemplateName ¶
func (t ContentFormTemplate) GetTemplateName() string
type ContentListTemplate ¶
func (ContentListTemplate) GetTemplateName ¶
func (t ContentListTemplate) GetTemplateName() string
type Event ¶
func EventFromEntity ¶
type EventsFormTemplate ¶
func (EventsFormTemplate) GetTemplateName ¶
func (t EventsFormTemplate) GetTemplateName() string
type EventsListTemplate ¶
func (EventsListTemplate) GetTemplateName ¶
func (t EventsListTemplate) GetTemplateName() string
type LoginFailedTemplate ¶
func (LoginFailedTemplate) GetTemplateName ¶
func (t LoginFailedTemplate) GetTemplateName() string
type LogoutSuccessfulTemplate ¶
type LogoutSuccessfulTemplate struct {
BaseData
}
func (LogoutSuccessfulTemplate) GetTemplateName ¶
func (t LogoutSuccessfulTemplate) GetTemplateName() string
type Manufacturer ¶
func ManufacturerFromEntity ¶
func ManufacturerFromEntity(e *entities.Manufacturer) Manufacturer
func (Manufacturer) ToEntity ¶
func (e Manufacturer) ToEntity() entities.Manufacturer
type ManufacturersFormTemplate ¶
type ManufacturersFormTemplate struct { BaseData IsNew bool Manufacturer Manufacturer }
func (ManufacturersFormTemplate) GetTemplateName ¶
func (t ManufacturersFormTemplate) GetTemplateName() string
type ManufacturersImageTemplate ¶
type ManufacturersImageTemplate struct { BaseData Manufacturer entities.Manufacturer }
func (ManufacturersImageTemplate) GetTemplateName ¶
func (t ManufacturersImageTemplate) GetTemplateName() string
type ManufacturersListTemplate ¶
type ManufacturersListTemplate struct { BaseData Manufacturers []*entities.Manufacturer }
func (ManufacturersListTemplate) GetTemplateName ¶
func (t ManufacturersListTemplate) GetTemplateName() string
type MessageType ¶
type MessageType string
Flash types based on https://getbootstrap.com/docs/5.1/components/alerts/
type Product ¶
type Product struct { Name string `form:"name"` Price string `form:"price"` ManufacturerID string `form:"manufacturer_id"` CategoryIDs []string `form:"category_ids"` StockCount int `form:"stock_count"` DescriptionShort string `form:"description_short"` DescriptionLong string `form:"description_long"` }
func ProductFromEntity ¶
func ProductFromEntity(e *entities.ResolvedProduct) Product
func (Product) HasCategoryID ¶
type ProductsFormTemplate ¶
type ProductsFormTemplate struct { BaseData IsNew bool ShortDescriptionOnly bool Product Product Categories []*entities.Category Manufacturers []*entities.Manufacturer }
func (ProductsFormTemplate) GetTemplateName ¶
func (t ProductsFormTemplate) GetTemplateName() string
type ProductsImagesTemplate ¶
func (ProductsImagesTemplate) GetTemplateName ¶
func (t ProductsImagesTemplate) GetTemplateName() string
type ProductsListTemplate ¶
type ProductsListTemplate struct { BaseData Products []*entities.Product ManufacturersMap map[entities.ID]entities.Manufacturer PublicURLMap map[entities.ID]string }
func (ProductsListTemplate) GetTemplateName ¶
func (t ProductsListTemplate) GetTemplateName() string
Click to show internal directories.
Click to hide internal directories.