dashboard: can customize main image background

This commit is contained in:
nemunaire 2023-05-12 15:41:43 +02:00
parent 37dde01444
commit 20dc1f65dc
8 changed files with 29 additions and 4 deletions

View file

@ -9,7 +9,7 @@ import (
)
// ImportChallengeInfo imports images defined in the challengeinfo.
func ImportChallengeInfo(ci *settings.ChallengeInfo) (err error) {
func ImportChallengeInfo(ci *settings.ChallengeInfo, dashboardDir string) (err error) {
if len(ci.MainLogo) > 0 {
for i, logo := range ci.MainLogo {
dest := path.Join(fic.FilesDir, "logo", path.Base(logo))
@ -22,6 +22,14 @@ func ImportChallengeInfo(ci *settings.ChallengeInfo) (err error) {
}
}
if len(ci.DashboardBackground) > 0 {
dest := path.Join(dashboardDir, path.Base(ci.DashboardBackground))
err = importFile(GlobalImporter, ci.DashboardBackground, dest)
if err != nil {
return
}
}
if len(ci.Partners) > 0 {
for i, partner := range ci.Partners {
dest := path.Join(fic.FilesDir, "partner", path.Base(partner.Src))