consts.go 2.1 KB

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