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 Service
- type ServiceCategoriesFormTemplate
- type ServiceCategoriesListTemplate
- type ServiceCategory
- type ServicesFormTemplate
- type ServicesListTemplate
- 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
type Service ¶ added in v1.1.0
type Service struct { Name string `form:"name"` Description string `form:"description"` Price string `form:"price"` ServiceCategoryID string `form:"service_category_id"` }
func ServiceFromEntity ¶ added in v1.1.0
type ServiceCategoriesFormTemplate ¶ added in v1.1.0
type ServiceCategoriesFormTemplate struct { BaseData IsNew bool ServiceCategory ServiceCategory }
func (ServiceCategoriesFormTemplate) GetTemplateName ¶ added in v1.1.0
func (t ServiceCategoriesFormTemplate) GetTemplateName() string
type ServiceCategoriesListTemplate ¶ added in v1.1.0
type ServiceCategoriesListTemplate struct { BaseData ServiceCategories []*entities.ServiceCategory }
func (ServiceCategoriesListTemplate) GetTemplateName ¶ added in v1.1.0
func (t ServiceCategoriesListTemplate) GetTemplateName() string
type ServiceCategory ¶ added in v1.1.0
type ServiceCategory struct {
Name string `form:"name"`
}
func ServiceCategoryFromEntity ¶ added in v1.1.0
func ServiceCategoryFromEntity(e *entities.ServiceCategory) ServiceCategory
func (ServiceCategory) ToEntity ¶ added in v1.1.0
func (e ServiceCategory) ToEntity() entities.ServiceCategory
type ServicesFormTemplate ¶ added in v1.1.0
type ServicesFormTemplate struct { BaseData IsNew bool Service Service ServiceCategories []*entities.ServiceCategory }
func (ServicesFormTemplate) GetTemplateName ¶ added in v1.1.0
func (t ServicesFormTemplate) GetTemplateName() string
type ServicesListTemplate ¶ added in v1.1.0
type ServicesListTemplate struct { BaseData Services []*entities.Service ServiceCategory *entities.ServiceCategory }
func (ServicesListTemplate) GetTemplateName ¶ added in v1.1.0
func (t ServicesListTemplate) GetTemplateName() string
Click to show internal directories.
Click to hide internal directories.