feat(plugins): progress on plugin details page, # 4275

This commit is contained in:
Torkel Ödegaard
2016-03-07 14:31:02 +01:00
parent 1ff428087e
commit 135679096b
14 changed files with 107 additions and 37 deletions

View File

@ -28,8 +28,8 @@ func (fp *FrontendPluginBase) initFrontendPlugin() {
fp.handleModuleDefaults()
fp.Info.Logos.Small = evalRelativePluginUrlPath(fp.Info.Logos.Small, fp.Id)
fp.Info.Logos.Large = evalRelativePluginUrlPath(fp.Info.Logos.Large, fp.Id)
fp.Info.Logos.Small = evalRelativePluginUrlPath(fp.Info.Logos.Small, fp.BaseUrl)
fp.Info.Logos.Large = evalRelativePluginUrlPath(fp.Info.Logos.Large, fp.BaseUrl)
for i := 0; i < len(fp.Info.Screenshots); i++ {
fp.Info.Screenshots[i].Path = evalRelativePluginUrlPath(fp.Info.Screenshots[i].Path, fp.Id)
@ -55,7 +55,7 @@ func (fp *FrontendPluginBase) handleModuleDefaults() {
fp.BaseUrl = path.Join("public/app/plugins", fp.Type, fp.Id)
}
func evalRelativePluginUrlPath(pathStr string, pluginId string) string {
func evalRelativePluginUrlPath(pathStr string, baseUrl string) string {
if pathStr == "" {
return ""
}
@ -64,5 +64,5 @@ func evalRelativePluginUrlPath(pathStr string, pluginId string) string {
if u.IsAbs() {
return pathStr
}
return path.Join("public/plugins", pluginId, pathStr)
return path.Join(baseUrl, pathStr)
}