feat(plugins): made it possible to have relative plugin template urls

This commit is contained in:
Torkel Ödegaard
2016-02-09 18:17:32 +01:00
parent 9653f43466
commit 8784be9a14
24 changed files with 61 additions and 32 deletions

View File

@ -9,6 +9,7 @@ import (
type FrontendPluginBase struct {
PluginBase
Module string `json:"module"`
BaseUrl string `json:"baseUrl"`
StaticRoot string `json:"staticRoot"`
StaticRootAbs string `json:"-"`
}
@ -34,10 +35,12 @@ func (fp *FrontendPluginBase) handleModuleDefaults() {
if fp.StaticRoot != "" {
fp.Module = path.Join("plugins", fp.Id, "module")
fp.BaseUrl = path.Join("public/plugins", fp.Id)
return
}
fp.Module = path.Join("app/plugins", fp.Type, fp.Id, "module")
fp.BaseUrl = path.Join("public/app/plugins", fp.Type, fp.Id)
}
func evalRelativePluginUrlPath(pathStr string, pluginId string) string {