consts.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. package consts
  2. import (
  3. "html/template"
  4. )
  5. const AssetsPath = "assets"
  6. const AssetsVersion = "37"
  7. const DirIndexFile = "index.html"
  8. // Bootstrap resources
  9. const AssetsBootstrapCss = AssetsPath + "/bootstrap.css"
  10. const AssetsBootstrapJs = AssetsPath + "/bootstrap.js"
  11. const AssetsJqueryJs = AssetsPath + "/jquery.js"
  12. const AssetsPopperJs = AssetsPath + "/popper.js"
  13. // System resources
  14. const AssetsCpScriptsJs = AssetsPath + "/cp/scripts.js"
  15. const AssetsCpStylesCss = AssetsPath + "/cp/styles.css"
  16. const AssetsSysBgPng = AssetsPath + "/sys/bg.png"
  17. const AssetsSysFaveIco = AssetsPath + "/sys/fave.ico"
  18. const AssetsSysLogoPng = AssetsPath + "/sys/logo.png"
  19. const AssetsSysLogoSvg = AssetsPath + "/sys/logo.svg"
  20. const AssetsSysStylesCss = AssetsPath + "/sys/styles.css"
  21. // Wysiwyg editor
  22. const AssetsCpWysiwygPellCss = AssetsPath + "/cp/wysiwyg/pell.css"
  23. const AssetsCpWysiwygPellJs = AssetsPath + "/cp/wysiwyg/pell.js"
  24. // CodeMirror template editor
  25. const AssetsCpCodeMirrorCss = AssetsPath + "/cp/tmpl-editor/codemirror.css"
  26. const AssetsCpCodeMirrorJs = AssetsPath + "/cp/tmpl-editor/codemirror.js"
  27. // Make global for other packages
  28. var ParamDebug bool
  29. var ParamHost string
  30. var ParamKeepAlive bool
  31. var ParamPort int
  32. var ParamWwwDir string
  33. // For admin panel
  34. type BreadCrumb struct {
  35. Name string
  36. Link string
  37. }
  38. // Template data
  39. type TmplSystem struct {
  40. CpModule string
  41. CpSubModule string
  42. InfoVersion string
  43. PathCssBootstrap string
  44. PathCssCpCodeMirror string
  45. PathCssCpStyles string
  46. PathCssCpWysiwygPell string
  47. PathCssStyles string
  48. PathJsBootstrap string
  49. PathJsCpCodeMirror string
  50. PathJsCpScripts string
  51. PathJsCpWysiwygPell string
  52. PathJsJquery string
  53. PathJsPopper string
  54. PathSvgLogo string
  55. PathThemeScripts string
  56. PathThemeStyles string
  57. PathIcoFav string
  58. }
  59. type TmplError struct {
  60. ErrorMessage string
  61. }
  62. type TmplData struct {
  63. System TmplSystem
  64. Data interface{}
  65. }
  66. type TmplDataCpBase struct {
  67. BodyClasses string
  68. Caption string
  69. Content template.HTML
  70. ModuleCurrentAlias string
  71. NavBarModules template.HTML
  72. NavBarModulesSys template.HTML
  73. SidebarLeft template.HTML
  74. SidebarRight template.HTML
  75. UserAvatarLink string
  76. UserEmail string
  77. UserFirstName string
  78. UserId int
  79. UserLastName string
  80. UserPassword string
  81. Title string
  82. }