Browse Source

Wysiwyg assets files to template paths

Vova Tkach 5 years ago
parent
commit
9bea7c884a
3 changed files with 42 additions and 36 deletions
  1. 14 12
      consts/consts.go
  2. 14 12
      utils/utils.go
  3. 14 12
      utils/utils_test.go

+ 14 - 12
consts/consts.go

@@ -43,18 +43,20 @@ type BreadCrumb struct {
 
 // Template data
 type TmplSystem struct {
-	PathIcoFav       string
-	PathSvgLogo      string
-	PathCssStyles    string
-	PathCssCpStyles  string
-	PathCssBootstrap string
-	PathJsJquery     string
-	PathJsPopper     string
-	PathJsBootstrap  string
-	PathJsCpScripts  string
-	PathThemeStyles  string
-	PathThemeScripts string
-	InfoVersion      string
+	PathIcoFav           string
+	PathSvgLogo          string
+	PathCssStyles        string
+	PathCssCpStyles      string
+	PathCssBootstrap     string
+	PathCssCpWysiwygPell string
+	PathJsJquery         string
+	PathJsPopper         string
+	PathJsBootstrap      string
+	PathJsCpScripts      string
+	PathThemeStyles      string
+	PathThemeScripts     string
+	InfoVersion          string
+	PathJsCpWysiwygPell  string
 }
 
 type TmplError struct {

+ 14 - 12
utils/utils.go

@@ -110,18 +110,20 @@ func GetAssetsUrl(filename string) string {
 
 func GetTmplSystemData() consts.TmplSystem {
 	return consts.TmplSystem{
-		PathIcoFav:       GetAssetsUrl(consts.AssetsSysFaveIco),
-		PathSvgLogo:      GetAssetsUrl(consts.AssetsSysLogoSvg),
-		PathCssStyles:    GetAssetsUrl(consts.AssetsSysStylesCss),
-		PathCssCpStyles:  GetAssetsUrl(consts.AssetsCpStylesCss),
-		PathCssBootstrap: GetAssetsUrl(consts.AssetsBootstrapCss),
-		PathJsJquery:     GetAssetsUrl(consts.AssetsJqueryJs),
-		PathJsPopper:     GetAssetsUrl(consts.AssetsPopperJs),
-		PathJsBootstrap:  GetAssetsUrl(consts.AssetsBootstrapJs),
-		PathJsCpScripts:  GetAssetsUrl(consts.AssetsCpScriptsJs),
-		PathThemeStyles:  "/assets/theme/styles.css",
-		PathThemeScripts: "/assets/theme/scripts.js",
-		InfoVersion:      consts.ServerVersion,
+		PathIcoFav:           GetAssetsUrl(consts.AssetsSysFaveIco),
+		PathSvgLogo:          GetAssetsUrl(consts.AssetsSysLogoSvg),
+		PathCssStyles:        GetAssetsUrl(consts.AssetsSysStylesCss),
+		PathCssCpStyles:      GetAssetsUrl(consts.AssetsCpStylesCss),
+		PathCssBootstrap:     GetAssetsUrl(consts.AssetsBootstrapCss),
+		PathCssCpWysiwygPell: GetAssetsUrl(consts.AssetsCpWysiwygPellCss),
+		PathJsJquery:         GetAssetsUrl(consts.AssetsJqueryJs),
+		PathJsPopper:         GetAssetsUrl(consts.AssetsPopperJs),
+		PathJsBootstrap:      GetAssetsUrl(consts.AssetsBootstrapJs),
+		PathJsCpScripts:      GetAssetsUrl(consts.AssetsCpScriptsJs),
+		PathJsCpWysiwygPell:  GetAssetsUrl(consts.AssetsCpWysiwygPellJs),
+		PathThemeStyles:      "/assets/theme/styles.css",
+		PathThemeScripts:     "/assets/theme/scripts.js",
+		InfoVersion:          consts.ServerVersion,
 	}
 }
 

+ 14 - 12
utils/utils_test.go

@@ -114,18 +114,20 @@ func TestGetAssetsUrl(t *testing.T) {
 
 func TestGetTmplSystemData(t *testing.T) {
 	Expect(t, GetTmplSystemData(), consts.TmplSystem{
-		PathIcoFav:       "/assets/sys/fave.ico?v=" + consts.AssetsVersion,
-		PathSvgLogo:      "/assets/sys/logo.svg?v=" + consts.AssetsVersion,
-		PathCssStyles:    "/assets/sys/styles.css?v=" + consts.AssetsVersion,
-		PathCssCpStyles:  "/assets/cp/styles.css?v=" + consts.AssetsVersion,
-		PathCssBootstrap: "/assets/bootstrap.css?v=" + consts.AssetsVersion,
-		PathJsJquery:     "/assets/jquery.js?v=" + consts.AssetsVersion,
-		PathJsPopper:     "/assets/popper.js?v=" + consts.AssetsVersion,
-		PathJsBootstrap:  "/assets/bootstrap.js?v=" + consts.AssetsVersion,
-		PathJsCpScripts:  "/assets/cp/scripts.js?v=" + consts.AssetsVersion,
-		PathThemeStyles:  "/assets/theme/styles.css",
-		PathThemeScripts: "/assets/theme/scripts.js",
-		InfoVersion:      consts.ServerVersion,
+		PathIcoFav:           "/assets/sys/fave.ico?v=" + consts.AssetsVersion,
+		PathSvgLogo:          "/assets/sys/logo.svg?v=" + consts.AssetsVersion,
+		PathCssStyles:        "/assets/sys/styles.css?v=" + consts.AssetsVersion,
+		PathCssCpStyles:      "/assets/cp/styles.css?v=" + consts.AssetsVersion,
+		PathCssBootstrap:     "/assets/bootstrap.css?v=" + consts.AssetsVersion,
+		PathCssCpWysiwygPell: "/assets/cp/wysiwyg/pell.css?v=" + consts.AssetsVersion,
+		PathJsJquery:         "/assets/jquery.js?v=" + consts.AssetsVersion,
+		PathJsPopper:         "/assets/popper.js?v=" + consts.AssetsVersion,
+		PathJsBootstrap:      "/assets/bootstrap.js?v=" + consts.AssetsVersion,
+		PathJsCpScripts:      "/assets/cp/scripts.js?v=" + consts.AssetsVersion,
+		PathJsCpWysiwygPell:  "/assets/cp/wysiwyg/pell.js?v=" + consts.AssetsVersion,
+		PathThemeStyles:      "/assets/theme/styles.css",
+		PathThemeScripts:     "/assets/theme/scripts.js",
+		InfoVersion:          consts.ServerVersion,
 	})
 }