v0.30: product pages, categories, sale prices and order status timeline
This commit is contained in:
+27
-17
@@ -13,12 +13,13 @@ import (
|
||||
)
|
||||
|
||||
type AdminHandler struct {
|
||||
repo *repository.AdminRepository
|
||||
products *repository.ProductRepository
|
||||
stats *repository.StatsRepository
|
||||
storage *upload.Storage
|
||||
session *auth.Session
|
||||
templates *template.Template
|
||||
repo *repository.AdminRepository
|
||||
products *repository.ProductRepository
|
||||
categories *repository.CategoryRepository
|
||||
stats *repository.StatsRepository
|
||||
storage *upload.Storage
|
||||
session *auth.Session
|
||||
templates *template.Template
|
||||
}
|
||||
|
||||
type adminLayoutData struct {
|
||||
@@ -52,28 +53,37 @@ type adminProductsData struct {
|
||||
}
|
||||
|
||||
type adminProductFormData struct {
|
||||
Title string
|
||||
Email string
|
||||
Product models.Product
|
||||
IsNew bool
|
||||
Error string
|
||||
Title string
|
||||
Email string
|
||||
Product models.Product
|
||||
Categories []models.Category
|
||||
IsNew bool
|
||||
Error string
|
||||
}
|
||||
|
||||
type adminCategoriesData struct {
|
||||
Title string
|
||||
Email string
|
||||
Categories []models.Category
|
||||
}
|
||||
|
||||
func NewAdminHandler(
|
||||
adminRepo *repository.AdminRepository,
|
||||
productRepo *repository.ProductRepository,
|
||||
categoryRepo *repository.CategoryRepository,
|
||||
statsRepo *repository.StatsRepository,
|
||||
storage *upload.Storage,
|
||||
session *auth.Session,
|
||||
templates *template.Template,
|
||||
) *AdminHandler {
|
||||
return &AdminHandler{
|
||||
repo: adminRepo,
|
||||
products: productRepo,
|
||||
stats: statsRepo,
|
||||
storage: storage,
|
||||
session: session,
|
||||
templates: templates,
|
||||
repo: adminRepo,
|
||||
products: productRepo,
|
||||
categories: categoryRepo,
|
||||
stats: statsRepo,
|
||||
storage: storage,
|
||||
session: session,
|
||||
templates: templates,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user