Remove now-unused locales field from admin handlers
This commit is contained in:
parent
50bcbf012f
commit
8205bec34d
|
@ -16,7 +16,6 @@ import (
|
|||
"dev.tandem.ws/tandem/camper/pkg/home"
|
||||
httplib "dev.tandem.ws/tandem/camper/pkg/http"
|
||||
"dev.tandem.ws/tandem/camper/pkg/legal"
|
||||
"dev.tandem.ws/tandem/camper/pkg/locale"
|
||||
"dev.tandem.ws/tandem/camper/pkg/location"
|
||||
"dev.tandem.ws/tandem/camper/pkg/media"
|
||||
"dev.tandem.ws/tandem/camper/pkg/season"
|
||||
|
@ -36,17 +35,17 @@ type adminHandler struct {
|
|||
services *services.AdminHandler
|
||||
}
|
||||
|
||||
func newAdminHandler(locales locale.Locales, mediaDir string) *adminHandler {
|
||||
func newAdminHandler(mediaDir string) *adminHandler {
|
||||
return &adminHandler{
|
||||
campsite: campsite.NewAdminHandler(locales),
|
||||
campsite: campsite.NewAdminHandler(),
|
||||
company: company.NewAdminHandler(),
|
||||
home: home.NewAdminHandler(locales),
|
||||
home: home.NewAdminHandler(),
|
||||
legal: legal.NewAdminHandler(),
|
||||
location: location.NewAdminHandler(),
|
||||
media: media.NewAdminHandler(mediaDir),
|
||||
payment: booking.NewAdminHandler(),
|
||||
season: season.NewAdminHandler(locales),
|
||||
services: services.NewAdminHandler(locales),
|
||||
season: season.NewAdminHandler(),
|
||||
services: services.NewAdminHandler(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ func New(db *database.DB, avatarsDir string, mediaDir string) (http.Handler, err
|
|||
db: db,
|
||||
fileHandler: static,
|
||||
profile: profile,
|
||||
admin: newAdminHandler(locales, mediaDir),
|
||||
admin: newAdminHandler(mediaDir),
|
||||
public: newPublicHandler(),
|
||||
media: mediaHandler,
|
||||
locales: locales,
|
||||
|
|
|
@ -22,9 +22,9 @@ type AdminHandler struct {
|
|||
types *types.AdminHandler
|
||||
}
|
||||
|
||||
func NewAdminHandler(locales locale.Locales) *AdminHandler {
|
||||
func NewAdminHandler() *AdminHandler {
|
||||
return &AdminHandler{
|
||||
types: types.NewAdminHandler(locales),
|
||||
types: types.NewAdminHandler(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,11 +22,10 @@ import (
|
|||
)
|
||||
|
||||
type AdminHandler struct {
|
||||
locales locale.Locales
|
||||
}
|
||||
|
||||
func NewAdminHandler(locales locale.Locales) *AdminHandler {
|
||||
return &AdminHandler{locales}
|
||||
func NewAdminHandler() *AdminHandler {
|
||||
return &AdminHandler{}
|
||||
}
|
||||
|
||||
func (h *AdminHandler) Handler(user *auth.User, company *auth.Company, conn *database.Conn) http.Handler {
|
||||
|
|
|
@ -24,16 +24,14 @@ import (
|
|||
type AdminHandler struct {
|
||||
name string
|
||||
indexHandler IndexHandler
|
||||
locales locale.Locales
|
||||
}
|
||||
|
||||
type IndexHandler func(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company, conn *database.Conn)
|
||||
|
||||
func NewAdminHandler(name string, indexHandler IndexHandler, locales locale.Locales) *AdminHandler {
|
||||
func NewAdminHandler(name string, indexHandler IndexHandler) *AdminHandler {
|
||||
return &AdminHandler{
|
||||
name: name,
|
||||
indexHandler: indexHandler,
|
||||
locales: locales,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,21 +12,18 @@ import (
|
|||
"dev.tandem.ws/tandem/camper/pkg/carousel"
|
||||
"dev.tandem.ws/tandem/camper/pkg/database"
|
||||
httplib "dev.tandem.ws/tandem/camper/pkg/http"
|
||||
"dev.tandem.ws/tandem/camper/pkg/locale"
|
||||
"dev.tandem.ws/tandem/camper/pkg/template"
|
||||
)
|
||||
|
||||
const carouselName = "home"
|
||||
|
||||
type AdminHandler struct {
|
||||
locales locale.Locales
|
||||
carousel *carousel.AdminHandler
|
||||
}
|
||||
|
||||
func NewAdminHandler(locales locale.Locales) *AdminHandler {
|
||||
func NewAdminHandler() *AdminHandler {
|
||||
return &AdminHandler{
|
||||
locales: locales,
|
||||
carousel: carousel.NewAdminHandler(carouselName, serveHomeIndex, locales),
|
||||
carousel: carousel.NewAdminHandler(carouselName, serveHomeIndex),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,13 +29,10 @@ import (
|
|||
const UnsetColor = 0xd1d0df
|
||||
|
||||
type AdminHandler struct {
|
||||
locales locale.Locales
|
||||
}
|
||||
|
||||
func NewAdminHandler(locales locale.Locales) *AdminHandler {
|
||||
return &AdminHandler{
|
||||
locales: locales,
|
||||
}
|
||||
func NewAdminHandler() *AdminHandler {
|
||||
return &AdminHandler{}
|
||||
}
|
||||
|
||||
func (h *AdminHandler) Handler(user *auth.User, company *auth.Company, conn *database.Conn) http.HandlerFunc {
|
||||
|
|
|
@ -24,14 +24,12 @@ import (
|
|||
const carouselName = "services"
|
||||
|
||||
type AdminHandler struct {
|
||||
locales locale.Locales
|
||||
carousel *carousel.AdminHandler
|
||||
}
|
||||
|
||||
func NewAdminHandler(locales locale.Locales) *AdminHandler {
|
||||
func NewAdminHandler() *AdminHandler {
|
||||
return &AdminHandler{
|
||||
locales: locales,
|
||||
carousel: carousel.NewAdminHandler(carouselName, serveServicesIndex, locales),
|
||||
carousel: carousel.NewAdminHandler(carouselName, serveServicesIndex),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue