chore: build
Backend - Build & Lint / Build (push) Has been cancelled
Backend - Build & Lint / Docker Build & Push (push) Has been cancelled
Backend - Build & Lint / SSH Deploy (push) Has been cancelled
Backend - Build & Lint / Static Analysis (golangci-lint + gosec) (push) Has been cancelled
Backend - Build & Lint / Build (push) Has been cancelled
Backend - Build & Lint / Docker Build & Push (push) Has been cancelled
Backend - Build & Lint / SSH Deploy (push) Has been cancelled
Backend - Build & Lint / Static Analysis (golangci-lint + gosec) (push) Has been cancelled
This commit is contained in:
@@ -72,6 +72,16 @@ func DefaultSettings() models.AppSettings {
|
|||||||
Mode: "single",
|
Mode: "single",
|
||||||
CategoryRoutes: []models.CategoryRoute{},
|
CategoryRoutes: []models.CategoryRoute{},
|
||||||
},
|
},
|
||||||
|
AdminColorPrimary: "#7c3aed",
|
||||||
|
AdminColorSecondary: "#22d3ee",
|
||||||
|
AdminColorSuccess: "#4ade80",
|
||||||
|
AdminColorDanger: "#ef4444",
|
||||||
|
AdminColorWarning: "#f59e0b",
|
||||||
|
ClientColorPrimary: "#7c3aed",
|
||||||
|
ClientColorSecondary: "#22d3ee",
|
||||||
|
ClientColorSuccess: "#4ade80",
|
||||||
|
ClientColorDanger: "#ef4444",
|
||||||
|
ClientColorWarning: "#f59e0b",
|
||||||
DeliverySchedule: DefaultDeliverySchedule(),
|
DeliverySchedule: DefaultDeliverySchedule(),
|
||||||
PostalZones: []models.PostalZone{
|
PostalZones: []models.PostalZone{
|
||||||
{Name: "Zone 30€", MinAmount: 30, Codes: []string{"44000", "44100", "44200", "44300"}},
|
{Name: "Zone 30€", MinAmount: 30, Codes: []string{"44000", "44100", "44200", "44300"}},
|
||||||
@@ -163,6 +173,26 @@ func (d *Database) GetSettings() (models.AppSettings, error) {
|
|||||||
settings.Telegram2FAEnabled = row.Value == "true"
|
settings.Telegram2FAEnabled = row.Value == "true"
|
||||||
case "shop_name":
|
case "shop_name":
|
||||||
settings.ShopName = row.Value
|
settings.ShopName = row.Value
|
||||||
|
case "admin_color_primary":
|
||||||
|
settings.AdminColorPrimary = row.Value
|
||||||
|
case "admin_color_secondary":
|
||||||
|
settings.AdminColorSecondary = row.Value
|
||||||
|
case "admin_color_success":
|
||||||
|
settings.AdminColorSuccess = row.Value
|
||||||
|
case "admin_color_danger":
|
||||||
|
settings.AdminColorDanger = row.Value
|
||||||
|
case "admin_color_warning":
|
||||||
|
settings.AdminColorWarning = row.Value
|
||||||
|
case "client_color_primary":
|
||||||
|
settings.ClientColorPrimary = row.Value
|
||||||
|
case "client_color_secondary":
|
||||||
|
settings.ClientColorSecondary = row.Value
|
||||||
|
case "client_color_success":
|
||||||
|
settings.ClientColorSuccess = row.Value
|
||||||
|
case "client_color_danger":
|
||||||
|
settings.ClientColorDanger = row.Value
|
||||||
|
case "client_color_warning":
|
||||||
|
settings.ClientColorWarning = row.Value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return settings, nil
|
return settings, nil
|
||||||
@@ -253,6 +283,16 @@ func (d *Database) UpdateSettings(s models.AppSettings) error {
|
|||||||
{"delivery_mode", string(deliveryModeJSON)},
|
{"delivery_mode", string(deliveryModeJSON)},
|
||||||
{"shop_name", s.ShopName},
|
{"shop_name", s.ShopName},
|
||||||
{"contact_telegram", s.ContactTelegram},
|
{"contact_telegram", s.ContactTelegram},
|
||||||
|
{"admin_color_primary", s.AdminColorPrimary},
|
||||||
|
{"admin_color_secondary", s.AdminColorSecondary},
|
||||||
|
{"admin_color_success", s.AdminColorSuccess},
|
||||||
|
{"admin_color_danger", s.AdminColorDanger},
|
||||||
|
{"admin_color_warning", s.AdminColorWarning},
|
||||||
|
{"client_color_primary", s.ClientColorPrimary},
|
||||||
|
{"client_color_secondary", s.ClientColorSecondary},
|
||||||
|
{"client_color_success", s.ClientColorSuccess},
|
||||||
|
{"client_color_danger", s.ClientColorDanger},
|
||||||
|
{"client_color_warning", s.ClientColorWarning},
|
||||||
}
|
}
|
||||||
|
|
||||||
upsert := `INSERT INTO app_settings (key, value) VALUES (?, ?)
|
upsert := `INSERT INTO app_settings (key, value) VALUES (?, ?)
|
||||||
|
|||||||
@@ -48,6 +48,11 @@ func GetPublicSettings(c *gin.Context) {
|
|||||||
"shop_name": settings.ShopName,
|
"shop_name": settings.ShopName,
|
||||||
"two_fa_enabled": settings.Telegram2FAEnabled,
|
"two_fa_enabled": settings.Telegram2FAEnabled,
|
||||||
"contact_telegram": settings.ContactTelegram,
|
"contact_telegram": settings.ContactTelegram,
|
||||||
|
"client_color_primary": settings.ClientColorPrimary,
|
||||||
|
"client_color_secondary": settings.ClientColorSecondary,
|
||||||
|
"client_color_success": settings.ClientColorSuccess,
|
||||||
|
"client_color_danger": settings.ClientColorDanger,
|
||||||
|
"client_color_warning": settings.ClientColorWarning,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,4 +106,16 @@ type AppSettings struct {
|
|||||||
ShopName string `json:"shop_name"` // nom affiché dans la sidebar du site client
|
ShopName string `json:"shop_name"` // nom affiché dans la sidebar du site client
|
||||||
Telegram2FAEnabled bool `json:"telegram_2fa_enabled"` // activer/désactiver l'authentification à deux facteurs
|
Telegram2FAEnabled bool `json:"telegram_2fa_enabled"` // activer/désactiver l'authentification à deux facteurs
|
||||||
ContactTelegram string `json:"contact_telegram"` // numéro de téléphone Telegram du contact
|
ContactTelegram string `json:"contact_telegram"` // numéro de téléphone Telegram du contact
|
||||||
|
// Palette de couleurs — espace admin
|
||||||
|
AdminColorPrimary string `json:"admin_color_primary"`
|
||||||
|
AdminColorSecondary string `json:"admin_color_secondary"`
|
||||||
|
AdminColorSuccess string `json:"admin_color_success"`
|
||||||
|
AdminColorDanger string `json:"admin_color_danger"`
|
||||||
|
AdminColorWarning string `json:"admin_color_warning"`
|
||||||
|
// Palette de couleurs — app client + site web
|
||||||
|
ClientColorPrimary string `json:"client_color_primary"`
|
||||||
|
ClientColorSecondary string `json:"client_color_secondary"`
|
||||||
|
ClientColorSuccess string `json:"client_color_success"`
|
||||||
|
ClientColorDanger string `json:"client_color_danger"`
|
||||||
|
ClientColorWarning string `json:"client_color_warning"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user