From a888288ea93ce36f439d7e273a1e4a978da4d57c Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 25 Oct 2019 13:17:24 +0100 Subject: [PATCH 1/2] ensure all track image urls are accessed with the correct slash, check for tracks with no layouts --- content_tracks.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/content_tracks.go b/content_tracks.go index 1ec40fa06..6aba56f94 100644 --- a/content_tracks.go +++ b/content_tracks.go @@ -25,14 +25,20 @@ type Track struct { MetaData TrackMetaData } +const defaultTrackURL = "/static/img/no-preview-general.png" + func (t Track) GetImagePath() string { + if len(t.Layouts) == 0 { + return defaultTrackURL + } + for _, layout := range t.Layouts { if layout == defaultLayoutName || layout == "" { - return filepath.Join("content", "tracks", t.Name, "ui", "preview.png") + return filepath.ToSlash(filepath.Join("content", "tracks", t.Name, "ui", "preview.png")) } } - return filepath.Join("content", "tracks", t.Name, "ui", t.Layouts[0], "preview.png") + return filepath.ToSlash(filepath.Join("content", "tracks", t.Name, "ui", t.Layouts[0], "preview.png")) } func (t *Track) LoadMetaData() error { @@ -88,7 +94,7 @@ func trackLayoutURL(track, layout string) string { _, err := os.Stat(filepath.Join(ServerInstallPath, layoutPath)) if err != nil { - return defaultSkinURL + return defaultTrackURL } return "/" + filepath.ToSlash(layoutPath) From d86779c3ad86a352ebd88c981f7f14415337aaa4 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 25 Oct 2019 15:40:39 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2da16c917..a70ecba95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +v1.5.2 +------ + +Fixes: + +* Fixes track pages for users running Server Manager on Windows + +--- + v1.5.1 ------